~ubuntu-branches/ubuntu/hardy/sbuild/hardy

« back to all changes in this revision

Viewing changes to bin/sbuild-adduser

  • Committer: Bazaar Package Importer
  • Author(s): Roger Leigh, Jan-Marek Glogowski
  • Date: 2008-01-01 11:36:55 UTC
  • mfrom: (8.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080101113655-rxlefdonr61fnikq
Tags: 0.57.0-1
* Sbuild/*.pm: Reindent to increase readability.
* Sbuild/Chroot.pm: set APT::Install-Recommends to false inside the
  chroot (Closes: #449253).
* Sbuild/Conf.pm: Add and export $check_depends_algorithm.
  [Jan-Marek Glogowski]
* sbuild:
  - Reindent to increase readability.
  - Add additional syntax checks.  Thanks to Jan-Marek Glogowski.
  - build: Use unicode line drawing characters instead of ASCII.
  - filter_dependencies: Remove redundant conditional.
    [Jan-Marek Glogowski]
  - Add check for check-depends-algorithm option. [Jan-Marek Glogowski]
  - filter_dependencies: Change dependency behaviour depending upon
    check_depends_algorithm.  [Jan-Marek Glogowski]
  - Move to bin/.
* avg-pkg-build-time:
  - Move to bin/.
* bin/*: Reindent to increase readability.
* chroot/*: Reindent to increase readability.
* bin/sbuild-createchroot:
  - Moved from chroot/buildd.chroot.
  - Also install fakeroot and build-essential.
* sbuild-createchroot.1.in: Add manual page.
* chroot/buildd.chroot:
  - Add GPL boilerplate.
  - Remove /etc/passwd creation (already done by debootstrap).
  - Remove sbuild directory creation (already done by schroot).
  - Use here doc to set up /etc/apt/sources.list.
  - List sources.list.
* chroot/README: Rename from README.buildd-chroot.  Remove
  buildd.chroot section.
* example.sbuildrc: Add missing variable types.  [Jan-Marek Glogowski]
* example.sbuildrc: Add missing variable types and add
  $check_depends_algorithm.  [Jan-Marek Glogowski]
* sbuild.1: Document --check-depends-algorithm [Jan-Marek Glogowski]
* Move manual pages to man/.
* debian/manpages: Move manual pages to man/.
* sbuild.conf: Move to etc/.
* example.sbuildrc: Move to etc/.
* debian/compat: Move to debhelper v6 compatibility level.
* debian/control: Update to Standards-Version 3.7.3.
* debian/copyright:
  - Update git repository location.
  - Update GPL boilerplate.
* debian/sbuild.dirs:
  - Rename from debian/dirs.
  - Remove all but -var/lib/sbuild/srcdep-lock.
* debian/manpages: Remove.
* debian/sbuild.postinst: Rename from debian/postinst.
* debian/sbuild.preinst: Rename from debian/preinst.
* debian/sbuild.postrm: Rename from debian/postrm.
* debian/sbuild.install:
  - New file.
  - Install files from usr/sbin and usr/share/man/man8.
* debian/rules:
  - Install sbuild-createchroot, and add buildd.chroot compatibility
    symlink.
  - Move -stamp files to debian/.
  - Remove GENFILES.
  - Run configure, make, and make install in appropriate rules.
  - Use dh_install.
  - Remove all special-cased installation rules (now handled by automake).
* Note: All upstream changes are now in an upstream ChangeLog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
#
 
3
# Copyright © 2006-2007 Roger Leigh <rleigh@debian.org>
 
4
#
 
5
# This program is free software: you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License as published by
 
7
# the Free Software Foundation, either version 2 of the License, or
 
8
# (at your option) any later version.
 
9
#
 
10
# This program is distributed in the hope that it will be useful, but
 
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
# General Public License for more details.
 
14
#
 
15
# You should have received a copy of the GNU General Public License
 
16
# along with this program.  If not, see
 
17
# <http://www.gnu.org/licenses/>.
 
18
#
 
19
#######################################################################
 
20
 
 
21
use strict;
 
22
use warnings;
 
23
 
 
24
package main;
 
25
 
 
26
sub usage {
 
27
    print STDERR "Usage: $0 <username>\n";
 
28
    exit 1;
 
29
}
 
30
 
 
31
usage() if (@ARGV < 1);
 
32
 
 
33
my $status = 0;
 
34
 
 
35
foreach (@ARGV) {
 
36
    my $user = getpwnam($_);
 
37
 
 
38
    if (defined $user) {
 
39
        $status += system("/usr/sbin/adduser", "$_", "sbuild");
 
40
    } else {
 
41
        print STDERR "W: User \"$_\" does not exist\n";
 
42
        $status++;
 
43
    }
 
44
}
 
45
 
 
46
if ($status == 0) {
 
47
    print STDOUT <<EOF;
 
48
 
 
49
Next, copy the example sbuildrc file to the home directory of each user and
 
50
set the variables for your system:
 
51
 
 
52
EOF
 
53
 
 
54
    foreach (@ARGV) {
 
55
        my $home = (getpwnam($_))[7];
 
56
        print STDERR "  cp /usr/share/doc/sbuild/examples/example.sbuildrc $home/.sbuildrc\n";
 
57
    }
 
58
    print STDOUT <<EOF;
 
59
 
 
60
Now try a build:
 
61
 
 
62
  cd /path/to/source
 
63
  /usr/share/sbuild/chrapt <distribution> apt-get update
 
64
  /usr/share/sbuild/chrapt <distribution> apt-get upgrade
 
65
  (or "/usr/share/sbuild/chrapt <distribution> apt-get -f install"
 
66
       first if the chroot is broken)
 
67
  sbuild -d <distribution> <package>_<version>
 
68
EOF
 
69
}
 
70
 
 
71
exit ($status ? 1:0);