]> git.donarmstrong.com Git - debhelper.git/commitdiff
r127: Initial Import
authorjoey <joey>
Tue, 17 Aug 1999 05:02:01 +0000 (05:02 +0000)
committerjoey <joey>
Tue, 17 Aug 1999 05:02:01 +0000 (05:02 +0000)
Dh_Getopt.pm
Dh_Lib.pm
autoscripts/postinst-init-norestart
debhelper.1
debian/changelog
debian/rules
dh_lib
examples/rules.indep

index e92408930ef01bcbf1f0b7c09fa185689589a360..1592d5d020fa09d7adee1703d4996b33bd7fbd51 100644 (file)
@@ -31,6 +31,10 @@ sub AddPackage { my($option,$value)=@_;
        elsif ($option eq 'p' or $option eq 'package') {
                push @{$options{DOPACKAGES}}, $value;
        }
+       elsif ($option eq 's' or $option eq 'same-arch') {
+               push @{$options{DOPACKAGES}}, GetPackages('same');
+               $options{DOSAME}=1;
+       }
        else {
                error("bad option $option - should never happen!\n");
        }
@@ -63,6 +67,9 @@ sub parseopts {
                "p=s" => \&AddPackage,
                "package=s" => \&AddPackage,
        
+               "s" => \&AddPackage,
+               "same-arch" => \&AddPackage,
+       
                "N=s" => \&ExcludePackage,
                "no-package=s" => \&ExcludePackage,
        
@@ -120,7 +127,7 @@ sub parseopts {
        # want us to act on them all. Note we have to do this before excluding
        # packages out, below.
        if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) {
-               if ($options{DOINDEP} || $options{DOARCH}) {
+               if ($options{DOINDEP} || $options{DOARCH} || $options{DOSAME}) {
                                # User specified that all arch (in)dep package be
                                # built, and there are none of that type.
                                error("I have no package to build");
index be8a3e04b40ca0484f15ac21b2c4ee425a8e66e3..2b80ce455b8e0069e26f6c2f45c6c7a01abd0b81 100644 (file)
--- a/Dh_Lib.pm
+++ b/Dh_Lib.pm
@@ -21,8 +21,8 @@ sub init {
        }
 
        # Check to see if an argument on the command line starts with a dash.
-       # if so, we need to pass this off to the resource intensive Getopt::Long,
-       # which I'd prefer to avoid loading at all if possible.
+       # if so, we need to pass this off to the resource intensive 
+       # Getopt::Long, which I'd prefer to avoid loading at all if possible.
        my $parseopt=undef;
        my $arg;
        foreach $arg (@ARGV) {
@@ -54,10 +54,10 @@ sub init {
        my @allpackages=GetPackages();
        $dh{MAINPACKAGE}=$allpackages[0];
 
-       # Check if packages to build have been specified, if not, fall back to 
+       # Check if packages to build have been specified, if not, fall back to
        # the default, doing them all.
        if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) {
-               if ($dh{DOINDEP} || $dh{DOARCH}) {
+               if ($dh{DOINDEP} || $dh{DOARCH} || $dh{DOSAME}) {
                        # User specified that all arch (in)dep package be 
                        # built, and there are none of that type.
                        error("I have no package to build");
@@ -270,14 +270,23 @@ sub filearray { my $file=shift;
 }
 
 # Returns a list of packages in the control file.
-# Must pass "arch" or "indep" to specify arch-dependant or -independant
-# packages. If nothing is specified, returns all packages.
+# Must pass "arch" or "indep" or "same" to specify arch-dependant or
+# -independant or same arch packages. If nothing is specified, returns all
+# packages.
 sub GetPackages { my $type=shift;
        $type="" if ! defined $type;
+       
+       # Look up the build arch if we need to.
+       my$buildarch='';
+       if ($type eq 'same') {
+               $buildarch=`dpkg --print-architecture` || error($!);
+               chomp $buildarch;
+       }
+
        my $package="";
        my $arch="";
        my @list=();
-       open (CONTROL,"<debian/control") || 
+       open (CONTROL,"<debian/control") ||
                error("cannot read debian/control: $!\n");
        while (<CONTROL>) {
                chomp;
@@ -292,6 +301,7 @@ sub GetPackages { my $type=shift;
                        if ($package &&
                            (($type eq 'indep' && $arch eq 'all') ||
                             ($type eq 'arch' && $arch ne 'all') ||
+                            ($type eq 'same' && ($arch eq 'any' || $arch =~ /\b$buildarch\b/)) ||
                             ! $type)) {
                                push @list, $package;
                                $package="";
index 05357d072e46a34b2dd9aa0d9a1e382b9d15b5d2..b33702c5d899fcd1f35a06d131b55f35f2e8e93f 100644 (file)
@@ -1 +1,6 @@
 update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+if [ "$1" = "configure" ]; then
+       if [ -z "$2" -o "$2" = "<unknown>" ]; then
+               /etc/init.d/#SCRIPT# start
+       fi
+fi
index 9051d4380111029fc9db2caa153cfb114dae0ece..62906dc5563056f9f42451ff7d8fd2a823b0eca2 100644 (file)
@@ -3,7 +3,7 @@
 debhelper \- overview of the debhelper commands
 .SH SYNOPSIS
 .B dh_*
-.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Npackage] [-Ptmpdir]"
+.I "[-v] [-a] [-i] [-s] [--no-act] [-ppackage] [-Npackage] [-Ptmpdir]"
 .SH "DESCRIPTION"
 Debhelper is a collection of programs that can be used in debian/rules files
 to automate common tasks related to building debian binary packages. All the
@@ -29,6 +29,15 @@ Act on all architecture independent packages.
 .B \-ppackage, \--package=package
 Act on the package named "package".
 .TP
+.B \-s, \--same-arch
+This is a smarter version of the -a flag, that is used in some rare
+circumstances. It understands that if the control file lists "Architecture: i386"
+for the package, the package should not be acted on on other architectures. So
+this flag makes the command act on all "Architecture: any" packages, as well
+as on any packages that have the current architecture explicitly specified.
+Constrast to the -a flag, which makes the command work on all packages that
+are not architecture independant.
+.TP
 .B \-Npackage, \--no-package=package
 Do not act on the specified package even if an -a, -i, or -p option lists
 the package as one that should be acted on.
@@ -52,8 +61,10 @@ are acted on by debhelper programs, all debhelper programs accept the
 .B -a
 ,
 .B -i
-, and 
+,
 .B -p
+, and
+.B -s
 parameters. These parameters are cumulative. If none are given,
 debhelper programs default to acting on all packages listed in the control
 file.
index 283a88e39fa11dcacc1a054d0d8803245c1eca6a..3c8671079f46cea7ea986efcc0f4b8145c558d34 100644 (file)
@@ -1,3 +1,13 @@
+debhelper (1.1.20) unstable; urgency=low
+
+  * Added a --same-arch flag, that is useful in the rare case when you have
+    a package that builds only for 1 architecture, as part of a multi-part,
+    multi-architecture source package. (Ie, netscape-dmotif).
+  * Modified dh_installinit -r so it does start the daemon on the initial
+    install (#26680).
+
+ -- Joey Hess <joeyh@master.debian.org>  Fri,  2 Oct 1998 15:55:13 -0700
+
 debhelper (1.1.19) unstable; urgency=low
 
   * dh_installmanpages: look at basename of man pacges specified on command
index 20ba1a7054d9af278072e9ea12dde55a1e3bed91..bb790cd38f5c7f80ac63e648800f18b54e003ace 100755 (executable)
@@ -54,7 +54,7 @@ binary-indep: build
 # Install in the proper location on my ftp server and web server. Not intended
 # for use by anyone except the author.
 OLD_VER=$(shell perl -e '<>;<>;while(<>){last if /^ --/};<>;$$_=<>;print m/\((.*?)\)/'<debian/changelog)
-localdist:
+dist:
        dpkg-buildpackage -rfakeroot -tc
        if [ `hostname` = 'kite' ] ; then \
                cp ../debhelper_$(VERSION).tar.gz ../../public; \
diff --git a/dh_lib b/dh_lib
index 1ff2a5b117dd2b803a6a52f3b4e92a402a2602a3..a0f8bb91e453249e2b88c002c8f3f8c5c34b278b 100644 (file)
--- a/dh_lib
+++ b/dh_lib
@@ -167,7 +167,7 @@ MAINPACKAGE=`grep ^Package: debian/control | cut -d " " -f 2 | head -1`
 # Check if packages to build have been specified, if not, fall back to 
 # the default, doing them all.
 if [ ! "$DH_DOPACKAGES" ]; then
-       if [ "$DH_DOINDEP" -o "$DH_DOARCH" ]; then
+       if [ "$DH_DOINDEP" -o "$DH_DOARCH" -o "$DH_DOSAME" ]; then
                error "I have no package to build."
        fi
        DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tr "\n" " "`
index eabd48407c1d1e59769042efd1418c24b061d7e7..4b80f1c8efb4187502f459b73471ab319aee1928 100755 (executable)
@@ -67,4 +67,4 @@ source diff:
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
+.PHONY: build clean binary-indep binary-arch binary install