summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-12-21 18:43:26 +0000
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-12-21 18:43:26 +0000
commit6065d093f52224b17fe3038a9a6e4dd1731ab4a9 (patch)
tree3ae99e3a18f3294b8c123cdaf8289f42f917a172
parent7604ccbfa215ce0df44c194c9bd1abcabd086a30 (diff)
fix add-unit for user units
-rw-r--r--common.sh22
-rw-r--r--config-box-base.PKGBUILD2
2 files changed, 18 insertions, 6 deletions
diff --git a/common.sh b/common.sh
index 53c2558..d46cf5c 100644
--- a/common.sh
+++ b/common.sh
@@ -29,11 +29,23 @@ EOF
add-unit() (
install -d "${1%/*}"
base="$(sed 's/@[^.]*\./@./' <<<"${1##*/}")"
- srcs=(
- "etc/systemd/system/${1##*/}"
- "etc/systemd/system/$base"
- "usr/lib/systemd/system/$base"
- )
+ case "$1" in
+ etc/systemd/system/*)
+ srcs=(
+ "etc/systemd/system/${1##*/}"
+ "etc/systemd/system/$base"
+ "usr/lib/systemd/system/$base"
+ );;
+ etc/systemd/user/*)
+ srcs=(
+ "etc/systemd/user/${1##*/}"
+ "etc/systemd/user/$base"
+ "usr/lib/systemd/user/$base"
+ );;
+ *)
+ error 'add-unit: unknown directory: %s' "$1"
+ exit 1;;
+ esac
for src in "${srcs[@]}"; do
if test -f "$src"; then
break
diff --git a/config-box-base.PKGBUILD b/config-box-base.PKGBUILD
index 552a6c2..e9d8eea 100644
--- a/config-box-base.PKGBUILD
+++ b/config-box-base.PKGBUILD
@@ -1,5 +1,5 @@
. ${BUILDFILE%/*}/common.sh
-pkgver=20171221
+pkgver=20171221.1
package() {
preamble