Modify the INSTALL/REMOVE scripts to use predef vars and unneeded chroot calls.

--HG--
extra : convert_revision : dfd737c502bea327054ecff5bc1fa152db6e2009
This commit is contained in:
Juan RP 2009-04-08 03:24:57 +02:00
parent 201be83c73
commit acd07f61e3
8 changed files with 44 additions and 44 deletions

View file

@ -2,35 +2,35 @@
# This script fixes permissions for some files and dirs, # This script fixes permissions for some files and dirs,
# and creates the policykit system user/group. # and creates the policykit system user/group.
# #
case "$2" in case "${ACTION}" in
pre) pre)
;; ;;
post) post)
echo "Running $3-$4 post installation hooks..." echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
if ! chroot . getent group policykit >/dev/null; then if ! getent group policykit >/dev/null; then
chroot . groupadd -r policykit groupadd -r policykit 2>&1 >/dev/null
[ $? -ne 0 ] && exit $? [ $? -ne 0 ] && exit $?
echo "Created policykit system group." echo "Created policykit system group."
fi fi
if ! chroot . getent passwd policykit >/dev/null; then if ! getent passwd policykit >/dev/null; then
chroot . useradd -c "PolicyKit user" \ useradd -c "PolicyKit user" \
-d / -s /sbin/nologin -g policykit -r policykit && \ -d / -s /sbin/nologin -g policykit -r policykit && \
chroot . passwd -l policykit &>/dev/null passwd -l policykit 2>&1 >/dev/null
[ $? -ne 0 ] && exit $? [ $? -ne 0 ] && exit $?
echo "Created policykit system user." echo "Created policykit system user."
fi fi
chroot . chgrp policykit var/run/PolicyKit chgrp policykit var/run/PolicyKit
chroot . chgrp policykit var/lib/PolicyKit chgrp policykit var/lib/PolicyKit
chroot . chown policykit var/lib/PolicyKit-public chown policykit var/lib/PolicyKit-public
chroot . chown policykit:policykit var/lib/misc/PolicyKit.reload chown policykit:policykit var/lib/misc/PolicyKit.reload
chroot . chown policykit usr/libexec/polkit-set-default-helper chown policykit usr/libexec/polkit-set-default-helper
chroot . chmod u+s 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 \ for i in polkit-read-auth-helper polkit-revoke-helper \
polkit-grant-helper polkit-explicit-grant-helper; do polkit-grant-helper polkit-explicit-grant-helper; do
chroot . chgrp policykit usr/libexec/$i chgrp policykit usr/libexec/$i
chroot . chmod g+s usr/libexec/$i chmod g+s usr/libexec/$i
done done
chroot . chgrp policykit usr/libexec/polkit-grant-helper-pam chgrp policykit usr/libexec/polkit-grant-helper-pam
chroot . chmod u+s usr/libexec/polkit-grant-helper-pam chmod u+s usr/libexec/polkit-grant-helper-pam
;; ;;
esac esac

View file

@ -1,10 +1,10 @@
# #
# This script removes the policykit user/group. # This script removes the policykit user/group.
# #
case "$2" in case "${ACTION}" in
pre) pre)
chroot . userdel policykit &>/dev/null userdel policykit 2>&1 >/dev/null
[ $? -eq 0 ] && echo "Removed policykit system user/group." [ $? -eq 0 ] && echo "Removed ${PKGNAME} system user/group."
;; ;;
post) post)
;; ;;

View file

