wok-6.x diff slitaz-loram/receipt @ rev 375
Slitaz-loram*: do not remove itself during install...
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Mar 08 13:55:02 2008 +0000 (2008-03-08) |
parents | 526c779c9331 |
children | b3b7d8187bd1 |
line diff
1.1 --- a/slitaz-loram/receipt Sat Mar 08 13:37:54 2008 +0100 1.2 +++ b/slitaz-loram/receipt Sat Mar 08 13:55:02 2008 +0000 1.3 @@ -20,19 +20,20 @@ 1.4 local line 1.5 local i 1.6 tag="Creat /dev/cdrom if needed" 1.7 - i=$(grep -n "$tag" /etc/init.d/rcS | cut -d: -f1) 1.8 + i=$(grep -n "$tag" $1/etc/init.d/rcS | cut -d: -f1) 1.9 i=$(($i-1)) 1.10 - tag=$(grep "$tag" /etc/init.d/rcS) 1.11 - if [ "$1" = "-R" ]; then 1.12 + tag=$(grep "$tag" $1/etc/init.d/rcS) 1.13 + if [ "$2" = "-R" ]; then 1.14 line="-$(($i-13)),15 +$(($i-13)),2" 1.15 i="-" 1.16 else 1.17 + grep -q 'if [ -f /.usr.cromfs ]; then' $1/etc/init.d/rcS && return 1.18 line="-$i,2 +$i,15" 1.19 i="+" 1.20 fi 1.21 cat <<EOF 1.22 ---- /etc/init.d/rcS 1.23 -+++ /etc/init.d/rcS 1.24 +--- $1/etc/init.d/rcS 1.25 ++++ $1/etc/init.d/rcS 1.26 @@ $line @@ 1.27 1.28 $i# Mount compressed /usr 1.29 @@ -50,6 +51,7 @@ 1.30 $i 1.31 $tag 1.32 EOF 1.33 + chmod 0755 $1/etc/init.d/rcS 1.34 } 1.35 1.36 # Pre and post install commands for Tazpkg. 1.37 @@ -57,12 +59,14 @@ 1.38 { 1.39 local $loram 1.40 loram=$(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null) 1.41 - [ -n "$loram" ] && yes y | tazpkg remove $loram 1.42 + [ -n "$loram" -a "$loram" != "$PACKAGE" ] && yes y | tazpkg remove $loram 1.43 } 1.44 1.45 post_install() 1.46 { 1.47 - get_patch | patch -p0 1.48 + local root 1.49 + root=$1 1.50 + get_patch "$root" | patch -p0 1.51 if [ ! -x /bin/funionfs ]; then 1.52 cat <<EOF 1.53 You will build a live CD with /usr mounted read-only. 1.54 @@ -75,5 +79,5 @@ 1.55 # Pre remove commands for Tazpkg. 1.56 pre_remove() 1.57 { 1.58 - get_patch -R | patch -p0 1.59 + get_patch '' -R | patch -p0 1.60 }