summaryrefslogtreecommitdiff
path: root/dh_shlibdeps
diff options
context:
space:
mode:
authorjoey <joey>1999-09-02 20:43:22 +0000
committerjoey <joey>1999-09-02 20:43:22 +0000
commit60037371809ab782c2d675ea1bfc849c2772fce2 (patch)
tree7cbc1dcc5bb226c99c867df4d93e921c48aa7a2d /dh_shlibdeps
parent0bf37235c2e1ac184e6b069f0da2c71dd47b2983 (diff)
r264: * dh_shlibdeps: Fixed quoting problem that made it fail on weird file names.
Patch from Devin Carraway <debianbug-debhelper@devin.com>, Closes: #44016
Diffstat (limited to 'dh_shlibdeps')
-rwxr-xr-xdh_shlibdeps42
1 files changed, 23 insertions, 19 deletions
diff --git a/dh_shlibdeps b/dh_shlibdeps
index e30c4a5..bd733b3 100755
--- a/dh_shlibdeps
+++ b/dh_shlibdeps
@@ -1,24 +1,28 @@
-#!/bin/sh -e
+#!/usr/bin/perl -w
#
# Find dependancies. Simple dpkg-shlibdeps wrapper.
-PATH=debian:$PATH:/usr/lib/debhelper
-. dh_lib
+BEGIN { push @INC, "debian", "/usr/share/debhelper" }
+use Dh_Lib;
+init();
-for PACKAGE in $DH_DOPACKAGES; do
- TMP=`tmpdir $PACKAGE`
- EXT=`pkgext $PACKAGE`
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
+ $EXT=pkgext($PACKAGE);
- # Run dpkg-shlibdeps to generate dependancies.
- filelist=""
- for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do
- case "`file $file`" in
- *ELF*)
- filelist="$file $filelist"
- ;;
- esac
- done
- if [ "$filelist" ]; then
- doit "dpkg-shlibdeps -Tdebian/${EXT}substvars $DH_U_PARAMS $filelist"
- fi
-done
+ my @filelist;
+ my $ff;
+
+ # Generate a list of all ELF binaries in the package.
+ foreach $file (split(/\n/,`find $TMP -type f \\( -perm +111 -or -name "*.so*" \\)`)) {
+ # TODO: this is slow, optimize. Ie, file can run once on multiple files..
+ $ff=`file "$file"`;
+ if ($ff=~m/ELF/) {
+ push @filelist,$file;
+ }
+ }
+
+ if (@filelist) {
+ doit("dpkg-shlibdeps","-Tdebian/$EXT\substvars",@{$dh{U_PARAMS}},@filelist);
+ }
+}