From: joey Date: Tue, 17 Aug 1999 05:02:01 +0000 (+0000) Subject: r127: Initial Import X-Git-Tag: debian_version_0_1~110 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1225012d118cdc75892d02a41eb3ffcede466473;p=debhelper.git r127: Initial Import --- diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index e924089..1592d5d 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -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"); diff --git a/Dh_Lib.pm b/Dh_Lib.pm index be8a3e0..2b80ce4 100644 --- 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,") { 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=""; diff --git a/autoscripts/postinst-init-norestart b/autoscripts/postinst-init-norestart index 05357d0..b33702c 100644 --- a/autoscripts/postinst-init-norestart +++ b/autoscripts/postinst-init-norestart @@ -1 +1,6 @@ update-rc.d #SCRIPT# #INITPARMS# >/dev/null +if [ "$1" = "configure" ]; then + if [ -z "$2" -o "$2" = "" ]; then + /etc/init.d/#SCRIPT# start + fi +fi diff --git a/debhelper.1 b/debhelper.1 index 9051d43..62906dc 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -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. diff --git a/debian/changelog b/debian/changelog index 283a88e..3c86710 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 diff --git a/debian/rules b/debian/rules index 20ba1a7..bb790cd 100755 --- a/debian/rules +++ b/debian/rules @@ -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/\((.*?)\)/'&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