# HG changeset patch # User Pascal Bellard # Date 1422609457 -3600 # Node ID dfef8de3d270ab352a9967f2b267579ea656cc1c # Parent 40f9f468d1fdc15565e1449baae240996fc6ab94 Update some post_install for install --root diff -r 40f9f468d1fd -r dfef8de3d270 bash/receipt --- a/bash/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/bash/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -89,36 +89,32 @@ post_install() { - local root - root=$1 echo "Processing post-install commands..." - echo -n "Do you want to set Bash to default (y/N) ? : " - read -t 30 anser - if [ "$anser" == "y" ]; then - echo "" - echo "Setting bash as default for all users" - sed -i "s/:\/bin\/sh$/:\/bin\/bash/g" /etc/passwd - sed -i "s/:\/bin\/ksh$/:\/bin\/bash/g" /etc/passwd - sed -i "s/:\/bin\/zsh$/:\/bin\/bash/g" /etc/passwd - sed -i "s/:\/bin\/csh$/:\/bin\/bash/g" /etc/passwd - echo "Creating .bashrc file for all users" - for i in `ls -d /home/*` - do - cp /etc/bashrc $i/.bashrc - done - cp /etc/bashrc /root/.bashrc - cp /etc/bashrc /etc/skel/.bashrc - fi + echo -n "Do you want to set Bash to default (y/N) ? : " + read -t 30 anser + if [ "$anser" == "y" ]; then + echo "" + echo "Setting bash as default for all users" + sed -i "s/:\/bin\/sh$/:\/bin\/bash/g" $1/etc/passwd + sed -i "s/:\/bin\/ksh$/:\/bin\/bash/g" $1/etc/passwd + sed -i "s/:\/bin\/zsh$/:\/bin\/bash/g" $1/etc/passwd + sed -i "s/:\/bin\/csh$/:\/bin\/bash/g" $1/etc/passwd + echo "Creating .bashrc file for all users" + for i in `ls -d $1/home/*` + do + cp $1/etc/bashrc $1$i/.bashrc + done + cp $1/etc/bashrc $1/root/.bashrc + cp $1/etc/bashrc $1/etc/skel/.bashrc + fi } pre_remove() { - local root - root=$1 echo "Setting back sh as default for all users" - sed -i "s/:\/bin\/bash$/:\/bin\/sh/g" /etc/passwd - if [ -f /etc/skel/.bashrc ]; then - rm /etc/skel/.bashrc + sed -i "s/:\/bin\/bash$/:\/bin\/sh/g" $1/etc/passwd + if [ -f $1/etc/skel/.bashrc ]; then + rm $1/etc/skel/.bashrc fi } diff -r 40f9f468d1fd -r dfef8de3d270 boinc/receipt --- a/boinc/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/boinc/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -51,11 +51,11 @@ post_install() { # Check if boinc user already exists - if [ -n "`grep ^${BOINCUSER}: /etc/passwd`" ] ; then - adduser -g "BOINC User" -h /var/lib/boinc -s /bin/bash -S -H -D boinc + if [ -n "`grep ^${BOINCUSER}: $1/etc/passwd`" ] ; then + chroot "$1/" adduser -g "BOINC User" -h /var/lib/boinc -s /bin/bash -S -H -D boinc else # In case boinc was previously installed: - chown -R boinc /var/lib/boinc + chroot "$1/" chown -R boinc /var/lib/boinc fi echo -n "Start the boinc client with \"# /etc/init.d/boinc-client start\"" @@ -67,8 +67,8 @@ echo -n "Delete user boinc and /var/lib/boinc (yes/No) ? : " read -t 30 answer if [ "$answer" == "yes" ]; then - deluser boinc - rm -r /var/lib/boinc + chroot "$1/" deluser boinc + rm -r $1/var/lib/boinc else echo "" echo "Leaving user boinc and /var/lib/boinc" diff -r 40f9f468d1fd -r dfef8de3d270 buildroot/receipt --- a/buildroot/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/buildroot/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -24,7 +24,7 @@ # Pre and post install commands for Tazpkg. post_install() { - [ -L /usr/bin/wget ] && tazpkg get-install wget --forced + [ -L $1/usr/bin/wget ] && chroot "$1/" tazpkg get-install wget --forced cat <> /lib/modules/modules.dep - depmod + [ "$1" ] || depmod -a } diff -r 40f9f468d1fd -r dfef8de3d270 emacs-pkg-go-mode/receipt --- a/emacs-pkg-go-mode/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/emacs-pkg-go-mode/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -29,10 +29,10 @@ post_install() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } post_remove() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } diff -r 40f9f468d1fd -r dfef8de3d270 emacs-pkg-lua-mode/receipt --- a/emacs-pkg-lua-mode/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/emacs-pkg-lua-mode/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -37,10 +37,10 @@ post_install() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } post_remove() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } diff -r 40f9f468d1fd -r dfef8de3d270 emacs-pkg-po-mode/receipt --- a/emacs-pkg-po-mode/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/emacs-pkg-po-mode/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -38,10 +38,10 @@ post_install() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } post_remove() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } diff -r 40f9f468d1fd -r dfef8de3d270 emacs-pkg-text-translator/receipt --- a/emacs-pkg-text-translator/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/emacs-pkg-text-translator/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -27,10 +27,10 @@ post_install() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } post_remove() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } diff -r 40f9f468d1fd -r dfef8de3d270 emacs-pkg-vala-mode/receipt --- a/emacs-pkg-vala-mode/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/emacs-pkg-vala-mode/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -37,10 +37,10 @@ post_install() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } post_remove() { - tazpkg reconfigure emacs + chroot "$1/" tazpkg reconfigure emacs } diff -r 40f9f468d1fd -r dfef8de3d270 emacs/receipt --- a/emacs/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/emacs/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -185,7 +185,7 @@ post_install() { - cd /usr/share/$PACKAGE/$VERSION/site-lisp + cd $1/usr/share/$PACKAGE/$VERSION/site-lisp cat <<-EOF >site-start.el ;; site-start.el for SliTaz -*- no-byte-compile: t -*- ;; @@ -201,13 +201,13 @@ cat site-start.d/$file >> site-start.el done # linking /usr/bin/emacs to new version - [ -h /usr/bin/emacs ] && rm -f /usr/bin/emacs - ln -s /usr/bin/emacs-$VERSION /usr/bin/emacs + [ -h $1/usr/bin/emacs ] && rm -f $1/usr/bin/emacs + ln -s /usr/bin/emacs-$VERSION $1/usr/bin/emacs } post_remove() { - rm -rf /usr/share/emacs - rm -rf /usr/lib/emacs - rm -f /usr/bin/emacs + rm -rf $1/usr/share/emacs + rm -rf $1/usr/lib/emacs + rm -f $1/usr/bin/emacs } diff -r 40f9f468d1fd -r dfef8de3d270 fatattr/stuff/fatattr.sh --- a/fatattr/stuff/fatattr.sh Fri Jan 30 03:47:10 2015 +0100 +++ b/fatattr/stuff/fatattr.sh Fri Jan 30 10:17:37 2015 +0100 @@ -9,7 +9,7 @@ case "${1/--/-}" in -s*) find ${3:-.} -exec fatattr {} \; > ${2:-$ATTRS} ;; -r*) sed -e 's/^\(.\{0,8\}\)/\1=/' -e ':a;s/^\([^ =]*\)\ /\1/;ta' \ - -e 's/^/fatattr +/;s/=//' < ${2:-$ATTRS} | sh ;; + -e "s/^/fatattr +/;s|= | ${3:-.}/|" < ${2:-$ATTRS} | sh ;; -c*) cdfat ${2:-.} && $0 -s && find . | cpio -o -H newc ;; -[xe]*) cdfat ${2:-.} && cpio -idmu && $0 -r && rm -f $ATTRS ;; *) cat 1>&2 <> /etc/profile << EOT + cat >> $1/etc/profile << EOT # freetype-infinality profile settings . /etc/profile.d/infinality-settings.sh EOT # add patched libs to loader config - echo '/usr/lib/freetype-infinality' >> /etc/ld.so.conf - ldconfig + echo '/usr/lib/freetype-infinality' >> $1/etc/ld.so.conf + chroot "$1/" ldconfig echo 'Now you can log out/in to take effect on all your apps' } post_remove() { - sed -i '/infinality/d' /etc/profile - sed -i '/freetype-infinality/d' /etc/ld.so.conf - ldconfig + sed -i '/infinality/d' $1/etc/profile + sed -i '/freetype-infinality/d' $1/etc/ld.so.conf + chroot "$1/" ldconfig } diff -r 40f9f468d1fd -r dfef8de3d270 libsdl/receipt --- a/libsdl/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/libsdl/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -42,5 +42,6 @@ post_install() { - [ -d "/var/lib/tazpkg/installed/libSDL" ] && rm -rf /var/lib/tazpkg/installed/libSDL + [ -d "$1/var/lib/tazpkg/installed/libSDL" ] && + rm -rf $1/var/lib/tazpkg/installed/libSDL } diff -r 40f9f468d1fd -r dfef8de3d270 lightdm-gtk2-greeter/receipt --- a/lightdm-gtk2-greeter/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/lightdm-gtk2-greeter/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -48,12 +48,12 @@ { echo 'make lightdm-gtk2-greeter default greeter' sed -i 's|^# \(greeter-session =\)|\1 lightdm-gtk2-greeter #|' \ - /etc/lightdm/lightdm.conf + $1/etc/lightdm/lightdm.conf } post_remove() { echo 'back to default greeter' sed -i 's|^\(greeter-session =\).*#\(.*\)|#\1\2|' \ - /etc/lightdm/lightdm.conf + $1/etc/lightdm/lightdm.conf } diff -r 40f9f468d1fd -r dfef8de3d270 lightdm-gtk3-greeter/receipt --- a/lightdm-gtk3-greeter/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/lightdm-gtk3-greeter/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -47,12 +47,12 @@ { echo 'make lightdm-gtk3-greeter default greeter' sed -i 's|^# \(greeter-session =\)|\1 lightdm-gtk3-greeter #|' \ - /etc/lightdm/lightdm.conf + $1/etc/lightdm/lightdm.conf } post_remove() { echo 'back to default greeter' sed -i 's|^\(greeter-session =\).*#\(.*\)|#\1\2|' \ - /etc/lightdm/lightdm.conf + $1/etc/lightdm/lightdm.conf } diff -r 40f9f468d1fd -r dfef8de3d270 obmenu/receipt --- a/obmenu/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/obmenu/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -33,13 +33,13 @@ post_install() { echo -n "Enabling configuration file..." - cp /home/tux/.config/openbox/menu.xml /root/.config/openbox + cp $1/home/tux/.config/openbox/menu.xml $1/root/.config/openbox status } post_remove() { echo -n "Removing configuration files..." - rm /root/.config/openbox/menu.xml + rm $1/root/.config/openbox/menu.xml status } diff -r 40f9f468d1fd -r dfef8de3d270 ptxdist/receipt --- a/ptxdist/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/ptxdist/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -23,7 +23,7 @@ # Pre and post install commands for Tazpkg. post_install() { - [ -L /usr/bin/wget ] && tazpkg get-install wget --forced + [ -L $1/usr/bin/wget ] && tazpkg get-install wget --forced --root=${1:-/} cat </dev/null + [ "$1" ] || modprobe snd-seq 2>/dev/null } diff -r 40f9f468d1fd -r dfef8de3d270 wine/receipt --- a/wine/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/wine/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -36,5 +36,5 @@ post_install() { - modprobe snd-seq 2>/dev/null + [ "$1" ] || modprobe snd-seq 2>/dev/null } diff -r 40f9f468d1fd -r dfef8de3d270 wqy-bitmapfont/receipt --- a/wqy-bitmapfont/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/wqy-bitmapfont/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -26,5 +26,5 @@ post_install() { - fc-cache -f > /dev/null 2>&1 + chroot "$1/" fc-cache -f > /dev/null 2>&1 } diff -r 40f9f468d1fd -r dfef8de3d270 xvkbd/receipt --- a/xvkbd/receipt Fri Jan 30 03:47:10 2015 +0100 +++ b/xvkbd/receipt Fri Jan 30 10:17:37 2015 +0100 @@ -43,7 +43,7 @@ { # .Xdefaults file lang=$(echo $LANG | awk '{FS="_"} {print $1}') - find /home -maxdepth 2 -name ".Xdefaults" > /tmp/listeXdefaults + find $1/home -maxdepth 2 -name ".Xdefaults" > /tmp/listeXdefaults while read line do if ! grep -q "Xvkbd settings" $line; then