diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-08-19 19:36:00 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-08-19 19:36:00 +0200 |
commit | 5dde58685012ffaa5e280e025b088a0dd3395ddc (patch) | |
tree | c16d14c96661edf021f84a8979a0e5eb7c4bcfb9 | |
parent | 924a2ab8edcbe6a4058a4336b7f331c3f3810727 (diff) | |
download | ponysay-5dde58685012ffaa5e280e025b088a0dd3395ddc.tar.gz ponysay-5dde58685012ffaa5e280e025b088a0dd3395ddc.tar.bz2 ponysay-5dde58685012ffaa5e280e025b088a0dd3395ddc.zip |
kms fix (however not working because of some bug in util-say)
-rwxr-xr-x | configure | 4 | ||||
-rwxr-xr-x | ponysay.py | 13 |
2 files changed, 13 insertions, 4 deletions
@@ -223,6 +223,9 @@ function makeMakefile() echo 'install "'"$file"'" "$(INSTALLDIR)/share/licenses/ponysay/'"$file"'"' done echo + echo -en '\t' ; echo 'mkdir -p $(DESTDIR)/var/cache/ponysay/' + echo -en '\t' ; echo 'chmod 777 $(DESTDIR)/var/cache/ponysay/' + echo for completion in $completions; do shell="${completion##*/}" @@ -286,6 +289,7 @@ EOF echo echo 'uninstall:' + echo -en '\t' ; echo 'if [ -d "$(DESTDIR)/var/cache/ponysay" ]; then rm -rf "$(INSTALLDIR)/var/cache/ponysay"; fi' for old in $installedDirs; do echo -en '\t' echo 'if [ -d "$(INSTALLDIR)/'"$old"'" ]; then rm -rf "$(INSTALLDIR)/'"$old"'"; fi' @@ -491,23 +491,28 @@ class Ponysay(): palettefile = env_kms.replace('\033]P', '') kmsponies = '/var/cache/ponysay/kmsponies/' + palettefile - kmspony = kmsponies + pony + kmspony = (kmsponies + pony).replace('//', '/') if not os.path.isfile(kmspony): protokmsponies = '/var/cache/ponysay/protokmsponies/' - protokmspony = protokmsponies + pony + protokmspony = (protokmsponies + pony).replace('//', '/') + + protokmsponydir = protokmspony[:protokmspony.rindex('/')] + kmsponydir = kmspony[: kmspony.rindex('/')] _protokmspony = '\'' + protokmspony.replace('\'', '\'\\\'\'') + '\'' _kmspony = '\'' + kmspony.replace('\'', '\'\\\'\'') + '\'' _pony = '\'' + pony.replace('\'', '\'\\\'\'') + '\'' if not os.path.isfile(protokmspony): - os.makedirs(protokmsponies) + if not os.path.isdir(protokmsponydir): + os.makedirs(protokmsponydir) if not os.system('ponysay2ttyponysay < ' + _pony + ' > ' + _protokmspony) == 0: sys.stderr.write('Unable to run ponysay2ttyponysay successfully, you need util-say for KMS support\n') exit(1) - os.makedirs(kmsponies) + if not os.path.isdir(kmsponydir): + os.makedirs(kmsponydir) if not os.system('tty2colourfultty -e -p ' + palette + ' < ' + _protokmspony + ' > ' + _kmspony) == 0: sys.stderr.write('Unable to run tty2colourfultty successfully, you need util-say for KMS support\n') exit(1) |