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/f999f7139bad
branches:  trunk
changeset: 394627:f999f7139bad
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 294cbf185ce7 -r f999f7139bad 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 294cbf185ce7 -r f999f7139bad 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