xbps-src: vsv: force linking on forced rebuild

re-run `xbps-src -f install pkg` on packages with service files failed
because the link was created from previous run.
This commit is contained in:
Doan Tran Cong Danh 2019-04-13 16:18:41 +07:00 committed by maxice8
parent 2e2b36e8f2
commit 13901bc715

View file

@ -19,22 +19,27 @@ done
_vsv() { _vsv() {
local service="$1" local service="$1"
local LN_OPTS="-s"
if [ $# -lt 1 ]; then if [ $# -lt 1 ]; then
msg_red "$pkgver: vsv: 1 argument expected: <service>\n" msg_red "$pkgver: vsv: 1 argument expected: <service>\n"
return 1 return 1
fi fi
if [ -n "$XBPS_BUILD_FORCEMODE" ]; then
LN_OPTS+="f"
fi
vmkdir etc/sv vmkdir etc/sv
vcopy "${FILESDIR}/$service" etc/sv vcopy "${FILESDIR}/$service" etc/sv
chmod 755 ${PKGDESTDIR}/etc/sv/${service}/run chmod 755 ${PKGDESTDIR}/etc/sv/${service}/run
if [ -r ${PKGDESTDIR}/etc/sv/${service}/finish ]; then if [ -r ${PKGDESTDIR}/etc/sv/${service}/finish ]; then
chmod 755 ${PKGDESTDIR}/etc/sv/${service}/finish chmod 755 ${PKGDESTDIR}/etc/sv/${service}/finish
fi fi
ln -s /run/runit/supervise.${service} ${PKGDESTDIR}/etc/sv/${service}/supervise ln ${LN_OPTS} /run/runit/supervise.${service} ${PKGDESTDIR}/etc/sv/${service}/supervise
if [ -r ${PKGDESTDIR}/etc/sv/${service}/log/run ]; then if [ -r ${PKGDESTDIR}/etc/sv/${service}/log/run ]; then
chmod 755 ${PKGDESTDIR}/etc/sv/${service}/log/run chmod 755 ${PKGDESTDIR}/etc/sv/${service}/log/run
ln -s /run/runit/supervise.${service}-log ${PKGDESTDIR}/etc/sv/${service}/log/supervise ln ${LN_OPTS} /run/runit/supervise.${service}-log ${PKGDESTDIR}/etc/sv/${service}/log/supervise
fi fi
} }