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 1RFVQU-0001NQ-L6 for garchives@archives.gentoo.org; Sun, 16 Oct 2011 18:27:11 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 405DB21C036; Sun, 16 Oct 2011 18:27:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0184721C036 for ; Sun, 16 Oct 2011 18:27:02 +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 64D5F1B4036 for ; Sun, 16 Oct 2011 18:27:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C76D78004C for ; Sun, 16 Oct 2011 18:27:01 +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: Subject: [gentoo-commits] proj/elfix:master 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: fa4a83ff1bbde9fabd9250b9e5bbe99d4caaab65 Date: Sun, 16 Oct 2011 18:27:01 +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: X-Archives-Hash: ac21d1965ff97eb57f613a54c29ab4e9 commit: fa4a83ff1bbde9fabd9250b9e5bbe99d4caaab65 Author: Anthony G. Basile gentoo org> AuthorDate: Sun Oct 16 18:25:54 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sun Oct 16 18:26:52 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3Dfa4a83ff scripts/revdep-pax: make only one of -f -r -b -s -l allowed --- scripts/revdep-pax | 42 +++++++++++++++++++++--------------------- 1 files changed, 21 insertions(+), 21 deletions(-) diff --git a/scripts/revdep-pax b/scripts/revdep-pax index e43db27..326007e 100755 --- a/scripts/revdep-pax +++ b/scripts/revdep-pax @@ -203,14 +203,12 @@ def run_usage(): print 'Program Name : revdep-pax' print 'Description : Get or set pax flags on an ELF object' print - print 'Usage : revdep-pax [-fv] | [-rv] | -v [-b BINARY] | -v [-= s SONAME] | -h' - print - print 'Options : -f print out all the forward mappings for= all system binaries' - print ' : -r print out all the reverse mappints for= all system sonames' - print ' : -b BINARY print all the forward mappings only fo= r BINARY' - print ' : -s SONAME print all the reverse mappings only fo= r SONAME' - print ' : -v verbose, otherwise just print mismatch= ed pax flags' - print ' : -h print out this help' + print 'Usage : revdep-pax -f [-v] print out all forward = mappings for all system binaries' + print ' : revdep-pax -r [-v] print out all reverse = mappints for all system sonames' + print ' : revdep-pax -b BINARY [-v] print all forward mapp= ings only for BINARY' + print ' : revdep-pax -s SONAME [-v] print all reverse mapp= ings only for SONAME' + print ' : revdep-pax [-h] print out this help' + print ' : -v verbose, otherwise jus= t print mismatched flags' print =20 =20 @@ -327,19 +325,27 @@ def main(): =20 verbose =3D False =20 + opt_count =3D 0 + for o, a in opts: if o =3D=3D '-h': do_usage =3D True + opt_count +=3D 1 elif o =3D=3D '-f': do_forward =3D True + opt_count +=3D 1 elif o =3D=3D '-r': do_reverse =3D True + opt_count +=3D 1 elif o =3D=3D '-b': binary =3D a + opt_count +=3D 1 elif o =3D=3D '-s': soname =3D a + opt_count +=3D 1 elif o =3D=3D '-l': library =3D a + opt_count +=3D 1 elif o =3D=3D '-v': verbose =3D True else: @@ -347,24 +353,18 @@ def main(): print 'Please file a bug' sys.exit(1) =20 - #TODO: Add code to only allow one of -h, -f -r -b -s - - if do_usage: + # Only allow one of -h, -f -r -b -s + if opt_count > 1 or do_usage: run_usage() - - if do_forward: + elif do_forward: run_forward(verbose) - - if do_reverse: + elif do_reverse: run_reverse(verbose) - - if binary !=3D None: + elif binary !=3D None: run_binary(binary, verbose) - - if soname !=3D None: + elif soname !=3D None: run_soname(soname, verbose, True) - - if library !=3D None: + elif library !=3D None: library =3D os.path.realpath(library) run_soname(library, verbose, False) =20