From 8c0b930ba5fb777e40e0f8336b5a61e51bc6b71e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Thu, 4 Apr 2013 10:56:56 +0200 Subject: [PATCH] kms and setup fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- setup.py | 5 ++--- src/kms.py | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 642e0a63..ce7f3db7 100755 --- a/setup.py +++ b/setup.py @@ -700,7 +700,6 @@ class Setup(): ponyshare = conf['share-dir'] if not ponyshare.endswith('/'): ponyshare += '/' - ponyshare += 'ponysay/' for dir in sharedirs: if conf[dir[0]] is not None: dirs.append(ponyshare + dir[0]) @@ -998,8 +997,8 @@ class Setup(): key = dir + '-dir' if opts['--' + key] is not None: conf[key] = opts['--' + key][0] - if (dir == 'share') and (opts['--opt'] is None): - conf[key] += '/ponysay' + if (dir == 'share') and (opts['--opt'] is None): + conf[key] += '/ponysay' if conf[key].startswith('usr/'): conf[key] = prefix + conf[key][3:] if opts['--cache-dir'] is not None: diff --git a/src/kms.py b/src/kms.py index 43b95806..75809580 100755 --- a/src/kms.py +++ b/src/kms.py @@ -129,13 +129,13 @@ class KMS(): cachev.write(KMS_VERSION) if shared: try: - os.chmod(cachedir + '/.version', 0o666) + os.chmod(cachedir + '/.version', 0o7777) except: pass ## Get kmspony directory and kmspony file kmsponies = cachedir + '/kmsponies/' + palettefile - kmspony = (kmsponies + pony).replace('//', '/') + kmspony = kmsponies + '/' + pony ## If the kmspony is missing, create it if not os.path.isfile(kmspony): @@ -150,7 +150,7 @@ class KMS(): if not os.path.isdir(kmsponydir): os.makedirs(kmsponydir) if shared: - Popen('chmod -R 7777 -- ' + _cachedir, shell=True).wait() + Popen('chmod -R 7777 -- %s/kmsponies' % _cachedir, shell=True).wait() ponytoolcmd = 'ponytool --import ponysay --file %s --export ponysay --file %s --platform linux ' ponytoolcmd += '--balloon n --colourful y --fullcolour y --left - --right - --top - --bottom - --palette %s' if not os.system(ponytoolcmd % (_pony, _kmspony, palette)) == 0: @@ -158,7 +158,7 @@ class KMS(): exit(1) if shared: try: - os.chmod(kmspony, 0o666) + os.chmod(kmspony, 0o7777) except: pass