From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RXJxX-0008W1-3z for garchives@archives.gentoo.org; Sun, 04 Dec 2011 21:50:55 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 43C3E21C09E; Sun, 4 Dec 2011 21:50:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 06F9621C09E for ; Sun, 4 Dec 2011 21:50:37 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 46D111B400C for ; Sun, 4 Dec 2011 21:50:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 96C1B80042 for ; Sun, 4 Dec 2011 21:50:36 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <69f42c987748e0dd0a979be5503554b6b00c3d27.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:elfix-0.4.x commit in: scripts/ X-VCS-Repository: proj/elfix X-VCS-Files: scripts/revdep-pax X-VCS-Directories: scripts/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 69f42c987748e0dd0a979be5503554b6b00c3d27 Date: Sun, 4 Dec 2011 21:50:36 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 01037e56-e1a6-480f-8788-df00ec9be62f X-Archives-Hash: 5369bd05278ca6a4e2f478c5d6d1f4aa commit: 69f42c987748e0dd0a979be5503554b6b00c3d27 Author: Anthony G. Basile gentoo org> AuthorDate: Sun Dec 4 21:43:46 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sun Dec 4 21:49:56 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3D69f42c98 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, so2li= brary_mappings, verbose ): missing_binaries =3D set(missing_binaries) print '\n**** Missing binaries ****\n' for m in missing_binaries: - print '\t%s' % m - print + print '\t%s\n' % m =20 missing_links =3D set(missing_links) print '\n**** Missing forward linkings ****\n' for m in missing_links: - print '\t%s' % m - print + print '\t%s\n' % m =20 =20 def print_reverse_linkings( reverse_linkings, so2library_mappings, verbo= se, executable_only ): @@ -170,14 +168,12 @@ def print_reverse_linkings( reverse_linkings, so2li= brary_mappings, verbose, exec missing_sonames =3D set(missing_sonames) print '\n**** Missing sonames ****\n' for m in missing_sonames: - print '\t%s' % m - print + print '\t%s\n' % m =20 missing_links =3D set(missing_links) print '\n**** Missing reverse linkings ****\n' for m in missing_links: - print '\t%s' % m - print + print '\t%s\n' % m =20 =20 def run_forward(verbose): @@ -194,8 +190,7 @@ def run_reverse(verbose, executable_only): def run_binary(binary, verbose, mark): ( linkings, mappings ) =3D get_ldd_linkings(binary) ( binary_flags, binary_pax_flags ) =3D pax.getflags(binary) - print '%s (%s)' % ( binary, binary_flags ) - print + print '%s (%s)\n' % ( binary, binary_flags ) =20 mismatched_libraries =3D [] =20 @@ -214,8 +209,7 @@ def run_binary(binary, verbose, mark): =20 if len(mismatched_libraries) =3D=3D 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' =20 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 ) =3D pax.getflags(library) - print '\t%s ( %s )' % ( library, library_flags ) - print + print '\n\t\t%s ( %s )\n' % ( library, library_flags ) =20 =20 def invert_so2library_mappings( so2library_mappings ): @@ -264,8 +261,7 @@ def run_soname(name, verbose, use_soname, mark, execu= table_only): library =3D so2library_mappings[soname] =20 ( library_flags, library_pax_flags ) =3D pax.getflags(library) - print '%s\t%s (%s)' % ( soname, library, library_flags ) - print + print '%s\t%s (%s)\n' % ( soname, library, library_flags ) =20 mismatched_binaries =3D [] for binary in linkings: @@ -292,13 +288,11 @@ def run_soname(name, verbose, use_soname, mark, exe= cutable_only): =20 if len(mismatched_binaries) =3D=3D 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, exe= cutable_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 ) =3D pax.getflags(binary) - print '\t%s ( %s )' % ( binary, binary_flags ) - print + print '\n\t\t%s ( %s )\n' % ( binary, binary_flags ) =20 =20 def run_usage():