From 78d245ba02619be775c20c3c8926ce1cc3d35ea6 Mon Sep 17 00:00:00 2001 From: Paul Varner Date: Wed, 4 Sep 2013 15:55:34 -0500 Subject: 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. --- pym/gentoolkit/eclean/cli.py | 12 ++++++------ 1 file 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'] \ -- cgit v1.2.3