diff options
| author | Paul Varner <fuzzyray@gentoo.org> | 2013-09-04 15:55:34 -0500 |
|---|---|---|
| committer | Paul Varner <fuzzyray@gentoo.org> | 2013-09-04 15:55:34 -0500 |
| commit | 78d245ba02619be775c20c3c8926ce1cc3d35ea6 (patch) | |
| tree | 05eb24ea0b2f424c48ab029fe32f9dbba39ce998 | |
| parent | cd6a0dbd9e44eb2dd8c418d3d4733cb4e71962c2 (diff) | |
| download | gentoolkit-78d245ba02619be775c20c3c8926ce1cc3d35ea6.tar.gz | |
Change argv[0] name check to use startswith() for compatibilty with python-exec.
python-exec uses versioned scripts in the form of "script-python2.7".
This changes the check for eclean-pkg and eclean-dist to see if argv[0]
starts with those strings, instead of matching exactly.
| -rw-r--r-- | pym/gentoolkit/eclean/cli.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pym/gentoolkit/eclean/cli.py b/pym/gentoolkit/eclean/cli.py index 16f4adc..95d4c06 100644 --- a/pym/gentoolkit/eclean/cli.py +++ b/pym/gentoolkit/eclean/cli.py @@ -304,12 +304,12 @@ def parseArgs(options={}): action = None # temp print line to ensure it is the svn/branch code running, etc.. #print( "###### svn/branch/gentoolkit_eclean ####### ==> ", os.path.basename(sys.argv[0])) - if os.path.basename(sys.argv[0]) in \ - (__productname__+'-pkg', __productname__+'-packages'): - action = 'packages' - elif os.path.basename(sys.argv[0]) in \ - (__productname__+'-dist', __productname__+'-distfiles'): - action = 'distfiles' + if os.path.basename(sys.argv[0]).startswith(__productname__+'-pkg') or \ + os.path.basename(sys.argv[0]).startswith(__productname__+'-packages'): + action = 'packages' + elif os.path.basename(sys.argv[0]).startswith(__productname__+'-dist') or \ + os.path.basename(sys.argv[0]).startswith(__productname__+'distfiles'): + action = 'distfiles' # prepare for the first getopt if action: short_opts = getopt_options['short']['global'] \ |
