[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Kerkerkruip



On 8 October 2014 01:47, Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net> wrote:

The startup script looks weird to me though. Quoting it:

> #!/bin/bash

The Kerkerkruip startup script seems to be using no bash-specific
features. I think it would be better to just use /bin/sh here.

> if [ -f "/usr/games/gargoyle" ]; then
>       GAR=/usr/games/gargoyle
> else
>       GAR=/usr/games/gargoyle-free
> fi

I am not sure, but I think in Debian this would be handled by the
alternatives <https://wiki.debian.org/DebianAlternatives>. Is this
correct or should a Debian package just default to gargoyle-free?

As the upstream developer, our priority is making it run as widely as possible. If this became an accepted package in Debian it would be appropriate to just run Debian's gargoyle-free directly.
 
> if [ ! -d "$HOME/.kerkerkruip" ]; then
>       mkdir $HOME/.kerkerkruip
> fi
> if [ ! -f "$HOME/.kerkerkruip/Kerkerkruip.gblorb" ]; then
>       ln -s /usr/share/kerkerkruip/Kerkerkruip.gblorb $HOME/.kerkerkruip/Kerkerkruip.gblorb
> fi
> if [ ! -f "$HOME/.kerkerkruip/Kerkerkruip.ini" ]; then
>       ln -s /usr/share/kerkerkruip/Kerkerkruip.ini $HOME/.kerkerkruip/Kerkerkruip.ini
> fi
>
> $GAR $HOME/.kerkerkruip/Kerkerkruip.gblorb

First, why the symlinking? It seems to me that the symlink will stay if
the package is uninstalled and leave a broken symlink in the user's home
directory. Is this something about gargoyle that it expects the file in
a user's home directory? Could this be fixed in Debian's gargoyle-free?

Gargoyle will only write datafiles in the same folder as the gamefile. Broken symlinks didn't seem like much of a problem as they're only useful when the package is installed.

It would be great if Gargoyle allowed more freedom here, but its development seems to have completely stalled.
 
Second, I think one should use “mkdir -p” instead of checking if a
directory exists. There might exist subtle race conditions otherwise,
that are likely irrelevant in here, but might not in many other cases.

Third, $HOME is not properly quoted here. If it contains any character
in $IFS, the script will create the wrong directory and wrong symlinks.

You're probably right about both of these, and I'll fix them upsteam. But I don't think Debian allows spaces etc in usernames so it's very unlikely to be a problem.

Reply to: