public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/elfix:elfix-0.4.x commit in: scripts/
Date: Sun,  4 Dec 2011 21:50:36 +0000 (UTC)	[thread overview]
Message-ID: <69f42c987748e0dd0a979be5503554b6b00c3d27.blueness@gentoo> (raw)

commit:     69f42c987748e0dd0a979be5503554b6b00c3d27
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  4 21:43:46 2011 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Dec  4 21:49:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=69f42c98

scripts/revdep-pax: add exception handling when doing pax.setflags

---
 scripts/revdep-pax |   45 +++++++++++++++++++++------------------------
 1 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/scripts/revdep-pax b/scripts/revdep-pax
index 42a71fd..1fe28ab 100755
--- a/scripts/revdep-pax
+++ b/scripts/revdep-pax
@@ -114,14 +114,12 @@ def print_forward_linkings( forward_linkings, so2library_mappings, verbose ):
 	missing_binaries = set(missing_binaries)
 	print '\n**** Missing binaries ****\n'
 	for m in missing_binaries:
-		print '\t%s' % m
-	print
+		print '\t%s\n' % m
 
 	missing_links = set(missing_links)
 	print '\n**** Missing forward linkings ****\n'
 	for m in missing_links:
-		print '\t%s' % m
-	print
+		print '\t%s\n' % m
 
 
 def print_reverse_linkings( reverse_linkings, so2library_mappings, verbose, executable_only ):
@@ -170,14 +168,12 @@ def print_reverse_linkings( reverse_linkings, so2library_mappings, verbose, exec
 	missing_sonames = set(missing_sonames)
 	print '\n**** Missing sonames ****\n'
 	for m in missing_sonames:
-		print '\t%s' % m
-	print
+		print '\t%s\n' % m
 
 	missing_links = set(missing_links)
 	print '\n**** Missing reverse linkings ****\n'
 	for m in missing_links:
-		print '\t%s' % m
-	print
+		print '\t%s\n' % m
 
 
 def run_forward(verbose):
@@ -194,8 +190,7 @@ def run_reverse(verbose, executable_only):
 def run_binary(binary, verbose, mark):
 	( linkings, mappings ) = get_ldd_linkings(binary)
 	( binary_flags, binary_pax_flags ) = pax.getflags(binary)
-	print '%s (%s)' % ( binary, binary_flags )
-	print
+	print '%s (%s)\n' % ( binary, binary_flags )
 
 	mismatched_libraries = []
 
@@ -214,8 +209,7 @@ def run_binary(binary, verbose, mark):
 
 	if len(mismatched_libraries) == 0:
 		if not verbose:
-			print '\tNo mismatches'
-		print
+			print '\tNo mismatches\n'
 	else:
 		print
 		if mark:
@@ -235,10 +229,13 @@ def run_binary(binary, verbose, mark):
 						print '\t\tPlease enter y or n'
 
 				if do_marking:
-					pax.setflags(library, binary_pax_flags)
+					try:
+						pax.setflags(library, binary_pax_flags)
+					except:
+						print "\n\tCould not set pax flags on %s, file is probably busy" % library
+						print "\tShut down all processes that use it and try again"
 					( library_flags, library_pax_flags ) = pax.getflags(library)
-					print '\t%s ( %s )' % ( library, library_flags )
-					print
+					print '\n\t\t%s ( %s )\n' % ( library, library_flags )
 
 
 def invert_so2library_mappings( so2library_mappings ):
@@ -264,8 +261,7 @@ def run_soname(name, verbose, use_soname, mark, executable_only):
 	library = so2library_mappings[soname]
 
 	( library_flags, library_pax_flags ) = pax.getflags(library)
-	print '%s\t%s (%s)' % ( soname, library, library_flags )
-	print
+	print '%s\t%s (%s)\n' % ( soname, library, library_flags )
 
 	mismatched_binaries = []
 	for binary in linkings:
@@ -292,13 +288,11 @@ def run_soname(name, verbose, use_soname, mark, executable_only):
 
 	if len(mismatched_binaries) == 0:
 		if not verbose:
-			print '\tNo mismatches'
-		print
+			print '\tNo mismatches\n'
 	else:
 		print
 		if mark:
-			print '\tWill mark binaries with %s' % library_flags
-			print
+			print '\tWill mark binaries with %s\n' % library_flags
 			for binary in mismatched_binaries:
 				if executable_only:
 					if not os.path.dirname(binary) in shell_path:
@@ -315,10 +309,13 @@ def run_soname(name, verbose, use_soname, mark, executable_only):
 					else:
 						print '\t\tPlease enter y or n'
 				if do_marking:
-					pax.setflags(binary, library_pax_flags)
+					try:
+						pax.setflags(binary, library_pax_flags)
+					except:
+						print "\n\tCould not set pax flags on %s, file is probably busy" % binary
+						print "\tShut down all processes that use it and try again"
 					( binary_flags, binary_pax_flags ) = pax.getflags(binary)
-					print '\t%s ( %s )' % ( binary, binary_flags )
-					print
+					print '\n\t\t%s ( %s )\n' % ( binary, binary_flags )
 
 
 def run_usage():



             reply	other threads:[~2011-12-04 21:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-04 21:50 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-12-29  0:57 [gentoo-commits] proj/elfix:elfix-0.4.x commit in: scripts/ Anthony G. Basile
2011-12-29  1:00 Anthony G. Basile
2011-12-29  1:00 Anthony G. Basile
2011-12-29  1:00 Anthony G. Basile
2011-12-29  1:00 Anthony G. Basile
2011-12-29  1:00 Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69f42c987748e0dd0a979be5503554b6b00c3d27.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox