wok rev 18667

Change messaging in {pre|post}_{install|remove}(): wget and a* packages
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Dec 04 16:32:53 2015 +0200 (2015-12-04)
parents 8031c3523ad8
children fca172c323cf
files acpid/receipt ajaxterm/receipt alpine/receipt apache/receipt atril/receipt aufs/receipt autoblog/receipt autofs/receipt avant-window-navigator/receipt awesome/receipt awstats-hotspot/receipt awstats/receipt wget/receipt
line diff
     1.1 --- a/acpid/receipt	Fri Dec 04 13:21:56 2015 +0100
     1.2 +++ b/acpid/receipt	Fri Dec 04 16:32:53 2015 +0200
     1.3 @@ -42,15 +42,13 @@
     1.4  # Pre and post remove commands for Tazpkg
     1.5  post_install()
     1.6  {
     1.7 -	local root
     1.8 -	root=$1
     1.9 -	if [ -z "$root" ]; then
    1.10 +	if [ -z "$1" ]; then
    1.11  		/etc/init.d/acpid start || continue
    1.12  	fi
    1.13 -	if ! grep -q ^ACPID_OPTIONS $root/etc/daemons.conf; then
    1.14 -		echo '# ACPI daemon options.' >> $root/etc/daemons.conf
    1.15 -		echo 'ACPID_OPTIONS=""' >> $root/etc/daemons.conf
    1.16 -		echo '' >> $root/etc/daemons.conf
    1.17 +	if ! grep -q ^ACPID_OPTIONS "$1/etc/daemons.conf"; then
    1.18 +		echo '# ACPI daemon options.' >> "$1/etc/daemons.conf"
    1.19 +		echo 'ACPID_OPTIONS=""' >> "$1/etc/daemons.conf"
    1.20 +		echo '' >> "$1/etc/daemons.conf"
    1.21  	fi
    1.22  }	
    1.23  
     2.1 --- a/ajaxterm/receipt	Fri Dec 04 13:21:56 2015 +0100
     2.2 +++ b/ajaxterm/receipt	Fri Dec 04 16:32:53 2015 +0200
     2.3 @@ -71,7 +71,8 @@
     2.4  	fi
     2.5  	[ -z "$1" ] && /etc/init.d/ajaxterm start
     2.6  	[ ! -f $1/usr/lib/lighttpd/mod_proxy.so -a \
     2.7 -	  ! -f $1/etc/apache/httpd.conf ] && cat <<EOT
     2.8 +	  ! -f $1/etc/apache/httpd.conf ] &&
     2.9 +	  [ -z "$quiet" ] && cat <<EOT
    2.10  --------
    2.11  You should install either lighttpd
    2.12  # tazpkg get-install lighttpd-ssl ; tazpkg get-install lighttpd-modules
    2.13 @@ -82,4 +83,3 @@
    2.14  --------
    2.15  EOT
    2.16  }
    2.17 -
     3.1 --- a/alpine/receipt	Fri Dec 04 13:21:56 2015 +0100
     3.2 +++ b/alpine/receipt	Fri Dec 04 16:32:53 2015 +0200
     3.3 @@ -36,18 +36,13 @@
     3.4  post_install()
     3.5  {
     3.6  	# link old libldap libraries
     3.7 -	echo -n "Linking libraries..."
     3.8 -	cd $1/usr/lib
     3.9 +	cd "$1/usr/lib"
    3.10  	ln -s liblber-2.4.so.2.4.2 liblber-2.3.so.0
    3.11  	ln -s libldap-2.4.so.2.4.2 libldap-2.3.so.0
    3.12 -	status
    3.13  }
    3.14  
    3.15  post_remove()
    3.16  {
    3.17 -	echo -n "Removing linked libraries..."
    3.18  	rm -f /usr/lib/liblber-2.3.so.0
    3.19  	rm -f /usr/lib/libldap-2.3.so.0
    3.20 -	status
    3.21  }
    3.22 -
     4.1 --- a/apache/receipt	Fri Dec 04 13:21:56 2015 +0100
     4.2 +++ b/apache/receipt	Fri Dec 04 16:32:53 2015 +0200
     4.3 @@ -70,7 +70,6 @@
     4.4  # We stop the server by default in case of upgarde.
     4.5  pre_install()
     4.6  {
     4.7 -	echo "Processing pre-install commands..."
     4.8  	[ -z "$1" ] && [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
     4.9  }
    4.10  
    4.11 @@ -79,7 +78,7 @@
    4.12  	local lang=$(. /etc/locale.conf 2>/dev/null; echo ${LANG#*_})
    4.13  	local tz=$(cat /etc/TZ 2>/dev/null)
    4.14  	local hostname=$(cat /etc/hostname 2>/dev/null)
    4.15 -	echo "Processing post-install commands..."
    4.16 +
    4.17  	# Just in case.
    4.18  	chown www.www $1/var/log/$PACKAGE
    4.19  	ping -c 2 $(hostname) > /dev/null 2>&1 || 
    4.20 @@ -95,11 +94,12 @@
    4.21  
    4.22  
    4.23  EOT
    4.24 +	[ -z "$quiet" ] && echo # Start new line
    4.25  	( cd $1/$INSTALLED/ ; grep -l /etc/apache/conf.d/ */receipt ) | \
    4.26  	while read file; do
    4.27  		pkg=$(dirname $file)
    4.28  		[ "$pkg" = "$PACKAGE" ] && continue
    4.29 -		echo "Reconfiguring $pkg for $PACKAGE..."
    4.30 +		[ -z "$quiet" ] && echo "Reconfiguring $pkg for $PACKAGE..."
    4.31  		tazpkg reconfigure $pkg
    4.32  	done
    4.33  	[ -f $1/etc/php.ini ] && tazpkg get-install php-apache --root=$1
     5.1 --- a/atril/receipt	Fri Dec 04 13:21:56 2015 +0100
     5.2 +++ b/atril/receipt	Fri Dec 04 16:32:53 2015 +0200
     5.3 @@ -44,14 +44,7 @@
     5.4  	cp -a $install/usr/lib/pkgconfig $fs/usr/lib
     5.5  }
     5.6  
     5.7 -post_install()
     5.8 -{
     5.9 -	echo "Processing post-install commands..."
    5.10 -	chroot $1/ /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
    5.11 -}
    5.12 -
    5.13  post_remove()
    5.14  {
    5.15 -	echo "Processing post-remove commands..."
    5.16 -	chroot $1/ /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
    5.17 +	chroot "$1/" /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
    5.18  }
     6.1 --- a/aufs/receipt	Fri Dec 04 13:21:56 2015 +0100
     6.2 +++ b/aufs/receipt	Fri Dec 04 16:32:53 2015 +0200
     6.3 @@ -55,12 +55,10 @@
     6.4  # Post install/remove commands for Tazpkg.
     6.5  post_install()
     6.6  {
     6.7 -	echo "Processing post-install commands..."
     6.8 -	chroot "$root/" depmod -a ${EXTRAVERSION#_}-slitaz
     6.9 +	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
    6.10  }
    6.11  
    6.12  post_remove()
    6.13  {
    6.14 -	echo "Processing post-remove commands..."
    6.15 -	chroot "$root/" depmod -a ${EXTRAVERSION#_}-slitaz
    6.16 +	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
    6.17  }
     7.1 --- a/autoblog/receipt	Fri Dec 04 13:21:56 2015 +0100
     7.2 +++ b/autoblog/receipt	Fri Dec 04 16:32:53 2015 +0200
     7.3 @@ -28,8 +28,8 @@
     7.4  	mkdir -p $src 2> /dev/null
     7.5  }
     7.6  
     7.7 -# Rules to gen a SliTaz package suitable for Tazpkg.   
     7.8 -genpkg_rules()                                      
     7.9 +# Rules to gen a SliTaz package suitable for Tazpkg.
    7.10 +genpkg_rules()
    7.11  {
    7.12  	mkdir -p $fs/var/www/$PACKAGE
    7.13  	cp $SOURCES_REPOSITORY/$_TARBALL $fs/var/www/$PACKAGE/index.php
    7.14 @@ -42,5 +42,5 @@
    7.15  	mytz="$(cat $1/etc/TZ)"
    7.16  	[ -n "$mytz" ] && sed  -i "s|Europe/Paris|$mytz|" $1/var/www/$PACKAGE/index.php
    7.17  	chown -R www $1/var/www/$PACKAGE
    7.18 -	echo "You should update /var/www/$PACKAGE/vvb.ini now ..."
    7.19 +	[ -z "$quiet" ] && echo "You should update /var/www/$PACKAGE/vvb.ini now..."
    7.20  }
     8.1 --- a/autofs/receipt	Fri Dec 04 13:21:56 2015 +0100
     8.2 +++ b/autofs/receipt	Fri Dec 04 16:32:53 2015 +0200
     8.3 @@ -40,5 +40,5 @@
     8.4  # Pre and post install commands for Tazpkg.
     8.5  post_install()
     8.6  {
     8.7 -	mkdir -p $1/mnt/auto 2> /dev/null
     8.8 +	mkdir -p "$1/mnt/auto" 2>/dev/null
     8.9  }
     9.1 --- a/avant-window-navigator/receipt	Fri Dec 04 13:21:56 2015 +0100
     9.2 +++ b/avant-window-navigator/receipt	Fri Dec 04 16:32:53 2015 +0200
     9.3 @@ -68,6 +68,7 @@
     9.4  post_install()
     9.5  {
     9.6    # ln missing icons
     9.7 +  # FIXME
     9.8      ln -sf $1/usr/share/icons/SliTaz/16x16/actions/go-up.png $1/usr/share/icons/SliTaz/16x16/actions/gtk-sort-ascending.png
     9.9      ln -sf $1/usr/share/icons/SliTaz/16x16/actions/go-down.png $1/usr/share/icons/SliTaz/16x16/actions/gtk-sort-descending.png
    9.10  }
    10.1 --- a/awesome/receipt	Fri Dec 04 13:21:56 2015 +0100
    10.2 +++ b/awesome/receipt	Fri Dec 04 16:32:53 2015 +0200
    10.3 @@ -48,19 +48,17 @@
    10.4  
    10.5  post_install()
    10.6  {
    10.7 -	res=`cat $1/etc/slim.conf | grep ^session | sed s/"sessions. *"//`
    10.8 +	res=$(cat $1/etc/slim.conf | grep ^session | sed s/"sessions. *"//)
    10.9  	# Adding WM to SLIM available sessions.
   10.10  	if ! echo "$res" | grep -q $PACKAGE; then
   10.11 -		echo -n "Adding $PACKAGE to /etc/slim.conf..."
   10.12 -		sed -i "s/^sessions.*/sessions            ${res},$PACKAGE/" /etc/slim.conf
   10.13 -		status
   10.14 +		sed -i "s/^sessions.*/sessions            ${res},$PACKAGE/" "$1/etc/slim.conf"
   10.15  	fi
   10.16  }
   10.17  
   10.18  post_remove()
   10.19  {
   10.20  	# Remove WM from SLIM available sessions.
   10.21 -	if grep -q $PACKAGE $1/etc/slim.conf; then
   10.22 -		sed -i s/,$PACKAGE// $1/etc/slim.conf
   10.23 +	if grep -q $PACKAGE "$1/etc/slim.conf"; then
   10.24 +		sed -i s/,$PACKAGE// "$1/etc/slim.conf"
   10.25  	fi
   10.26  }
    11.1 --- a/awstats-hotspot/receipt	Fri Dec 04 13:21:56 2015 +0100
    11.2 +++ b/awstats-hotspot/receipt	Fri Dec 04 16:32:53 2015 +0200
    11.3 @@ -19,10 +19,11 @@
    11.4  
    11.5  post_install()
    11.6  {
    11.7 -	chroot $1/ /usr/bin/loghotspot.sh --install
    11.8 +	chroot "$1/" /usr/bin/loghotspot.sh --install
    11.9  }
   11.10  
   11.11  post_remove()
   11.12  {
   11.13 +	# FIXME root
   11.14  	grep -l loghotspot.sh /etc/awstats/*.conf | xargs rm -f
   11.15  }
    12.1 --- a/awstats/receipt	Fri Dec 04 13:21:56 2015 +0100
    12.2 +++ b/awstats/receipt	Fri Dec 04 16:32:53 2015 +0200
    12.3 @@ -61,7 +61,6 @@
    12.4  
    12.5  post_install()
    12.6  {
    12.7 -	echo "Processing post-install commands..."
    12.8  	# Set lighttpd or apache config
    12.9  	if [ -f $1/etc/apache/httpd.conf ]; then
   12.10  		if [ ! -f $1/etc/apache/conf.d/awstats.conf ]; then
   12.11 @@ -87,7 +86,8 @@
   12.12  			/etc/init.d/lighttpd restart
   12.13  		fi
   12.14  	fi
   12.15 -	cat <<EOT
   12.16 +	[ -z "$quiet" ] && cat <<EOT
   12.17 +
   12.18  You should add in your crontab something like;
   12.19  
   12.20  0 0 * * * /usr/share/awstats/extras/update
   12.21 @@ -99,11 +99,11 @@
   12.22  		echo "Remove orphan dirctories."
   12.23  		[ -d /usr/share/awstats ] && rm -rf /usr/share/awstats
   12.24  
   12.25 -		# 
   12.26 +		# FIXME
   12.27  		echo "All database and configuratoin files will be removed"
   12.28  		echo -n "Please confirm removing (y/N) : "; read answer
   12.29  
   12.30 -		case $answer in 
   12.31 +		case $answer in
   12.32  			y|Y)
   12.33  				rm -rf /var/lib/awstats
   12.34  				rm -rf /etc/awstats
    13.1 --- a/wget/receipt	Fri Dec 04 13:21:56 2015 +0100
    13.2 +++ b/wget/receipt	Fri Dec 04 16:32:53 2015 +0200
    13.3 @@ -37,24 +37,14 @@
    13.4  # Post install rules.
    13.5  post_install()
    13.6  {
    13.7 -	echo -e "
    13.8 +	[ -z "$quiet" ] && echo -e "
    13.9  wget is in conflict with the busybox wget.
   13.10  If you want to use the busybox wget, do (as root):
   13.11  \033[1m ln -s /bin/busybox /usr/bin/wget \033[0m
   13.12  "
   13.13  }
   13.14  
   13.15 -# Pre and post install commands for Tazpkg.
   13.16 -# We must remove all Busybox symlink before installing.
   13.17 -#
   13.18 -pre_install()
   13.19 -{
   13.20 -	qaction "Removing Busybox wget replaced utility..."
   13.21 -	rm -f $1/usr/bin/wget
   13.22 -	qstatus
   13.23 -}
   13.24 -
   13.25  post_remove()
   13.26  {
   13.27 -	ln -s /bin/busybox $1/usr/bin/wget
   13.28 +	ln -s /bin/busybox "$1/usr/bin/wget"
   13.29  }