wok-current rev 18466

bash: fix ~/.bashrc creation, etc.; dia: fix icons packaging (thanks llev for reports)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Oct 03 06:11:22 2015 +0300 (2015-10-03)
parents b8e624e9b721
children 303e73fdfb01
files bash/receipt dia/receipt
line diff
     1.1 --- a/bash/receipt	Fri Oct 02 13:31:38 2015 +0200
     1.2 +++ b/bash/receipt	Sat Oct 03 06:11:22 2015 +0300
     1.3 @@ -14,6 +14,7 @@
     1.4  BASHCHECK="$(basename $BASHCHECKURL)"
     1.5  BASHPATCHES="$(for i in $(seq 1 ${VERSION##*.}); do printf "bash${BASEVERSION/./}-%03d " $i; done)"
     1.6  EXTRA_SOURCE_FILES="$BASHCHECK $BASHPATCHES"
     1.7 +TAGS="shell"
     1.8  
     1.9  DEPENDS="readline"
    1.10  BUILD_DEPENDS="readline bison wget texinfo"
    1.11 @@ -89,32 +90,32 @@
    1.12  
    1.13  post_install()
    1.14  {
    1.15 -	echo "Processing post-install commands..."
    1.16 -	echo -n "Do you want to set Bash to default (y/N) ? : "
    1.17 -	read -t 30 anser
    1.18 -	if [ "$anser" == "y" ]; then
    1.19 -		echo ""
    1.20 -		echo "Setting bash as default for all users"
    1.21 -		sed -i "s/:\/bin\/sh$/:\/bin\/bash/g"  $1/etc/passwd
    1.22 -		sed -i "s/:\/bin\/ksh$/:\/bin\/bash/g" $1/etc/passwd
    1.23 -		sed -i "s/:\/bin\/zsh$/:\/bin\/bash/g" $1/etc/passwd
    1.24 -		sed -i "s/:\/bin\/csh$/:\/bin\/bash/g" $1/etc/passwd	
    1.25 -		echo "Creating .bashrc file for all users"
    1.26 -		for i in `ls -d $1/home/*`
    1.27 -		    do
    1.28 -		    cp $1/etc/bashrc $1$i/.bashrc
    1.29 -		    done
    1.30 -		cp $1/etc/bashrc $1/root/.bashrc
    1.31 -		cp $1/etc/bashrc $1/etc/skel/.bashrc
    1.32 -	fi
    1.33 +	cp -a "$1/etc/bashrc" "$1/etc/skel/.bashrc"
    1.34 +
    1.35 +	# Exit function in non-interactive mode (when user can't answer question)
    1.36 +	tty -s || return
    1.37 +
    1.38 +	echo -n 'Do you want to set Bash to default (y/N) ? : '
    1.39 +	read -t 30 answer
    1.40 +	[ "$answer" == 'y' ] || return
    1.41 +
    1.42 +	echo
    1.43 +	echo 'Setting bash as default shell for all users'
    1.44 +	sed -i 's|:/bin/[ckz]*sh$|:/bin/bash|' "$1/etc/passwd"
    1.45 +
    1.46 +	echo 'Creating ~/.bashrc file for all users'
    1.47 +	for i in $(awk -F: '$7=="/bin/bash"{print $6}' "$1/etc/passwd"); do
    1.48 +		[ -e "$1$i/.bashrc" ] && continue
    1.49 +		cp "$1/etc/bashrc" "$1$i/.bashrc"
    1.50 +		chown $(stat -c%U:%G "$1$i") "$1$i/.bashrc"
    1.51 +	done
    1.52  }
    1.53  
    1.54  
    1.55  pre_remove()
    1.56  {
    1.57 -	echo "Setting back sh as default for all users"
    1.58 -	sed -i "s/:\/bin\/bash$/:\/bin\/sh/g"  $1/etc/passwd
    1.59 -	if [ -f $1/etc/skel/.bashrc ]; then
    1.60 -		rm $1/etc/skel/.bashrc
    1.61 -	fi
    1.62 +	echo
    1.63 +	echo 'Setting sh as default shell for all users'
    1.64 +	sed -i 's|:/bin/bash$|:/bin/sh|' "$1/etc/passwd"
    1.65 +	[ -f "$1/etc/skel/.bashrc" ] && rm "$1/etc/skel/.bashrc"
    1.66  }
     2.1 --- a/dia/receipt	Fri Oct 02 13:31:38 2015 +0200
     2.2 +++ b/dia/receipt	Sat Oct 03 06:11:22 2015 +0300
     2.3 @@ -20,7 +20,6 @@
     2.4  # Rules to configure and make the package.
     2.5  compile_rules()
     2.6  {
     2.7 -	cd $src
     2.8  	find . -name '*.[ch]*' | xargs sed -i 's|<glib/.*h|<glib.h|'
     2.9  	sed -i 's|stdio.h>|&\n#include <sys/stat.h>|' plug-ins/vdx/vdx-export.c
    2.10  	patch -Np1 -i $stuff/dia-overflow-fix.patch
    2.11 @@ -35,17 +34,15 @@
    2.12  # Rules to gen a SliTaz package suitable for Tazpkg.
    2.13  genpkg_rules()
    2.14  {
    2.15 -	mkdir -p $fs/usr/lib $fs/usr/share/locale
    2.16 -	cp -a $install/usr/lib/dia $fs/usr/lib
    2.17 +	mkdir -p $fs/usr/lib/dia $fs/usr/share
    2.18 +
    2.19 +	cp -a $install/usr/bin $fs/usr
    2.20 +	cp -a $install/usr/lib/dia/*.so $fs/usr/lib/dia
    2.21 +	cp -a $install/usr/share/applications $fs/usr/share
    2.22  	cp -a $install/usr/share/dia $fs/usr/share
    2.23 +	cp -a $install/usr/share/icons $fs/usr/share
    2.24 +	rm -r $fs/usr/share/icons/hicolor/scalable
    2.25 +#	cp -a $install/usr/share/locale $fs/usr/share
    2.26 +	cp -a $install/usr/share/mime-info $fs/usr/share
    2.27  	cp -a $install/usr/share/oaf $fs/usr/share
    2.28 -	#cp -a $install/usr/share/omf $fs/usr/share
    2.29 -	cp -a $install/usr/share/locale/de $fs/usr/share/locale
    2.30 -	cp -a $install/usr/share/locale/fr $fs/usr/share/locale
    2.31 -	#cp -a $install/usr/share/help $fs/usr/share
    2.32 -	cp -a $install/usr/share/applications $fs/usr/share
    2.33 -	cp -a $install/usr/share/mime-info $fs/usr/share
    2.34 -	cp -a $install/usr/share/icons/hicolor/16x16/apps/dia.png $fs/usr/share/pixmaps
    2.35 -	cp -a $install/usr/bin $fs/usr
    2.36  }
    2.37 -