# HG changeset patch
# User Leonardo Laporte <hackdorte@sapo.pt>
# Date 1461292091 10800
# Node ID 4bccb65c3f353df7f8cf0c3f44e58e8dcc1447b7
# Parent  ad8378dca8808d42be3abbe5755fb762bcbc90d7
Small adjustments. Thanks Pascal.

diff -r ad8378dca880 -r 4bccb65c3f35 conky-theme-onsea/receipt
--- a/conky-theme-onsea/receipt	Thu Apr 21 22:04:50 2016 +0200
+++ b/conky-theme-onsea/receipt	Thu Apr 21 23:28:11 2016 -0300
@@ -11,13 +11,14 @@
 STUFF_DIR="lab.slitaz/5.0/pkg/conky/1.9.0"
 TARBALL="$SOURCE-$VERSION.tar.gz"
 WGET_URL="${WEB_SITE}/$STUFF_DIR/$TARBALL"
-TAGS="conky theme"
+TAGS="conky desktop monitoring theme"
+HOST_ARCH="i486"
 
 DEPENDS="conky"
 BUILD_DEPENDS="wget"
 
-BAK_DIR=".conky-backups"
-BAK_FILE="DEwioa80aejskDFPels0" # I do not know how to improve it. I write it manually. There is an automatic method?
+BAK_DIR=".conky-backup"
+BAK_FILE="old_conkyrc"
 
 # Rules to configure and make the package.
 compile_rules()
@@ -34,12 +35,10 @@
 
 pre_install()
 {
-
 # Build current ".conkyrc" backup.
-
 if [ -e $1/home/$USER/.conkyrc ]; then
-mkdir -p $1/home/$USER/$BAK_DIR/$BAK_FILE
-mv $1/home/$USER/.conkyrc $1/home/$USER/$BAK_DIR/$BAK_FILE
+  mkdir -p $1/home/$USER/$BAK_DIR/$BAK_FILE
+  mv $1/home/$USER/.conkyrc $1/home/$USER/$BAK_DIR/$BAK_FILE
 
 # README (Alert file only).
 cat > $1/home/$USER/$BAK_DIR/README <<EOT
@@ -53,60 +52,46 @@
   Run: tazpkg remove $PACKAGE
 
 EOT
-
-else
-  echo "No .conkyrc file for backup.";
 fi
-
 }
 
 post_install()
 {
-
 # Install new ".conkyrc" to (home/user).
 # And create a link to the original file.
-
   cd $1/home/$USER
   ln -s /usr/share/conky/themes/$SOURCE/.conkyrc $1/home/$USER/.conkyrc
-  chmod 755 $1/home/$USER/.conkyrc
+  ### chmod 755 $1/home/$USER/.conkyrc
 
 # Check the conky process and run new theme.
-
-  [ "$1" ] ||
+[ "$1" ] ||
   if busybox pidof conky >>/dev/null 2>&1; then
     su - $USER -c "killall conky" && su - $USER -c "conky &";
   else
     su - $USER -c "conky &";
   fi
-
 }
 
 pre_remove()
 {
-
 # Restore old ".conkyrc" backup.
-
   if [ -e $1/home/$USER/$BAK_DIR/$BAK_FILE/.conkyrc ]; then
     mv $1/home/$USER/$BAK_DIR/$BAK_FILE/.conkyrc $1/home/$USER
     chmod 777 $1/home/$USER/.conkyrc
     rm -rf $1/home/$USER/$BAK_DIR/$BAK_FILE
     rm -rf $1/home/$USER/$BAK_DIR/README
   else
-    echo "Empty! No backup files.";
+    rm -irf $1/home/$USER/.conkyrc
   fi
-
 }
 
 post_remove()
 {
-
 # Check the conky process and run old theme.
-
-  [ "$1" ] ||
+[ "$1" ] ||
   if busybox pidof conky >>/dev/null 2>&1; then
     su - $USER -c "killall conky" && su - $USER -c "conky &";
   else
     su - $USER -c "conky &";
   fi
-
 }