aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2011-11-28 23:19:34 -0500
committerAnthony G. Basile <blueness@gentoo.org>2011-12-04 16:49:02 -0500
commitba675f71c3acba99ea3c9f5aba15eb542dbaa2bf (patch)
treeabaacd5efa83df2287411fadb8602ebddebb62fb
parentPrepare release 0.4.0 (diff)
downloadelfix-ba675f71c3acba99ea3c9f5aba15eb542dbaa2bf.tar.gz
elfix-ba675f71c3acba99ea3c9f5aba15eb542dbaa2bf.tar.bz2
elfix-ba675f71c3acba99ea3c9f5aba15eb542dbaa2bf.zip
scripts/revdep-pax: -e works with both -v and not -v
-rw-r--r--doc/revdep-pax.16
-rw-r--r--doc/revdep-pax.pod2
-rwxr-xr-xscripts/revdep-pax90
3 files changed, 44 insertions, 54 deletions
diff --git a/doc/revdep-pax.1 b/doc/revdep-pax.1
index b991d90..3d2974c 100644
--- a/doc/revdep-pax.1
+++ b/doc/revdep-pax.1
@@ -187,9 +187,9 @@ so that the PaX flags of the target inherit the flags of the source.
.IP "\fB\-v\fR Report all mappings, not just the mismatched ones." 4
.IX Item "-v Report all mappings, not just the mismatched ones."
.IP "" 4
-.ie n .IP "\fB\-e\fR If \-m is chosen, then limit the markings to only those executables in the current shell's $PATH. If \-v is chosen, then similarly limit the report. This flag only has effect for reverse mappings, i.e., for \-r, \-s or \-l." 4
-.el .IP "\fB\-e\fR If \-m is chosen, then limit the markings to only those executables in the current shell's \f(CW$PATH\fR. If \-v is chosen, then similarly limit the report. This flag only has effect for reverse mappings, i.e., for \-r, \-s or \-l." 4
-.IX Item "-e If -m is chosen, then limit the markings to only those executables in the current shell's $PATH. If -v is chosen, then similarly limit the report. This flag only has effect for reverse mappings, i.e., for -r, -s or -l."
+.ie n .IP "\fB\-e\fR Limit the markings or report to only those executables in the current shell's $PATH." 4
+.el .IP "\fB\-e\fR Limit the markings or report to only those executables in the current shell's \f(CW$PATH\fR." 4
+.IX Item "-e Limit the markings or report to only those executables in the current shell's $PATH."
.IP "" 4
.IP "\fB\-h\fR Print out a short help message and exit." 4
.IX Item "-h Print out a short help message and exit."
diff --git a/doc/revdep-pax.pod b/doc/revdep-pax.pod
index 98175bd..03ff277 100644
--- a/doc/revdep-pax.pod
+++ b/doc/revdep-pax.pod
@@ -68,7 +68,7 @@ so that the PaX flags of the target inherit the flags of the source.
=item
-=item B<-e> If -m is chosen, then limit the markings to only those executables in the current shell's $PATH. If -v is chosen, then similarly limit the report. This flag only has effect for reverse mappings, i.e., for -r, -s or -l.
+=item B<-e> Limit the markings or report to only those executables in the current shell's $PATH.
=item
diff --git a/scripts/revdep-pax b/scripts/revdep-pax
index fdc96fe..42a71fd 100755
--- a/scripts/revdep-pax
+++ b/scripts/revdep-pax
@@ -83,7 +83,7 @@ def print_forward_linkings( forward_linkings, so2library_mappings, verbose ):
try:
( binary_flags, binary_pax_flags ) = pax.getflags(binary)
- sv = '%s ( %s )' % ( binary, binary_flags )
+ sv = '%s ( %s )\n' % ( binary, binary_flags )
s = sv
except:
missing_binaries.append(binary)
@@ -102,31 +102,25 @@ def print_forward_linkings( forward_linkings, so2library_mappings, verbose ):
missing_links.append(soname)
if verbose:
- print sv
- print
+ print '%s\n' % sv
if count == 0:
- print '\tNo mismatches'
+ print '\tNo mismatches\n\n'
else:
- print '\tMismatches'
- print
+ print '\tMismatches\n\n'
else:
if count != 0:
- print s
- print
+ print '%s\n\n' % s
missing_binaries = set(missing_binaries)
- print
- print '**** Missing binaries ****'
+ print '\n**** Missing binaries ****\n'
for m in missing_binaries:
- print m
+ print '\t%s' % m
+ print
missing_links = set(missing_links)
- print
- print '**** Missing forward linkings ****'
+ print '\n**** Missing forward linkings ****\n'
for m in missing_links:
- print m
-
- print
+ print '\t%s' % m
print
@@ -136,11 +130,10 @@ def print_reverse_linkings( reverse_linkings, so2library_mappings, verbose, exec
missing_links = []
for soname in reverse_linkings:
-
try:
library = so2library_mappings[soname]
( library_flags, library_pax_flags ) = pax.getflags(library)
- sv = '%s\t%s ( %s )' % ( soname, library, library_flags )
+ sv = '%s\t%s ( %s )\n' % ( soname, library, library_flags )
s = sv
except:
missing_sonames.append(soname)
@@ -153,54 +146,49 @@ def print_reverse_linkings( reverse_linkings, so2library_mappings, verbose, exec
if executable_only:
if os.path.dirname(binary) in shell_path:
sv = '%s\n\t%s ( %s )' % ( sv, binary, binary_flags )
+ if library_flags != binary_flags:
+ s = '%s\n\t%s ( %s )' % ( s, binary, binary_flags )
+ count = count + 1
else:
sv = '%s\n\t%s ( %s )' % ( sv, binary, binary_flags )
- if library_flags != binary_flags:
- s = '%s\n\t%s ( %s )' % ( s, binary, binary_flags )
- count = count + 1
+ if library_flags != binary_flags:
+ s = '%s\n\t%s ( %s )' % ( s, binary, binary_flags )
+ count = count + 1
except:
missing_links.append(binary)
if verbose:
- print sv
- print
+ print '%s\n' % sv
if count == 0:
- print '\tNo mismatches'
+ print '\tNo mismatches\n\n'
else:
- print '\tMismatches'
- print
+ print '\tMismatches\n\n'
else:
if count != 0:
- print s
- print
+ print '%s\n\n' % s
missing_sonames = set(missing_sonames)
- print
- print '**** Missing sonames ****'
+ print '\n**** Missing sonames ****\n'
for m in missing_sonames:
- print m
+ print '\t%s' % m
+ print
missing_links = set(missing_links)
- print
- print '**** Missing reverse linkings ****'
+ print '\n**** Missing reverse linkings ****\n'
for m in missing_links:
- print m
-
- print
+ print '\t%s' % m
print
def run_forward(verbose):
( forward_linkings, so2library_mappings ) = get_forward_linkings()
print_forward_linkings( forward_linkings, so2library_mappings, verbose)
- print
def run_reverse(verbose, executable_only):
( forward_linkings, so2library_mappings ) = get_forward_linkings()
reverse_linkings = invert_linkings( forward_linkings )
print_reverse_linkings( reverse_linkings, so2library_mappings, verbose, executable_only)
- print
def run_binary(binary, verbose, mark):
@@ -225,13 +213,11 @@ def run_binary(binary, verbose, mark):
print 'file for soname %s not found' % soname
if len(mismatched_libraries) == 0:
- print
- print '\tNo mismatches'
+ if not verbose:
+ print '\tNo mismatches'
print
else:
print
- print '\tMismatches'
- print
if mark:
print '\tWill mark libraries with %s' % binary_flags
print
@@ -292,20 +278,24 @@ def run_soname(name, verbose, use_soname, mark, executable_only):
else:
print '\t%s ( %s )' % ( binary, binary_flags )
if library_flags != binary_flags:
- mismatched_binaries.append(binary)
- if not verbose:
- print '\t%s ( %s )' % ( binary, binary_flags )
+ if executable_only:
+ if os.path.dirname(binary) in shell_path:
+ mismatched_binaries.append(binary)
+ if not verbose:
+ print '\t%s ( %s )' % ( binary, binary_flags )
+ else:
+ mismatched_binaries.append(binary)
+ if not verbose:
+ print '\t%s ( %s )' % ( binary, binary_flags )
except:
print 'cannot obtain pax flags for %s' % binary
if len(mismatched_binaries) == 0:
- print
- print '\tNo mismatches'
+ if not verbose:
+ print '\tNo mismatches'
print
else:
print
- print '\tMismatches'
- print
if mark:
print '\tWill mark binaries with %s' % library_flags
print
@@ -344,7 +334,7 @@ def run_usage():
print ' : revdep-pax -l LIBRARY [-mve] print all reverse mappings only for LIBRARY file'
print ' : revdep-pax [-h] print out this help'
print ' : -v verbose, otherwise just print mismatching objects'
- print ' : -e assuming verbose, only print out executables in shell $PATH'
+ print ' : -e only print out executables in shell $PATH'
print ' : -m don\'t just report, but mark the mismatching objects'
print