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.2.x commit in: scripts/
Date: Mon, 17 Oct 2011 21:09:40 +0000 (UTC)	[thread overview]
Message-ID: <cada51e03eb9d72c9f0ef5a426d221060b984903.blueness@gentoo> (raw)

commit:     cada51e03eb9d72c9f0ef5a426d221060b984903
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 16 18:25:54 2011 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 21:03:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=cada51e0

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 for BINARY'
-	print '             : -s SONAME  print all the reverse mappings only for SONAME'
-	print '             : -v         verbose, otherwise just print mismatched 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 mappings only for BINARY'
+	print '             : revdep-pax -s SONAME [-v]  print all reverse mappings only for SONAME'
+	print '             : revdep-pax [-h]            print out this help'
+	print '             : -v                         verbose, otherwise just print mismatched flags'
 	print
 
 
@@ -327,19 +325,27 @@ def main():
 
 	verbose = False
 
+	opt_count = 0
+
 	for o, a in opts:
 		if o == '-h':
 			do_usage = True
+			opt_count += 1
 		elif o == '-f':
 			do_forward = True
+			opt_count += 1
 		elif o == '-r':
 			do_reverse = True
+			opt_count += 1
 		elif o == '-b':
 			binary = a
+			opt_count += 1
 		elif o == '-s':
 			soname = a
+			opt_count += 1
 		elif o == '-l':
 			library = a
+			opt_count += 1
 		elif o == '-v':
 			verbose = True
 		else:
@@ -347,24 +353,18 @@ def main():
 			print 'Please file a bug'
 			sys.exit(1)
 
-	#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 != None:
+	elif binary != None:
 		run_binary(binary, verbose)
-
-	if soname != None:
+	elif soname != None:
 		run_soname(soname, verbose, True)
-
-	if library != None:
+	elif library != None:
 		library = os.path.realpath(library)
 		run_soname(library, verbose, False)
 



             reply	other threads:[~2011-10-17 21:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17 21:09 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-10-17 21:09 [gentoo-commits] proj/elfix:elfix-0.2.x commit in: scripts/ Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-12 10:49 Anthony G. Basile
2011-10-12 10:48 Anthony G. Basile
2011-10-12 10:48 Anthony G. Basile
2011-10-12 10:47 Anthony G. Basile
2011-10-12 10:47 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 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=cada51e03eb9d72c9f0ef5a426d221060b984903.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