Modify the INSTALL/REMOVE scripts to use predef vars and unneeded chroot calls.
--HG-- extra : convert_revision : dfd737c502bea327054ecff5bc1fa152db6e2009
This commit is contained in:
parent
201be83c73
commit
acd07f61e3
8 changed files with 44 additions and 44 deletions
|
@ -2,35 +2,35 @@
|
|||
# This script fixes permissions for some files and dirs,
|
||||
# and creates the policykit system user/group.
|
||||
#
|
||||
case "$2" in
|
||||
case "${ACTION}" in
|
||||
pre)
|
||||
;;
|
||||
post)
|
||||
echo "Running $3-$4 post installation hooks..."
|
||||
if ! chroot . getent group policykit >/dev/null; then
|
||||
chroot . groupadd -r policykit
|
||||
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
|
||||
if ! getent group policykit >/dev/null; then
|
||||
groupadd -r policykit 2>&1 >/dev/null
|
||||
[ $? -ne 0 ] && exit $?
|
||||
echo "Created policykit system group."
|
||||
fi
|
||||
if ! chroot . getent passwd policykit >/dev/null; then
|
||||
chroot . useradd -c "PolicyKit user" \
|
||||
if ! getent passwd policykit >/dev/null; then
|
||||
useradd -c "PolicyKit user" \
|
||||
-d / -s /sbin/nologin -g policykit -r policykit && \
|
||||
chroot . passwd -l policykit &>/dev/null
|
||||
passwd -l policykit 2>&1 >/dev/null
|
||||
[ $? -ne 0 ] && exit $?
|
||||
echo "Created policykit system user."
|
||||
fi
|
||||
chroot . chgrp policykit var/run/PolicyKit
|
||||
chroot . chgrp policykit var/lib/PolicyKit
|
||||
chroot . chown policykit var/lib/PolicyKit-public
|
||||
chroot . chown policykit:policykit var/lib/misc/PolicyKit.reload
|
||||
chroot . chown policykit usr/libexec/polkit-set-default-helper
|
||||
chroot . chmod u+s usr/libexec/polkit-set-default-helper
|
||||
chgrp policykit var/run/PolicyKit
|
||||
chgrp policykit var/lib/PolicyKit
|
||||
chown policykit var/lib/PolicyKit-public
|
||||
chown policykit:policykit var/lib/misc/PolicyKit.reload
|
||||
chown policykit usr/libexec/polkit-set-default-helper
|
||||
chmod u+s usr/libexec/polkit-set-default-helper
|
||||
for i in polkit-read-auth-helper polkit-revoke-helper \
|
||||
polkit-grant-helper polkit-explicit-grant-helper; do
|
||||
chroot . chgrp policykit usr/libexec/$i
|
||||
chroot . chmod g+s usr/libexec/$i
|
||||
chgrp policykit usr/libexec/$i
|
||||
chmod g+s usr/libexec/$i
|
||||
done
|
||||
chroot . chgrp policykit usr/libexec/polkit-grant-helper-pam
|
||||
chroot . chmod u+s usr/libexec/polkit-grant-helper-pam
|
||||
chgrp policykit usr/libexec/polkit-grant-helper-pam
|
||||
chmod u+s usr/libexec/polkit-grant-helper-pam
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#
|
||||
# This script removes the policykit user/group.
|
||||
#
|
||||
case "$2" in
|
||||
case "${ACTION}" in
|
||||
pre)
|
||||
chroot . userdel policykit &>/dev/null
|
||||
[ $? -eq 0 ] && echo "Removed policykit system user/group."
|
||||
userdel policykit 2>&1 >/dev/null
|
||||
[ $? -eq 0 ] && echo "Removed ${PKGNAME} system user/group."
|
||||
;;
|
||||
post)
|
||||
;;
|
||||
|
|
|
@ -4,25 +4,25 @@
|
|||
#
|
||||
dbus_launch="./usr/libexec/dbus-daemon-launch-helper"
|
||||
|
||||
case "$2" in
|
||||
case "${ACTION}" in
|
||||
pre)
|
||||
;;
|
||||
post)
|
||||
echo "Running $3-$4 post installation hooks..."
|
||||
if ! chroot . getent group dbus >/dev/null; then
|
||||
chroot . groupadd -r dbus
|
||||
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
|
||||
if ! getent group dbus >/dev/null; then
|
||||
groupadd -r dbus 2>&1 >/dev/null
|
||||
[ $? -ne 0 ] && exit $?
|
||||
echo "Created dbus system group."
|
||||
fi
|
||||
if ! chroot . getent passwd dbus >/dev/null; then
|
||||
chroot . useradd -c "System message bus" \
|
||||
if ! getent passwd dbus >/dev/null; then
|
||||
useradd -c "System message bus" \
|
||||
-d /var/run/dbus \
|
||||
-s /sbin/nologin -g dbus -r dbus && \
|
||||
chroot . passwd -l dbus &>/dev/null
|
||||
passwd -l dbus 2>&1 >/dev/null
|
||||
[ $? -ne 0 ] && exit $?
|
||||
echo "Created dbus system user."
|
||||
fi
|
||||
chroot . chown root:dbus ${dbus_launch}
|
||||
chroot . chmod 4750 ${dbus_launch}
|
||||
chown root:dbus ${dbus_launch}
|
||||
chmod 4750 ${dbus_launch}
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#
|
||||
# This script removes the dbus user/group.
|
||||
#
|
||||
case "$2" in
|
||||
case "${ACTION}" in
|
||||
pre)
|
||||
chroot . userdel dbus &>/dev/null
|
||||
[ $? -eq 0 ] && echo "Removed dbus system user/group."
|
||||
userdel dbus 2>&1 >/dev/null
|
||||
[ $? -eq 0 ] && echo "Removed ${PKGNAME} system user/group."
|
||||
;;
|
||||
post)
|
||||
;;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# This script builds fontconfig's fonts cache.
|
||||
#
|
||||
case "$2" in
|
||||
case "${ACTION}" in
|
||||
pre)
|
||||
;;
|
||||
post)
|
||||
|
|
|
@ -2,21 +2,21 @@
|
|||
# This script creates the HAL system user/group.
|
||||
#
|
||||
|
||||
case "$2" in
|
||||
case "${ACTION}" in
|
||||
pre)
|
||||
;;
|
||||
post)
|
||||
echo "Running $3-$4 post installation hooks..."
|
||||
if ! chroot . getent group hal >/dev/null; then
|
||||
chroot . groupadd -r hal
|
||||
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
|
||||
if ! getent group hal >/dev/null; then
|
||||
groupadd -r hal 2>&1 >/dev/null
|
||||
[ $? -ne 0 ] && exit $?
|
||||
echo "Created HAL system group."
|
||||
fi
|
||||
if ! chroot . getent passwd hal >/dev/null; then
|
||||
chroot . useradd -c "HAL daemon" \
|
||||
if ! getent passwd hal >/dev/null; then
|
||||
useradd -c "HAL daemon" \
|
||||
-d / -s /sbin/nologin -g hal \
|
||||
-G optical,floppy,storage -r hal && \
|
||||
chroot . passwd -l hal &>/dev/null
|
||||
passwd -l hal 2>&1 >/dev/null
|
||||
[ $? -ne 0 ] && exit $?
|
||||
echo "Created HAL system user."
|
||||
fi
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#
|
||||
# This script removes the HAL user/group.
|
||||
#
|
||||
case "$2" in
|
||||
case "${ACTION}" in
|
||||
pre)
|
||||
chroot . userdel hal &>/dev/null
|
||||
[ $? -eq 0 ] && echo "Removed HAL system user/group."
|
||||
userdel hal &>/dev/null
|
||||
[ $? -eq 0 ] && echo "Removed ${PKGNAME} system user/group."
|
||||
;;
|
||||
post)
|
||||
;;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
texinfo_files="info.info.gz info-stnd.info.gz texinfo.gz
|
||||
texinfo-1.gz texinfo-2.gz texinfo-3.gz"
|
||||
|
||||
case "$2" in
|
||||
case "${ACTION}" in
|
||||
pre)
|
||||
;;
|
||||
post)
|
||||
|
|
Loading…
Reference in a new issue