summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-01-23 00:58:47 +0000
committerjbj <devnull@localhost>2002-01-23 00:58:47 +0000
commit0bbb7bb94e340b22f584c9ebd8a1f667d68217bd (patch)
tree816aac2f8f6e756054bc5e75c3cf9d231f47187e /scripts
parentc74fa2496545a34868e93ab830b304033781cde3 (diff)
downloadrpm-0bbb7bb94e340b22f584c9ebd8a1f667d68217bd.tar.gz
- turn on auto-generated perl requirements (#58519, #58536, #58537).
Sanity. CVS patchset: 5265 CVS date: 2002/01/23 00:58:47
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/find-provides.perl8
-rwxr-xr-xscripts/find-requires.perl37
-rwxr-xr-xscripts/perl.req16
3 files changed, 13 insertions, 48 deletions
diff --git a/scripts/find-provides.perl b/scripts/find-provides.perl
index d32ebfa2e..c567baf6d 100755
--- a/scripts/find-provides.perl
+++ b/scripts/find-provides.perl
@@ -1,10 +1,4 @@
#!/bin/sh
-filelist=`sed "s/['\"]/\\\&/g"`
+exec /usr/lib/rpm/find-provides
-{ echo $filelist | tr [:blank:] \\n | /usr/lib/rpm/find-provides
-#
-# Generate perl module dependencies, if any.
- [ -x /usr/lib/rpm/perl.prov ] && \
- echo $filelist | tr [:blank:] \\n | /usr/lib/rpm/perl.prov
-} | sort -u
diff --git a/scripts/find-requires.perl b/scripts/find-requires.perl
index ae404e6f7..06050ddb6 100755
--- a/scripts/find-requires.perl
+++ b/scripts/find-requires.perl
@@ -1,39 +1,4 @@
#!/bin/sh
-# note this works for both a.out and ELF executables
-# it also auto-generates requirment lines for shell scripts
+exec /usr/lib/rpm/find-requires
-ulimit -c 0
-
-filelist=`sed "s/['\"]/\\\&/g"`
-scriptlist=`echo $filelist | xargs -r file | egrep ":.* (commands|script) " | cut -d: -f1 `
-
-perllist=
-for f in $scriptlist; do
- [ -x $f ] || continue
- interp=`head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 `
- case $interp in
- */perl) perllist="$perllist $f" ;;
- esac
-done | sort -u
-
-for f in $filelist; do
- [ -r $f ] || continue
- if echo $f | grep -q '\.pm$'
- then
- modules="$modules $f"
- fi
-done
-
-[ -n "$modules" ] && perllist="$perllist $modules"
-
-#
-# Generate perl module dependencies, if any.
-set -x
-[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
- echo $perllist | tr [:blank:] \\n | /usr/lib/rpm/perl.req | sort -u
-
-#
-# Then process the files as usual.
-set +x
-echo $filelist | /usr/lib/rpm/find-requires
diff --git a/scripts/perl.req b/scripts/perl.req
index 6e287616f..db922df72 100755
--- a/scripts/perl.req
+++ b/scripts/perl.req
@@ -119,15 +119,22 @@ sub process_file {
# eval { require Carp } if defined $^S; # If error/warning during compilation,
- (m/^\s* # we hope the inclusion starts the line
- (do|require|use)\s+(?!\{) # do not want 'do {' loops
+ (m/^(\s*) # we hope the inclusion starts the line
+ (require|use)\s+(?!\{) # do not want 'do {' loops
# quotes around name are always legal
[\'\"]?([^\;\ \'\"\t]*)[\'\"]?[\t\;\ ]
# the syntax for 'use' allows version requirements
\s*([.0-9]*)
/x)
) {
- my ($module, $version) = ($2,$3);
+ my ($whitespace, $statement, $module, $version) = ($1, $2, $3,$4);
+
+ # we only consider require statements that are flush against
+ # the left edge. any other require statements give too many
+ # false positives, as they are usually inside of an if statement
+ # as a fallback module or a rarely used option
+
+ ($whitespace ne "" && $statement eq "require") && next;
# if there is some interpolation of variables just skip this
# dependency, we do not want
@@ -182,8 +189,7 @@ sub process_file {
# will be included with the name sys/systeminfo.ph so only use the
# basename of *.ph files
- ($module =~ m/\.ph$/) && ($module =~ s!.*/!!g );
-
+ ($module =~ m/\.ph$/) && next;
$require{$module}=$version;
$line{$module}=$_;