pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/games/powder-toy powder-toy: harden the initialization...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/072f8bbf65c1
branches:  trunk
changeset: 332627:072f8bbf65c1
user:      nia <nia%pkgsrc.org@localhost>
date:      Fri Apr 19 09:28:45 2019 +0000

description:
powder-toy: harden the initialization script, avoiding sh -e and quoting
more.

advice from kre, thanks.

diffstat:

 games/powder-toy/Makefile               |   3 ++-
 games/powder-toy/files/powder-toy.sh.in |  12 +++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diffs (30 lines):

diff -r 3e65480741a3 -r 072f8bbf65c1 games/powder-toy/Makefile
--- a/games/powder-toy/Makefile Fri Apr 19 07:46:15 2019 +0000
+++ b/games/powder-toy/Makefile Fri Apr 19 09:28:45 2019 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2019/04/13 12:08:04 nia Exp $
+# $NetBSD: Makefile,v 1.2 2019/04/19 09:28:45 nia Exp $
 
 DISTNAME=      powder-toy-94.1
+PKGREVISION=   1
 CATEGORIES=    games
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=ThePowderToy/}
 GITHUB_PROJECT=        The-Powder-Toy
diff -r 3e65480741a3 -r 072f8bbf65c1 games/powder-toy/files/powder-toy.sh.in
--- a/games/powder-toy/files/powder-toy.sh.in   Fri Apr 19 07:46:15 2019 +0000
+++ b/games/powder-toy/files/powder-toy.sh.in   Fri Apr 19 09:28:45 2019 +0000
@@ -1,9 +1,7 @@
-#!/bin/sh -e
-if [ ${XDG_DATA_HOME} ]; then
-       mkdir -p ${XDG_DATA_HOME}/powder-toy
-       cd ${XDG_DATA_HOME}/powder-toy
+#!/bin/sh
+if [ -n "${XDG_DATA_HOME}" ]; then
+       DIR=${XDG_DATA_HOME}/powder-toy
 else
-       mkdir -p ${HOME}/.local/share/powder-toy
-       cd ${HOME}/.local/share/powder-toy
+       DIR=${HOME}/.local/share/powder-toy
 fi
-exec @PREFIX@/libexec/powder-toy "$@"
+mkdir -p "${DIR}" && cd "${DIR}" && exec "@PREFIX@/libexec/powder-toy" "$@"



Home | Main Index | Thread Index | Old Index