@ -4,25 +4,25 @@
# #
dbus_launch="./usr/libexec/dbus-daemon-launch-helper" dbus_launch="./usr/libexec/dbus-daemon-launch-helper"
case "$2" in case "${ACTION}" in
pre) pre)
;; ;;
post) post)
echo "Running $3-$4 post installation hooks..." echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
if ! chroot . getent group dbus >/dev/null; then if ! getent group dbus >/dev/null; then
chroot . groupadd -r dbus groupadd -r dbus 2>&1 >/dev/null
[ $? -ne 0 ] && exit $? [ $? -ne 0 ] && exit $?
echo "Created dbus system group." echo "Created dbus system group."
fi fi
if ! chroot . getent passwd dbus >/dev/null; then if ! getent passwd dbus >/dev/null; then
chroot . useradd -c "System message bus" \ useradd -c "System message bus" \
-d /var/run/dbus \ -d /var/run/dbus \
-s /sbin/nologin -g dbus -r dbus && \ -s /sbin/nologin -g dbus -r dbus && \
chroot . passwd -l dbus &>/dev/null passwd -l dbus 2>&1 >/dev/null
[ $? -ne 0 ] && exit $? [ $? -ne 0 ] && exit $?
echo "Created dbus system user." echo "Created dbus system user."
fi fi
chroot . chown root:dbus ${dbus_launch} chown root:dbus ${dbus_launch}
chroot . chmod 4750 ${dbus_launch} chmod 4750 ${dbus_launch}
;; ;;
esac esac

View file

@ -1,10 +1,10 @@
# #
# This script removes the dbus user/group. # This script removes the dbus user/group.
# #
case "$2" in case "${ACTION}" in
pre) pre)
chroot . userdel dbus &>/dev/null userdel dbus 2>&1 >/dev/null
[ $? -eq 0 ] && echo "Removed dbus system user/group." [ $? -eq 0 ] && echo "Removed ${PKGNAME} system user/group."
;; ;;
post) post)
;; ;;

View file

@ -1,7 +1,7 @@
# #
# This script builds fontconfig's fonts cache. # This script builds fontconfig's fonts cache.
# #
case "$2" in case "${ACTION}" in
pre) pre)
;; ;;
post) post)

View file

@ -2,21 +2,21 @@
# This script creates the HAL system user/group. # This script creates the HAL system user/group.
# #
case "$2" in case "${ACTION}" in
pre) pre)
;; ;;
post) post)
echo "Running $3-$4 post installation hooks..." echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
if ! chroot . getent group hal >/dev/null; then if ! getent group hal >/dev/null; then
chroot . groupadd -r hal groupadd -r hal 2>&1 >/dev/null
[ $? -ne 0 ] && exit $? [ $? -ne 0 ] && exit $?
echo "Created HAL system group." echo "Created HAL system group."
fi fi
if ! chroot . getent passwd hal >/dev/null; then if ! getent passwd hal >/dev/null; then
chroot . useradd -c "HAL daemon" \ useradd -c "HAL daemon" \
-d / -s /sbin/nologin -g hal \ -d / -s /sbin/nologin -g hal \
-G optical,floppy,storage -r hal && \ -G optical,floppy,storage -r hal && \
chroot . passwd -l hal &>/dev/null passwd -l hal 2>&1 >/dev/null
[ $? -ne 0 ] && exit $? [ $? -ne 0 ] && exit $?
echo "Created HAL system user." echo "Created HAL system user."
fi fi

View file

@ -1,10 +1,10 @@
# #
# This script removes the HAL user/group. # This script removes the HAL user/group.
# #
case "$2" in case "${ACTION}" in
pre) pre)
chroot . userdel hal &>/dev/null userdel hal &>/dev/null
[ $? -eq 0 ] && echo "Removed HAL system user/group." [ $? -eq 0 ] && echo "Removed ${PKGNAME} system user/group."
;; ;;
post) post)
;; ;;

View file

@ -4,7 +4,7 @@
texinfo_files="info.info.gz info-stnd.info.gz texinfo.gz texinfo_files="info.info.gz info-stnd.info.gz texinfo.gz
texinfo-1.gz texinfo-2.gz texinfo-3.gz" texinfo-1.gz texinfo-2.gz texinfo-3.gz"
case "$2" in case "${ACTION}" in
pre) pre)
;; ;;
post) post)