kms and setup fix

Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
Mattias Andrée 2013-04-04 10:56:56 +02:00
parent 0fc2fcafda
commit 8c0b930ba5
2 changed files with 6 additions and 7 deletions

View file

@ -700,7 +700,6 @@ class Setup():
ponyshare = conf['share-dir'] ponyshare = conf['share-dir']
if not ponyshare.endswith('/'): if not ponyshare.endswith('/'):
ponyshare += '/' ponyshare += '/'
ponyshare += 'ponysay/'
for dir in sharedirs: for dir in sharedirs:
if conf[dir[0]] is not None: if conf[dir[0]] is not None:
dirs.append(ponyshare + dir[0]) dirs.append(ponyshare + dir[0])
@ -998,8 +997,8 @@ class Setup():
key = dir + '-dir' key = dir + '-dir'
if opts['--' + key] is not None: if opts['--' + key] is not None:
conf[key] = opts['--' + key][0] conf[key] = opts['--' + key][0]
if (dir == 'share') and (opts['--opt'] is None): if (dir == 'share') and (opts['--opt'] is None):
conf[key] += '/ponysay' conf[key] += '/ponysay'
if conf[key].startswith('usr/'): if conf[key].startswith('usr/'):
conf[key] = prefix + conf[key][3:] conf[key] = prefix + conf[key][3:]
if opts['--cache-dir'] is not None: if opts['--cache-dir'] is not None:

View file

@ -129,13 +129,13 @@ class KMS():
cachev.write(KMS_VERSION) cachev.write(KMS_VERSION)
if shared: if shared:
try: try:
os.chmod(cachedir + '/.version', 0o666) os.chmod(cachedir + '/.version', 0o7777)
except: except:
pass pass
## Get kmspony directory and kmspony file ## Get kmspony directory and kmspony file
kmsponies = cachedir + '/kmsponies/' + palettefile kmsponies = cachedir + '/kmsponies/' + palettefile
kmspony = (kmsponies + pony).replace('//', '/') kmspony = kmsponies + '/' + pony
## If the kmspony is missing, create it ## If the kmspony is missing, create it
if not os.path.isfile(kmspony): if not os.path.isfile(kmspony):
@ -150,7 +150,7 @@ class KMS():
if not os.path.isdir(kmsponydir): if not os.path.isdir(kmsponydir):
os.makedirs(kmsponydir) os.makedirs(kmsponydir)
if shared: 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 = 'ponytool --import ponysay --file %s --export ponysay --file %s --platform linux '
ponytoolcmd += '--balloon n --colourful y --fullcolour y --left - --right - --top - --bottom - --palette %s' ponytoolcmd += '--balloon n --colourful y --fullcolour y --left - --right - --top - --bottom - --palette %s'
if not os.system(ponytoolcmd % (_pony, _kmspony, palette)) == 0: if not os.system(ponytoolcmd % (_pony, _kmspony, palette)) == 0:
@ -158,7 +158,7 @@ class KMS():
exit(1) exit(1)
if shared: if shared:
try: try:
os.chmod(kmspony, 0o666) os.chmod(kmspony, 0o7777)
except: except:
pass pass