wok rev 17080

ncmpcpp/receipt, remind/receipt, tiptop/receipt, tmux-mem-cpu-load/receipt: update user config file
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Aug 24 21:21:42 2014 +0200 (2014-08-24)
parents 8a8d742e992f
children 096a77a2021d
files ncmpcpp/receipt remind/receipt tiptop/receipt tmux-mem-cpu-load/receipt
line diff
     1.1 --- a/ncmpcpp/receipt	Sun Aug 24 12:55:58 2014 +0000
     1.2 +++ b/ncmpcpp/receipt	Sun Aug 24 21:21:42 2014 +0200
     1.3 @@ -39,19 +39,22 @@
     1.4  post_install()
     1.5  {
     1.6  	echo -n "Enabling configuration files..."
     1.7 -	mkdir -p $1/home/tux/.ncmpcpp
     1.8 -	cp $1/usr/share/doc/ncmpcpp/config /home/tux/.ncmpcpp
     1.9 -	cp $1/usr/share/doc/ncmpcpp/keys /home/tux/.ncmpcpp
    1.10 -	sed -i 's|#mpd_music_dir = ""|mpd_music_dir = "/home/tux/music"|' /home/tux/.ncmpcpp/config
    1.11 -	# Change permissions also
    1.12 -	chown -R tux:users /home/tux/.ncmpcpp
    1.13 +	for i in $(ls $1/home); do
    1.14 +		mkdir -p $1/home/$i/.ncmpcpp
    1.15 +		cp $1/etc/skel/.tiptoprc $1/home/$i
    1.16 +		cp $1/usr/share/doc/ncmpcpp/config /home/$i/.ncmpcpp
    1.17 +		cp $1/usr/share/doc/ncmpcpp/keys /home/$i/.ncmpcpp
    1.18 +		sed -i 's|#mpd_music_dir = ""|mpd_music_dir = "/home/'$i'/music"|' /home/$i/.ncmpcpp/config
    1.19 +		# Change permissions also
    1.20 +		chroot $1/ chown -R $i.users /home/$i/.ncmpcpp
    1.21 +	done
    1.22  	status
    1.23  }
    1.24  
    1.25  post_remove()
    1.26  {
    1.27  	echo -n "Removing configuration files..."
    1.28 -	rm -rf /home/tux/.ncmpcpp
    1.29 +	rm -rf /home/*/.ncmpcpp
    1.30  	status
    1.31  }
    1.32  	
     2.1 --- a/remind/receipt	Sun Aug 24 12:55:58 2014 +0000
     2.2 +++ b/remind/receipt	Sun Aug 24 21:21:42 2014 +0200
     2.3 @@ -35,11 +35,16 @@
     2.4  post_install()
     2.5  {
     2.6  	# Check for ~/.reminders file - needed for wyrd
     2.7 -	if [ ! -f $1/home/tux/.reminders -a -d $1/home/tux ]; then
     2.8 -		echo -n "Creating config file..."
     2.9 -		touch $1/home/tux/.reminders 
    2.10 -		chown tux:tux $1/home/tux/.reminders
    2.11 +	for i in $(ls $1/home); do
    2.12 +		[ -f $1/home/$i/.reminders ] && continue
    2.13 +		echo -n "Creating config file for $i ..."
    2.14 +		touch $1/home/$i/.reminders 
    2.15 +		chroot $1/ chown $i.users /home/$i/.reminders
    2.16  		status
    2.17 -	fi
    2.18 +	done
    2.19  }
    2.20  
    2.21 +post_remove()
    2.22 +{
    2.23 +	rm -f $1/home/*/.reminders
    2.24 +}
     3.1 --- a/tiptop/receipt	Sun Aug 24 12:55:58 2014 +0000
     3.2 +++ b/tiptop/receipt	Sun Aug 24 21:21:42 2014 +0200
     3.3 @@ -23,9 +23,20 @@
     3.4  # Rules to gen a SliTaz package suitable for Tazpkg.
     3.5  genpkg_rules()
     3.6  {
     3.7 -	mkdir -p $fs/usr $fs/home/tux # config file
     3.8 +	mkdir -p $fs/usr $fs/etc/skel
     3.9  	cp -a $install/usr/bin $fs/usr
    3.10 -	cp -a $src/tiptoprc $fs/home/tux/.tiptoprc
    3.11 -	chown tux.users $fs/home/tux/.tiptoprc
    3.12 +	cp -a $src/tiptoprc $fs/etc/skel/.tiptoprc
    3.13  }
    3.14  
    3.15 +post_install()
    3.16 +{
    3.17 +	for i in $(ls $1/home); do
    3.18 +		cp $1/etc/skel/.tiptoprc $1/home/$i
    3.19 +		chroot $1/ chown $i.users /home/$i/.tiptoprc
    3.20 +	done
    3.21 +}
    3.22 +
    3.23 +post_remove()
    3.24 +{
    3.25 +	rm -f $1/home/*/.tiptoprc
    3.26 +}
     4.1 --- a/tmux-mem-cpu-load/receipt	Sun Aug 24 12:55:58 2014 +0000
     4.2 +++ b/tmux-mem-cpu-load/receipt	Sun Aug 24 21:21:42 2014 +0200
     4.3 @@ -31,14 +31,15 @@
     4.4  post_install()
     4.5  {
     4.6  	echo -n "Checking for .tmux.conf..."
     4.7 -	if [ ! -f /home/tux/.tmux.conf ] || $(! grep -q "tmux-mem-cpu-load" /home/tux/.tmux.conf); then
     4.8 -	cat >> /home/tux/.tmux.conf << EOT
     4.9 +	for i in $(ls $1/home); do
    4.10 +		grep -qs "tmux-mem-cpu-load" /home/$i/.tmux.conf && continue
    4.11 +		cat >> /home/$i/.tmux.conf << EOT
    4.12  # tmux-mem-cpu-load
    4.13  set -g status-interval 2
    4.14  set -g status-right "#[fg=black,bg=green]#(tmux-mem-cpu-load 2)#[default]"
    4.15  EOT
    4.16 -	fi
    4.17 -	chown tux:users /home/tux/.tmux.conf
    4.18 +	
    4.19 +		chroot $1/ chown $i.users /home/$i/.tmux.conf
    4.20 +	done
    4.21  	status
    4.22  }
    4.23 -