diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-06-22 14:19:48 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-06-22 14:19:48 +0000 |
commit | 432608f64b76a3cc2aee2831507d64627a558398 (patch) | |
tree | e8dcd7dad2e7830cd9f4f5edb6fbd0bc27332ce9 | |
parent | a6e498c6216720899f7533021c56b993ce04f422 (diff) | |
download | portage-432608f64b76a3cc2aee2831507d64627a558398.tar.gz portage-432608f64b76a3cc2aee2831507d64627a558398.tar.bz2 portage-432608f64b76a3cc2aee2831507d64627a558398.zip |
Move the --search code from global scope to a function.
svn path=/main/trunk/; revision=3600
-rwxr-xr-x | bin/emerge | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/bin/emerge b/bin/emerge index 2b4f93597..dab03bd7b 100755 --- a/bin/emerge +++ b/bin/emerge @@ -3327,6 +3327,21 @@ def action_info(): if "cvs_id_string" in dir(module): print "%s: %s" % (str(x), str(module.cvs_id_string)) +def action_search(): + if not myfiles: + print "emerge: no search terms provided." + else: + searchinstance = search(portage.settings, portage.portdb, + portage.db["/"]["vartree"], spinner, "--searchdesc" in myopts, + "--quiet" not in myopts) + for mysearch in myfiles: + try: + searchinstance.execute(mysearch) + except re.error, comment: + print "\n!!! Regular expression error in \"%s\": %s" % ( mysearch, comment ) + sys.exit(1) + searchinstance.output() + if myaction in ["sync","metadata"] and "--help" not in myopts: if "--pretend" in myopts: print "emerge: \"sync\" actions do not support \"--pretend.\"" @@ -3344,19 +3359,7 @@ elif "info"==myaction: # SEARCH action elif "search"==myaction: - if not myfiles: - print "emerge: no search terms provided." - else: - searchinstance = search(portage.settings, portage.portdb, - portage.db["/"]["vartree"], spinner, "--searchdesc" in myopts, - "--quiet" not in myopts) - for mysearch in myfiles: - try: - searchinstance.execute(mysearch) - except re.error, comment: - print "\n!!! Regular expression error in \"%s\": %s" % ( mysearch, comment ) - sys.exit(1) - searchinstance.output() + action_search() elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction: if 1 == unmerge(myaction, myfiles, raise_on_missing=False): post_emerge() |