From 5e77bd6224aee21ec73095f7702b69dbdca5afec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Wed, 3 Apr 2013 20:57:50 +0200 Subject: [PATCH] setup fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- setup.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 07f0ab73..b21c5aa1 100755 --- a/setup.py +++ b/setup.py @@ -433,7 +433,7 @@ class Setup(): os.system('zip -0 ../ponysay.zip ' + ' '.join(ponysaysrc)) # use not compress, prefer speed finally: os.chdir('..') - os.chmod('../ponysay.zip', 0o755) + os.chmod('ponysay.zip', 0o755) try: fileout = open('ponysay.install', 'wb+') filein = open('src/%s' % src, 'rb') @@ -555,19 +555,18 @@ class Setup(): for sharedir in [sharedir[0] for sharedir in sharedirs]: # TODO make this an opt-out option if os.path.isdir(sharedir): - if not self.free: - for toolcommand in ('--dimensions', '--metadata'): + for toolcommand in ('--dimensions', '--metadata'): + if not self.free: print('%s, %s, %s' % ('./src/ponysay-tool.py', toolcommand, sharedir)) Popen(['./src/ponysay-tool.py', toolcommand, sharedir], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate() - else: - params = ['./src/ponysay-tool.py', toolcommand, sharedir, '--'] - for sharefile in os.listdir(): - if sharefile.endswith('.pony') and (sharefile != '.pony'): - if not Setup.validateFreedom(sharedir + '/' + sharefile): - print('Skipping metadata correction for %s/%s, did not pass validation process made by setup settings' % (sharedir, sharefile)) - else: - params.append(sharefile) - for toolcommand in ('--dimensions', '--metadata'): + else: + params = ['./src/ponysay-tool.py', toolcommand, sharedir, '--'] + for sharefile in os.listdir(sharedir): + if sharefile.endswith('.pony') and (sharefile != '.pony'): + if not Setup.validateFreedom(sharedir + '/' + sharefile): + print('Skipping metadata correction for %s/%s, did not pass validation process made by setup settings' % (sharedir, sharefile)) + else: + params.append(sharefile) print('%s, %s, %s (with files)' % ('./src/ponysay-tool.py', toolcommand, sharedir)) Popen(params, stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()