summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dh_Getopt.pm23
-rw-r--r--Dh_Lib.pm5
-rw-r--r--debhelper.17
-rw-r--r--debian/changelog15
-rw-r--r--debian/control2
-rw-r--r--dh_lib5
-rwxr-xr-xdh_strip4
7 files changed, 56 insertions, 5 deletions
diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm
index 0f9dafdf..e9240893 100644
--- a/Dh_Getopt.pm
+++ b/Dh_Getopt.pm
@@ -49,7 +49,7 @@ sub AddExclude { my($option,$value)=@_;
# Parse options and return a hash of the values.
sub parseopts {
undef %options;
-
+
my $ret=GetOptions(
"v" => \$options{VERBOSE},
"verbose" => \$options{VERBOSE},
@@ -109,13 +109,25 @@ sub parseopts {
if (!$ret) {
error("unknown option; aborting");
}
-
+
# Check to see if -V was specified. If so, but no parameters were
# passed, the variable will be defined but empty.
if (defined($options{V_FLAG})) {
$options{V_FLAG_SET}=1;
}
+ # If we have not been given any packages to act on, assume they
+ # 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}) {
+ # User specified that all arch (in)dep package be
+ # built, and there are none of that type.
+ error("I have no package to build");
+ }
+ push @{$options{DOPACKAGES}},GetPackages();
+ }
+
# Remove excluded packages from the list of packages to act on.
my @package_list;
my $package;
@@ -125,7 +137,12 @@ sub parseopts {
}
}
@{$options{DOPACKAGES}}=@package_list;
-
+
+ # If there are no packages to act on now, it's an error.
+ if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) {
+ error("I have no package to build");
+ }
+
return %options;
}
diff --git a/Dh_Lib.pm b/Dh_Lib.pm
index a3965ec1..be8a3e04 100644
--- a/Dh_Lib.pm
+++ b/Dh_Lib.pm
@@ -15,6 +15,11 @@ use vars qw(@ISA @EXPORT %dh);
%dh);
sub init {
+ # If DH_OPTIONS is set, prepend it @ARGV.
+ if (defined($ENV{DH_OPTIONS})) {
+ unshift @ARGV,split(/\s+/,$ENV{DH_OPTIONS});
+ }
+
# 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.
diff --git a/debhelper.1 b/debhelper.1
index e37085aa..9051d438 100644
--- a/debhelper.1
+++ b/debhelper.1
@@ -93,6 +93,13 @@ Enables verbose mode.
.TP
.I DH_NO_ACT
Enables no-act mode.
+.TP
+.I DH_OPTIONS
+Anything in this variable will be prepended to the command line
+arguments of all debhelper commands. This in useful in some situations,
+for example, if you need to pass -p to all debhelper commands that will be
+run. If you use DH_OPTIONS, be sure to use "dh_testversion 1.1.17" - older
+debhelpers will ignore it and do things you don't want them to.
.SH "SEE ALSO"
.TP
.BR /usr/doc/debhelper/README
diff --git a/debian/changelog b/debian/changelog
index 1b84f02f..a52e4fc5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+debhelper (1.1.17) unstable; urgency=low
+
+ * dh_strip: on Richard Braakman's advice, strip the .comment and .note
+ sections of shared libraries.
+ * Added DH_OPTIONS environment variable - anything in it will be treated
+ as additional command line arguments by all debhelper commands. This in
+ useful in some situations, for example, if you need to pass -p to all
+ debhelper commands that will be run. If you use DH_OPTIONS, be sure to
+ use dh_testversion 1.1.17 - older debhelpers will ignore it and do
+ things you don't want them to.
+ * Made -N properly exclude packages when no -i, -a, or -p flags are
+ present. It didn't before, which was a bug.
+
+ -- Joey Hess <joeyh@master.debian.org> Mon, 7 Sep 1998 17:33:19 -0700
+
debhelper (1.1.16) unstable; urgency=low
* dh_fixperms: remove execute bits from static libraries as well as
diff --git a/debian/control b/debian/control
index 8ba5d999..c6e236d3 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: debhelper
Section: devel
Priority: optional
Maintainer: Joey Hess <joeyh@master.debian.org>
-Standards-Version: 2.4.1.3
+Standards-Version: 2.4.1.4
Package: debhelper
Architecture: all
diff --git a/dh_lib b/dh_lib
index 41812b8f..1ff2a5b1 100644
--- a/dh_lib
+++ b/dh_lib
@@ -136,6 +136,11 @@ autoscript() {
# Argument processing and global variable initialization is below.
+# If DH_OPTIONS is set, prepend it to the command line.
+if [ "$DH_OPTIONS" ]; then
+ set -- $DH_OPTIONS $@
+fi
+
# 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 perl.
for arg; do
diff --git a/dh_strip b/dh_strip
index 385efeff..28e950a8 100755
--- a/dh_strip
+++ b/dh_strip
@@ -24,7 +24,9 @@ for PACKAGE in $DH_DOPACKAGES; do
for file in `(cd $TMP; find -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null) | filelist_excluded` ; do
case "`file $TMP/$file`" in
*ELF*shared*)
- doit "strip --strip-unneeded $TMP/$file"
+ # Note that all calls to strip on shared libs
+ # *must* inclde the --strip-unneeded.
+ doit "strip --remove-section=.comment --remove-section=.note --strip-unneeded $TMP/$file"
;;
*ELF*executable*)
doit "strip --remove-section=.comment --remove-section=.note $TMP/$file"