wok-6.x rev 17085

ncmpcpp/receipt, remind/receipt, tiptop/receipt, tmux-mem-cpu-load/receipt: update user config file (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Aug 25 10:52:38 2014 +0200 (2014-08-25)
parents 1794963d7994
children e96aa956e72e
files ncmpcpp/receipt remind/receipt tiptop/receipt tmux-mem-cpu-load/receipt
line diff
     1.1 --- a/ncmpcpp/receipt	Sun Aug 24 23:25:23 2014 +0300
     1.2 +++ b/ncmpcpp/receipt	Mon Aug 25 10:52:38 2014 +0200
     1.3 @@ -31,19 +31,19 @@
     1.4  # Rules to gen a SliTaz package suitable for Tazpkg.
     1.5  genpkg_rules()
     1.6  {
     1.7 -	mkdir -p $fs/usr/share
     1.8 +	mkdir -p $fs/usr/share $fs/etc/skel/.ncmpcpp
     1.9  	cp -a $install/usr/bin $fs/usr
    1.10  	cp -a $install/usr/share/doc $fs/usr/share
    1.11 +	ln $fs/usr/share/doc/ncmpcpp/config $fs/etc/skel/.ncmpcpp
    1.12 +	ln $fs/usr/share/doc/ncmpcpp/keys $fs/etc/skel/.ncmpcpp
    1.13  }
    1.14  
    1.15  post_install()
    1.16  {
    1.17 -	echo -n "Enabling configuration files..."
    1.18 -	for i in $(ls $1/home); do
    1.19 -		mkdir -p $1/home/$i/.ncmpcpp
    1.20 -		cp $1/etc/skel/.tiptoprc $1/home/$i
    1.21 -		cp $1/usr/share/doc/ncmpcpp/config /home/$i/.ncmpcpp
    1.22 -		cp $1/usr/share/doc/ncmpcpp/keys /home/$i/.ncmpcpp
    1.23 +	for i in $(ls $1/home 2> /dev/null); do
    1.24 +		[ -d $1/home/$i/.ncmpcpp ] && continue
    1.25 +		echo -n "Enabling configuration files for $i ..."
    1.26 +		cp -a $1/etc/skel/.ncmpcpp $1/home/$i/
    1.27  		sed -i 's|#mpd_music_dir = ""|mpd_music_dir = "/home/'$i'/music"|' /home/$i/.ncmpcpp/config
    1.28  		# Change permissions also
    1.29  		chroot $1/ chown -R $i.users /home/$i/.ncmpcpp
    1.30 @@ -57,5 +57,3 @@
    1.31  	rm -rf /home/*/.ncmpcpp
    1.32  	status
    1.33  }
    1.34 -	
    1.35 -
     2.1 --- a/remind/receipt	Sun Aug 24 23:25:23 2014 +0300
     2.2 +++ b/remind/receipt	Mon Aug 25 10:52:38 2014 +0200
     2.3 @@ -28,14 +28,15 @@
     2.4  # Rules to gen a SliTaz package suitable for Tazpkg.
     2.5  genpkg_rules()
     2.6  {
     2.7 -	mkdir -p $fs/usr
     2.8 +	mkdir -p $fs/usr $fs/etc/skel
     2.9 +	touch $fs/etc/skel/.reminders
    2.10  	cp -a $install/usr/bin $fs/usr
    2.11  }
    2.12  
    2.13  post_install()
    2.14  {
    2.15  	# Check for ~/.reminders file - needed for wyrd
    2.16 -	for i in $(ls $1/home); do
    2.17 +	for i in $(ls $1/home 2> /dev/null); do
    2.18  		[ -f $1/home/$i/.reminders ] && continue
    2.19  		echo -n "Creating config file for $i ..."
    2.20  		touch $1/home/$i/.reminders 
     3.1 --- a/tiptop/receipt	Sun Aug 24 23:25:23 2014 +0300
     3.2 +++ b/tiptop/receipt	Mon Aug 25 10:52:38 2014 +0200
     3.3 @@ -30,7 +30,8 @@
     3.4  
     3.5  post_install()
     3.6  {
     3.7 -	for i in $(ls $1/home); do
     3.8 +	for i in $(ls $1/home 2> /dev/null); do
     3.9 +		[ -f /home/$i/.tiptoprc ] && continue
    3.10  		cp $1/etc/skel/.tiptoprc $1/home/$i
    3.11  		chroot $1/ chown $i.users /home/$i/.tiptoprc
    3.12  	done
     4.1 --- a/tmux-mem-cpu-load/receipt	Sun Aug 24 23:25:23 2014 +0300
     4.2 +++ b/tmux-mem-cpu-load/receipt	Mon Aug 25 10:52:38 2014 +0200
     4.3 @@ -24,22 +24,22 @@
     4.4  # Rules to gen a SliTaz package suitable for Tazpkg.
     4.5  genpkg_rules()
     4.6  {
     4.7 -	mkdir -p $fs/usr
     4.8 +	mkdir -p $fs/usr $fs/etc/skel
     4.9  	cp -a $install/usr/bin $fs/usr
    4.10 +	cat >> $fs/etc/skel/.tmux.conf << EOT
    4.11 +# tmux-mem-cpu-load
    4.12 +set -g status-interval 2
    4.13 +set -g status-right "#[fg=black,bg=green]#(tmux-mem-cpu-load 2)#[default]"
    4.14 +EOT
    4.15  }
    4.16  
    4.17  post_install()
    4.18  {
    4.19 -	echo -n "Checking for .tmux.conf..."
    4.20 -	for i in $(ls $1/home); do
    4.21 +	for i in $(ls $1/home 2> /dev/null); do
    4.22  		grep -qs "tmux-mem-cpu-load" /home/$i/.tmux.conf && continue
    4.23 -		cat >> /home/$i/.tmux.conf << EOT
    4.24 -# tmux-mem-cpu-load
    4.25 -set -g status-interval 2
    4.26 -set -g status-right "#[fg=black,bg=green]#(tmux-mem-cpu-load 2)#[default]"
    4.27 -EOT
    4.28 -	
    4.29 +		echo -n "Checking for .tmux.conf for $i ..."
    4.30 +		cp -a $1/etc/skel/.tmux.conf /home/$i/
    4.31  		chroot $1/ chown $i.users /home/$i/.tmux.conf
    4.32 +		status
    4.33  	done
    4.34 -	status
    4.35  }