From b4d9b94ef1e5b48565871f24b3c5a5804f3aa769 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 28 Feb 2007 00:16:32 +0000 Subject: [PATCH] Add support for '--admindir' in dpkg-buildpackage, dpkg-checkbuilddeps and dpkg-shlibdeps. Closes: #162348 --- ChangeLog | 13 +++++++++++++ debian/changelog | 2 ++ man/ChangeLog | 5 +++++ man/dpkg-checkbuilddeps.1 | 8 ++++++-- man/dpkg-source.1 | 8 +++++++- scripts/dpkg-buildpackage.sh | 11 ++++++++++- scripts/dpkg-checkbuilddeps.pl | 10 +++++++--- scripts/dpkg-shlibdeps.pl | 11 ++++++++++- 8 files changed, 60 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4c947cc..f4d9f7d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2007-02-28 Guillem Jover + + * scripts/dpkg-checkbuilddeps.pl: Make getopt parse '--admindir'. + ($admindir): New variable. + (usage): Document '--admindir'. + (parse_status): The status argument is not optional anymore. + * scripts/dpkg-shlibdeps.pl: Parse '--admindir'. + ($admindir): New variable. + ($shlibsppdir): Initialize it after parsing the arguments. + (usage): Document '--admindir'. + * scripts/dpkg-buildpackage.sh: Parse '--admindir', and document it in + usage output. Pass it to dpkg-checkbuilddeps. + 2007-02-28 Guillem Jover * scripts/update-alternatives.pl (usage): Use '$altdir' instead of diff --git a/debian/changelog b/debian/changelog index 5bed2992..cf2b149b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -39,6 +39,8 @@ dpkg (1.14.0) UNRELEASED; urgency=low * Fix regular expression special-casing Origin, Bugs and Maintainer fields which was making X[SBC]- fields containing such strings to propagate into the .deb control file unprocessed. Thanks to Colin Watson. + * Add support for '--admindir' in dpkg-buildpackage, dpkg-checkbuilddeps + and dpkg-shlibdeps. Closes: #162348 [ Updated dpkg translations ] * Romanian (Eddy Petrișor). diff --git a/man/ChangeLog b/man/ChangeLog index 59f6a892..f198c585 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2007-02-28 Guillem Jover + + * dpkg-source.1: Document new option '--admindir'. + * dpkg-checkbuilddeps.1: Likewise. + 2007-01-24 Frank Lichtenheld * 822-date.1: 822-date is now deprecated. Document this fact in diff --git a/man/dpkg-checkbuilddeps.1 b/man/dpkg-checkbuilddeps.1 index 3f7378c2..92906ac0 100644 --- a/man/dpkg-checkbuilddeps.1 +++ b/man/dpkg-checkbuilddeps.1 @@ -1,9 +1,9 @@ -.TH dpkg\-checkbuilddeps 1 "2006-05-23" "Debian Project" "dpkg utilities" +.TH dpkg\-checkbuilddeps 1 "2007-02-28" "Debian Project" "dpkg utilities" .SH NAME dpkg\-checkbuilddeps - check build dependencies and conflicts . .SH SYNOPSIS -\fBdpkg\-checkbuilddeps\fR \fB\-B\fR [\fIcontrol-file\fR] +\fBdpkg\-checkbuilddeps\fR [\fIoptions\fR] [\fIcontrol-file\fR] . .SH DESCRIPTION This program checks the installed packages in the system against the build @@ -15,6 +15,10 @@ may be specified on the command line. . .SH OPTIONS .TP +\fB\-\-admindir=\fIdir\fP +Change the location of the \fBdpkg\fR database. The default location is +\fI/var/lib/dpkg\fP. +.TP .B \-B Ignore \fIBuild\-Depends\-Indep\fR lines. Use when no arch-indep packages will be built. diff --git a/man/dpkg-source.1 b/man/dpkg-source.1 index 521e9bd4..a30a2265 100644 --- a/man/dpkg-source.1 +++ b/man/dpkg-source.1 @@ -1,5 +1,5 @@ .\" Authors: Ian Jackson -.TH dpkg\-source 1 "2006-05-23" "Debian Project" "dpkg utilities" +.TH dpkg\-source 1 "2007-02-28" "Debian Project" "dpkg utilities" .SH NAME dpkg\-source, dpkg\-gencontrol, dpkg\-shlibdeps, dpkg\-genchanges, dpkg\-buildpackage, dpkg\-distaddfile, dpkg\-parsechangelog @@ -104,6 +104,12 @@ Display the particular program's version, including copyright and license information. This option is understood by all the source package tools. .TP +.BI \-\-admindir= dir +In +.BR dpkg\-buildpackage " and " dpkg\-shlibdeps +change the location of the \fBdpkg\fR database. The default location is +\fI/var/lib/dpkg\fP. +.TP .BI \-v version In .BR dpkg\-buildpackage ", " dpkg\-genchanges " and " dpkg\-parsechangelog diff --git a/scripts/dpkg-buildpackage.sh b/scripts/dpkg-buildpackage.sh index fbd3ae0d..fcd0d1b0 100755 --- a/scripts/dpkg-buildpackage.sh +++ b/scripts/dpkg-buildpackage.sh @@ -51,6 +51,8 @@ Options: -E when -W is turned on, -E turned it off. } dpkg-source -i[] ignore diffs of files matching regex. } only passed -I filter out files when building tarballs. } to dpkg-source + --admindir= + change the administrative directory. -h, --help show this help message. --version show the version. END @@ -80,15 +82,18 @@ noclean=false usepause=false warnable_error=0 passopts='' +admindir='' while [ $# != 0 ] do - value="`echo x\"$1\" | sed -e 's/^x-.//'`" + value="`echo x\"$1\" | sed -e 's/x--.*=//;s/^x-.//'`" case "$1" in -h|--help) usage; exit 0 ;; --version) showversion; exit 0 ;; + --admindir=*) + admindir="$value" ;; -r*) rootcommand="$value" ;; -p*) signcommand="$value" ;; -k*) signkey="$value" ;; @@ -197,6 +202,10 @@ withecho () { } if [ "$checkbuilddep" = "true" ]; then + if [ -n "$admindir" ]; then + checkbuilddep_args="$checkbuilddep_args --admindir=$admindir" + fi + if ! dpkg-checkbuilddeps $checkbuilddep_args; then echo >&2 "$progname: Build dependencies/conflicts unsatisfied; aborting." echo >&2 "$progname: (Use -d flag to override.)" diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl index 7776c72a..d367efd6 100755 --- a/scripts/dpkg-checkbuilddeps.pl +++ b/scripts/dpkg-checkbuilddeps.pl @@ -5,6 +5,7 @@ use Getopt::Long; my $dpkglibdir="/usr/lib/dpkg"; +my $admindir = "/var/lib/dpkg"; push(@INC,$dpkglibdir); #my $controlfile; require 'controllib.pl'; @@ -19,6 +20,8 @@ sub usage { Options: control-file control file to process (default: debian/control). -B binary-only, ignore -Indep. + --admindir= + change the administrative directory. -h show this help message. "), $progname; } @@ -26,7 +29,8 @@ Options: my $binary_only=0; my $want_help=0; if (! GetOptions('-B' => \$binary_only, - '-h' => \$want_help)) { + '-h' => \$want_help, + '--admindir=s' => \$admindir)) { usage(); exit(2); } @@ -40,7 +44,7 @@ $controlfile=$control; parsecontrolfile($controlfile); -my @status=parse_status(); +my @status = parse_status("$admindir/status"); my (@unmet, @conflicts); local $/=''; @@ -80,7 +84,7 @@ exit 1 if @unmet || @conflicts; # thanks to Matt Zimmerman. Returns two hash references that # are exactly what the other functions need... sub parse_status { - my $status=shift || "/var/lib/dpkg/status"; + my $status = shift; my %providers; my %version; diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 04a3c709..8b4da006 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -4,6 +4,7 @@ # $Id$ my $dpkglibdir="/usr/lib/dpkg"; +my $admindir = "/var/lib/dpkg"; my $version="1.4.1.19"; # This line modified by Makefile use English; @@ -12,7 +13,7 @@ use POSIX qw(:errno_h :signal_h); my $shlibsoverride= '/etc/dpkg/shlibs.override'; my $shlibsdefault= '/etc/dpkg/shlibs.default'; my $shlibslocal= 'debian/shlibs.local'; -my $shlibsppdir= '/var/lib/dpkg/info'; +my $shlibsppdir; my $shlibsppext= '.shlibs'; my $varnameprefix= 'shlibs'; my $dependencyfield= 'Depends'; @@ -61,6 +62,7 @@ Options: -L shlibs override file, not debian/shlibs.local. -T update variables here, not debian/substvars. -t set package type (default is deb). + --admindir= change the administrative directory. -h, --help show this help message. --version show the version. @@ -83,6 +85,11 @@ foreach (@ARGV) { usage; exit(0); } elsif (m/^--version$/) { version; exit(0); + } elsif (m/^--admindir=/) { + $admindir = $POSTMATCH; + -d $admindir || + error(sprintf(_g("administrative directory '%s' does not exist"), + $admindir)); } elsif (m/^-d/) { $dependencyfield= capit($POSTMATCH); defined($depstrength{$dependencyfield}) || @@ -98,6 +105,8 @@ foreach (@ARGV) { } } +$shlibsppdir = "$admindir/info"; + @exec || usageerr(_g("need at least one executable")); sub isbin { -- 2.39.5