Author: guillem
Date: 2007-02-28 01:16:32 +0100 (Wed, 28 Feb 2007)
New Revision: 654

Modified:
   trunk/ChangeLog
   trunk/debian/changelog
   trunk/man/ChangeLog
   trunk/man/dpkg-checkbuilddeps.1
   trunk/man/dpkg-source.1
   trunk/scripts/dpkg-buildpackage.sh
   trunk/scripts/dpkg-checkbuilddeps.pl
   trunk/scripts/dpkg-shlibdeps.pl
Log:
Add support for '--admindir' in dpkg-buildpackage, dpkg-checkbuilddeps
and dpkg-shlibdeps. Closes: #162348


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2007-02-27 23:47:01 UTC (rev 653)
+++ trunk/ChangeLog     2007-02-28 00:16:32 UTC (rev 654)
@@ -1,5 +1,18 @@
 2007-02-28  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * 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  <[EMAIL PROTECTED]>
+
        * scripts/update-alternatives.pl (usage): Use '$altdir' instead of
        hardcoding its value.
 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2007-02-27 23:47:01 UTC (rev 653)
+++ trunk/debian/changelog      2007-02-28 00:16:32 UTC (rev 654)
@@ -39,6 +39,8 @@
   * 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).

Modified: trunk/man/ChangeLog
===================================================================
--- trunk/man/ChangeLog 2007-02-27 23:47:01 UTC (rev 653)
+++ trunk/man/ChangeLog 2007-02-28 00:16:32 UTC (rev 654)
@@ -1,3 +1,8 @@
+2007-02-28  Guillem Jover  <[EMAIL PROTECTED]>
+
+       * dpkg-source.1: Document new option '--admindir'.
+       * dpkg-checkbuilddeps.1: Likewise.
+
 2007-01-24  Frank Lichtenheld  <[EMAIL PROTECTED]>
 
        * 822-date.1: 822-date is now deprecated. Document this fact in

Modified: trunk/man/dpkg-checkbuilddeps.1
===================================================================
--- trunk/man/dpkg-checkbuilddeps.1     2007-02-27 23:47:01 UTC (rev 653)
+++ trunk/man/dpkg-checkbuilddeps.1     2007-02-28 00:16:32 UTC (rev 654)
@@ -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 @@
 .
 .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.

Modified: trunk/man/dpkg-source.1
===================================================================
--- trunk/man/dpkg-source.1     2007-02-27 23:47:01 UTC (rev 653)
+++ trunk/man/dpkg-source.1     2007-02-28 00:16:32 UTC (rev 654)
@@ -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 @@
 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

Modified: trunk/scripts/dpkg-buildpackage.sh
===================================================================
--- trunk/scripts/dpkg-buildpackage.sh  2007-02-27 23:47:01 UTC (rev 653)
+++ trunk/scripts/dpkg-buildpackage.sh  2007-02-28 00:16:32 UTC (rev 654)
@@ -51,6 +51,8 @@
   -E             when -W is turned on, -E turned it off.  } dpkg-source
   -i[<regex>]    ignore diffs of files matching regex.    } only passed
   -I<filename>   filter out files when building tarballs. } to dpkg-source
+  --admindir=<directory>
+                 change the administrative directory.
   -h, --help     show this help message.
       --version  show the version.
 END
@@ -80,15 +82,18 @@
 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 @@
 }
 
 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.)"

Modified: trunk/scripts/dpkg-checkbuilddeps.pl
===================================================================
--- trunk/scripts/dpkg-checkbuilddeps.pl        2007-02-27 23:47:01 UTC (rev 
653)
+++ trunk/scripts/dpkg-checkbuilddeps.pl        2007-02-28 00:16:32 UTC (rev 
654)
@@ -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 @@
 Options:
   control-file   control file to process (default: debian/control).
   -B             binary-only, ignore -Indep.
+  --admindir=<directory>
+                 change the administrative directory.
   -h             show this help message.
 "), $progname;
 }
@@ -26,7 +29,8 @@
 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 @@
 
 parsecontrolfile($controlfile);
 
-my @status=parse_status();
+my @status = parse_status("$admindir/status");
 my (@unmet, @conflicts);
 local $/='';
 
@@ -80,7 +84,7 @@
 # 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;

Modified: trunk/scripts/dpkg-shlibdeps.pl
===================================================================
--- trunk/scripts/dpkg-shlibdeps.pl     2007-02-27 23:47:01 UTC (rev 653)
+++ trunk/scripts/dpkg-shlibdeps.pl     2007-02-28 00:16:32 UTC (rev 654)
@@ -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 @@
 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 @@
   -L<localshlibsfile>      shlibs override file, not debian/shlibs.local.
   -T<varlistfile>          update variables here, not debian/substvars.
   -t<type>                 set package type (default is deb).
+  --admindir=<directory>   change the administrative directory.
   -h, --help               show this help message.
       --version            show the version.
 
@@ -83,6 +85,11 @@
        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 @@
     }
 }
 
+$shlibsppdir = "$admindir/info";
+
 @exec || usageerr(_g("need at least one executable"));
 
 sub isbin {


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to