tazpkg rev 144
Handle CONFIG_FILES in receipts
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jul 30 10:56:36 2008 +0000 (2008-07-30) |
parents | db7e865c0a11 |
children | fb01736f4137 |
files | tazpkg |
line diff
1.1 --- a/tazpkg Wed Jul 30 09:51:15 2008 +0000 1.2 +++ b/tazpkg Wed Jul 30 10:56:36 2008 +0000 1.3 @@ -288,6 +288,7 @@ 1.4 extract_package 1.5 SELF_INSTALL=0 1.6 EXTRAVERSION="" 1.7 + CONFIG_FILES="" 1.8 # Include temporary receipt to get the right variables. 1.9 . $PWD/receipt 1.10 if [ $SELF_INSTALL -ne 0 -a -n "$ROOT" ]; then 1.11 @@ -328,6 +329,21 @@ 1.12 if grep -q ^pre_install $ROOT$INSTALLED/$PACKAGE/receipt; then 1.13 pre_install $ROOT 1.14 fi 1.15 + if [ -n "$CONFIG_FILES" ]; then 1.16 + # save 'official' configuration files 1.17 + echo -n "Save configuration files for $PACKAGE... " 1.18 + for i in $CONFIG_FILES; do 1.19 + echo ${i#/} 1.20 + done | ( cd fs ; cpio -o -H newc | gzip -9 ) > \ 1.21 + $ROOT$INSTALLED/$PACKAGE/volatile.cpio.gz 1.22 + # keep user configuration files 1.23 + for i in $CONFIG_FILES; do 1.24 + [ -e $ROOT$i ] || continue 1.25 + rm -f fs$i 1.26 + cp -a $ROOT$i fs$i 1.27 + done 1.28 + status 1.29 + fi 1.30 echo -n "Installing $PACKAGE... " 1.31 cp -a fs/* $ROOT/ 1.32 status 1.33 @@ -1228,6 +1244,7 @@ 1.34 sed 's/^/rootfs/' < files.list | cpio -o -H newc 2>/dev/null |\ 1.35 ( cd tmp ; cpio -id 2>/dev/null ) 1.36 mv tmp/rootfs fs 1.37 + zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd fs; cpio -id ) 1.38 if grep -q repack_cleanup $INSTALLED/$PACKAGE/receipt; then 1.39 . $INSTALLED/$PACKAGE/receipt 1.40 repack_cleanup fs