diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-11-25 22:18:06 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-11-25 22:42:57 +0100 |
commit | 8fc9875d64d40136950b50e5319c3cb5e37a5f36 (patch) | |
tree | ef63a1deffa0f4490acd23372428495e3af0079d /net-misc/minidlna | |
parent | net-misc/minidlna: Switch to tmpfiles.eclass (diff) | |
download | gentoo-8fc9875d64d40136950b50e5319c3cb5e37a5f36.tar.gz gentoo-8fc9875d64d40136950b50e5319c3cb5e37a5f36.tar.bz2 gentoo-8fc9875d64d40136950b50e5319c3cb5e37a5f36.zip |
net-misc/minidlna: Fix ownership fixup code
Use proper bash syntax, and respect EROOT.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'net-misc/minidlna')
-rw-r--r-- | net-misc/minidlna/minidlna-1.2.1-r1.ebuild | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net-misc/minidlna/minidlna-1.2.1-r1.ebuild b/net-misc/minidlna/minidlna-1.2.1-r1.ebuild index a41c01c156b3..b18b7c7a53d2 100644 --- a/net-misc/minidlna/minidlna-1.2.1-r1.ebuild +++ b/net-misc/minidlna/minidlna-1.2.1-r1.ebuild @@ -77,8 +77,8 @@ src_install() { } pkg_preinst() { - local my_is_new="yes" - [ -d "${EPREFIX}"/var/lib/minidlna ] && my_is_new="no" + local my_is_new=yes + [[ -d ${EROOT}/var/lib/minidlna ]] && my_is_new=no enewgroup minidlna enewuser minidlna -1 -1 /var/lib/minidlna minidlna @@ -86,10 +86,11 @@ pkg_preinst() { fowners minidlna:minidlna /var/{lib,log}/minidlna fperms 0750 /var/{lib,log}/minidlna - if [ -d "${EPREFIX}"/var/lib/minidlna ] && [ "${my_is_new}" == "yes" ] ; then - # created by above enewuser command w/ wrong group and permissions - chown minidlna:minidlna "${EPREFIX}"/var/lib/minidlna || die - chmod 0750 "${EPREFIX}"/var/lib/minidlna || die + if [[ -d ${EROOT}/var/lib/minidlna && ${my_is_new} == yes ]]; then + # created by above enewuser command w/ wrong group + # and permissions + chown minidlna:minidlna "${EROOT}"/var/lib/minidlna || die + chmod 0750 "${EROOT}"/var/lib/minidlna || die # if user already exists, but /var/lib/minidlna is missing # rely on ${D}/var/lib/minidlna created in src_install fi |