--- branches/magellan-next/include/mtools.sminc 2012/01/13 19:21:26 9862 +++ trunk/include/mtools.sminc 2012/03/27 12:11:21 11761 @@ -636,7 +636,7 @@ # recursive if [[ $1 = -r ]] || [[ $1 = -R ]] then - opts="--recursive" + opts="-R" source="$2" dest="$3" fi @@ -644,14 +644,14 @@ # recursive if [[ $1 = -rf ]] || [[ $1 = -fr ]] || [[ $1 = -Rf ]] || [[ $1 = -fR ]] then - opts="--recursive --force" + opts="-R -f" source="$2" dest="$3" fi if [[ $1 = -a ]] then - opts="--archive" + opts="-a" source="$2" dest="$3" fi @@ -671,7 +671,7 @@ # force if [[ $1 = -f ]] then - opts="--force" + opts="-f" source="$2" dest="$3" fi @@ -717,7 +717,7 @@ # recursive if [[ $1 = -r ]] || [[ $1 = -R ]] then - local recursive="--recursive" + local recursive="-R" local owner="$2" local path="$3" fi @@ -737,7 +737,7 @@ # recursive if [[ $1 = -r ]] || [[ $1 = -R ]] then - local recursive="--recursive" + local recursive="-R" local posix="$2" local path="$3" fi @@ -769,9 +769,14 @@ { local unit local file + local prefix [[ -z "$1" ]] && die "No unit given" + # get the right prefix for newer systemd + [[ -x /bin/systemctl ]] && prefix="" + [[ -x /usr/bin/systemctl ]] && prefix="/usr" + # if no fullpath given use file from sourcedir if [[ -z $(dirname $1) ]] || [[ $(dirname $1) = . ]] then @@ -788,10 +793,10 @@ fi # needed directory - install -d ${BINDIR}/lib/systemd/system || die + install -d ${BINDIR}${prefix}/lib/systemd/system || die # install our initscript - install -v -m 0644 -o root -g root ${file} ${BINDIR}/lib/systemd/system/${unit} || die + install -v -m 0644 -o root -g root ${file} ${BINDIR}${prefix}/lib/systemd/system/${unit} || die } # installs systemd tmp configs to /etc/tmpfiles.d