Author: ks156
Date: 2009-03-13 12:06:30 +0100 (Fri, 13 Mar 2009)
New Revision: 4050

Modified:
   
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/firmware_installer.sh
   
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/sound_installer.sh
   
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
   software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/installer.sh
   software_suite_v2/tuxware/tuxdroidserver/trunk/installer.sh
Log:
* Removed a print in tux_software_updater
* Improved the way to install the python API
* Made the installers more readable


Modified: 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/firmware_installer.sh
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/firmware_installer.sh
     2009-03-13 10:51:15 UTC (rev 4049)
+++ 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/firmware_installer.sh
     2009-03-13 11:06:30 UTC (rev 4050)
@@ -18,45 +18,43 @@
 #      REVISION:  ---
 
#===============================================================================
 mkdir $1
-echo "#!/bin/bash" >> $1/install.sh
-echo '[ -d $1 ] && [[ -d $1/uninstall ]] && /bin/bash $1/uninstall.sh $1' >> 
$1/install.sh 
-echo '[ -d $1 ] || mkdir -p $1' >> $1/install.sh
-cmd="cp -r $1/* "' $1'
-echo "$cmd" >> $1/install.sh
-echo '[ -d $2/bin ] || mkdir -p $2/bin' >> $1/install.sh
-echo 'cp tuxup $2/bin/tuxup' >> $1/install.sh
-echo 'chmod +x $2/bin/tuxup' >> $1/install.sh
-echo 'cp dfu-programmer $2/bin/dfu-programmer' >> $1/install.sh
-echo 'chmod +x $2/bin/dfu-programmer' >> $1/install.sh
+
+# Create the install file
+echo "#!/bin/bash
+[ -d \$1 ] && [[ -d \$1/uninstall ]] && /bin/bash \$1/uninstall.sh \$1
+[ -d \$1 ] || mkdir -p \$1
+cp -r $1/* \$1
+[ -d \$2/bin ] || mkdir -p \$2/bin
+cp tuxup \$2/bin/tuxup
+chmod +x \$2/bin/tuxup
+cp dfu-programmer \$2/bin/dfu-programmer
+chmod +x \$2/bin/dfu-programmer" >> $1/install.sh
+
+# Export the firmwares
 REPO=http://svn.tuxisalive.com/firmware/hex/tags/0.9.1
 svn export -q $REPO $1/$1
+
 cd $1/$1
-echo "#!/bin/bash" > uninstall.sh
-echo "" >> uninstall.sh
-echo '# Remove previously installed files' >> uninstall.sh
+
+# Create the uninstaller
+echo "" > uninstall.sh
+str=""
 for file in `find . -type f`; do
-    echo 'rm $1/'"$file" >> uninstall.sh
+    str="$str
+    rm \$1/$file"
 done
-echo "" >> uninstall.sh
-echo "# Find python compiled files " >> uninstall.sh
-echo 'for file in `find $1 -iname "*.pyc"`; do' >> uninstall.sh
-echo '    rm $1/$file' >> uninstall.sh
-echo 'done' >> uninstall.sh
-echo "" >> uninstall.sh
-echo '# Check for empty dirs' >> uninstall.sh
-echo 'find $1 -type d > flist' >> uninstall.sh
-echo 'tac flist |' >> uninstall.sh
-echo 'while read line; do' >> uninstall.sh
-echo '   if [ ! "$(ls -A $line)" ]; then' >> uninstall.sh
-echo '      rm -r $line' >> uninstall.sh
-echo '   fi' >> uninstall.sh
-echo 'done' >> uninstall.sh
-echo 'rm flist' >> uninstall.sh
-echo "" >> uninstall.sh
-echo "# Remove the root directory if it's empty" >> uninstall.sh
+echo "#!/bin/bash
+$str
+find \$1 -type d > flist
+tac flist | while read line; do
+    if [ ! \"\$(ls -A \$line)\" ]; then
+        rm -r \$line
+    fi
+done
+rm flist" >> uninstall.sh
+
 cd - >/dev/null
-rev=`svn info $REPO |grep "Last Changed Rev"`
-rev=${rev##* }
+
 # Pack dfu-programmer
 wget \
 
http://kent.dl.sourceforge.net/sourceforge/dfu-programmer/dfu-programmer-0.5.1.tar.gz
 -O /tmp/dfu.tar.gz
@@ -68,6 +66,7 @@
 cp $pwd/src/dfu-programmer $1
 rm -rf /tmp/dfu*
 
+# Pack tuxup
 svn export -q \
 http://svn.tuxisalive.com/firmware/tuxup/unix/trunk tuxup
 cd tuxup
@@ -75,6 +74,10 @@
 cp tuxup ../$1
 cd -
 rm -r tuxup
+
+# Create tarball
+rev=`svn info $REPO |grep "Last Changed Rev"`
+rev=${rev##* }
 tar -czf $1.tar.gz $1
 mv $1.tar.gz $1-$rev.tar.gz
 rm -r $1

Modified: 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/sound_installer.sh
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/sound_installer.sh
        2009-03-13 10:51:15 UTC (rev 4049)
+++ 
software_suite_v2/tuxware/installers/unix/branches/refactoring/installers/sound_installer.sh
        2009-03-13 11:06:30 UTC (rev 4050)
@@ -18,34 +18,39 @@
 #      REVISION:  ---
 
#===============================================================================
 mkdir $1
-echo "#!/bin/bash" >> $1/install.sh
-echo '[ -d $1 ] && [[ -d $1/uninstall ]] && /bin/bash $1/uninstall.sh $1' >> 
$1/install.sh 
-echo '[ -d $1 ] || mkdir -p $1' >> $1/install.sh
-cmd="cp -r $1/* "' $1'
-echo "$cmd" >> $1/install.sh
+
+# Create the install file
+echo "#!/bin/bash
+[ -d \$1 ] && [[ -d \$1/uninstall ]] && /bin/bash \$1/uninstall.sh \$1
+[ -d \$1 ] || mkdir -p \$1
+cp -r $1/* \$1" >> $1/install.sh
+
+# Export the sounds
 REPO=http://svn.tuxisalive.com/software_suite_v1/software/tuxgi/trunk/sounds/
 svn export -q $REPO $1/$1
+
 cd $1/$1
 chmod +x *
-echo "#!/bin/bash" > uninstall.sh
-echo "" >> uninstall.sh
-echo '# Remove previously installed files' >> uninstall.sh
+
+# Create the uninstaller
+echo "" > uninstall.sh
+str=""
 for file in `find . -type f`; do
-    echo 'rm $1/'"$file" >> uninstall.sh
+    str="$str
+    rm \$1/$file"
 done
-echo "" >> uninstall.sh
-echo '# Check for empty dirs' >> uninstall.sh
-echo 'find $1 -type d > flist' >> uninstall.sh
-echo 'tac flist |' >> uninstall.sh
-echo 'while read line; do' >> uninstall.sh
-echo '   if [ ! "$(ls -A $line)" ]; then' >> uninstall.sh
-echo '      rm -r $line' >> uninstall.sh
-echo '   fi' >> uninstall.sh
-echo 'done' >> uninstall.sh
-echo 'rm flist' >> uninstall.sh
-echo "" >> uninstall.sh
-echo "# Remove the root directory if it's empty" >> uninstall.sh
+echo "#!/bin/bash
+$str
+find \$1 -type d > flist
+tac flist | while read line; do
+    if [ ! \"\$(ls -A \$line)\" ]; then
+        rm -r \$line
+    fi
+done
+rm flist" >> uninstall.sh
+
 cd - >/dev/null
+# Create tarball
 rev=`svn info $REPO |grep "Last Changed Rev"`
 rev=${rev##* }
 tar -czf $1.tar.gz $1

Modified: 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
     2009-03-13 10:51:15 UTC (rev 4049)
+++ 
software_suite_v2/tuxware/installers/unix/branches/refactoring/software_updater/tux_software_updater.py
     2009-03-13 11:06:30 UTC (rev 4050)
@@ -136,7 +136,6 @@
                     % (MIRROR + dest, MIRROR + PREFIX, dest)
                     # Mirror destination, Mirror prefix, Target destination
             cmd = cmd + "rm -rf /tmp/tuxdroid_upd/"
-            print cmd
             os.system(cmd)
     print ''
     writeDb(data)

Modified: software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/installer.sh
===================================================================
--- software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/installer.sh      
2009-03-13 10:51:15 UTC (rev 4049)
+++ software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/installer.sh      
2009-03-13 11:06:30 UTC (rev 4050)
@@ -19,25 +19,27 @@
 
#===============================================================================
 # Create build dir
 mkdir $1
+
 # Create the install script
-echo "#!/bin/bash" >> $1/install.sh
-echo "cd $1" >> $1/install.sh
-echo "python setup.py install >/dev/null" >> $1/install.sh
-echo "cd - > /dev/null" >> $1/install.sh
-echo 'mkdir -p $1' >> $1/install.sh
-echo "cp $1/tuxisalive/api/sh.py "'$1/sh.py' >> \
-$1/install.sh
-echo '[ -d $2/bin ] || mkdir -p $2/bin' >> $1/install.sh
-echo 'echo "#!/bin/bash" > $2/bin/tuxsh' >> $1/install.sh
-echo 'echo python -i $3/sh.py >> $2/bin/tuxsh' >> \
-$1/install.sh
-echo 'chmod +x $2/bin/tuxsh' >> $1/install.sh
-echo "rm -r $1" >> $1/install.sh
+echo "#!/bin/bash
+[ -d \$2/lib/tuxdroid/$1 ] && rm -rf \$2/lib/tuxdroid/$1
+[ -d \$2/lib/tuxdroid/ ] || mkdir -p \$2/lib/tuxdroid
+cp -r $1 \$2/lib/tuxdroid/
+cd \$2/lib/tuxdroid/$1
+python setup.py install > /dev/null
+cd - > /dev/null
+[ -d \$1 ] || mkdir -p \$1
+cp $1/tuxisalive/api/sh.py \$1/sh.py
+[ -d \$2/bin ] || mkdir -p \$2/bin
+echo \"#!/bin/bash\" > \$2/bin/tuxsh
+echo \"python -i \$3/sh.py\" >> \$2/bin/tuxsh
+chmod +x \$2/bin/tuxsh" >> $1/install.sh
+
 # Export the project
 svn export -q "$(svn info |grep URL |sed 's/URL: //g')" $1/$1
+
 # Create tarball
 rev=`svn info |grep "Last Changed Rev"`
 rev=${rev##* }
 tar -czf $1-$rev.tar.gz $1
-# Clean
 rm -r $1

Modified: software_suite_v2/tuxware/tuxdroidserver/trunk/installer.sh
===================================================================
--- software_suite_v2/tuxware/tuxdroidserver/trunk/installer.sh 2009-03-13 
10:51:15 UTC (rev 4049)
+++ software_suite_v2/tuxware/tuxdroidserver/trunk/installer.sh 2009-03-13 
11:06:30 UTC (rev 4050)
@@ -19,92 +19,88 @@
 
#===============================================================================
 # Create build dir
 mkdir $1
-# Create the install script
-echo "#!/bin/bash" >> $1/install.sh
-echo '[ -d $1 ] && [[ -d $1/uninstall ]] && /bin/bash $1/uninstall.sh $1' >> 
$1/install.sh 
-echo '[ -d $1 ] || mkdir -p $1' >> $1/install.sh
-cmd="cp -r $1_/* "'$1'
-echo "$cmd" >> $1/install.sh
-echo '[ -d $2/bin ] || mkdir -p $2/bin' >> $1/install.sh
-echo '[ -f /etc/init.d/tuxhttpserver ] && cp tuxhttpserver \
-/etc/init.d/tuxhttpserver && chmod +x /etc/init.d/tuxhttpserver' >> 
$1/install.sh
-echo '[ -f /etc/rc.d/tuxhttpserver ] && cp tuxhttpserver \
-/etc/rc.d/tuxhttpserver && chmod +x /etc/rc.d/tuxhttpserver' >> $1/install.sh
-echo '[ -d /usr/bin/tuxhttpserver ] && rm /usr/bin/tuxhttpserver' >> \
-$1/install.sh
-echo 'echo "#!/bin/bash" > $2/bin/tuxhttpserver' >> $1/install.sh
-echo 'echo python "$3"/tuxhttpserver.py "\$*" >> $2/bin/tuxhttpserver' >> 
$1/install.sh
-echo 'chmod +x $2/bin/tuxhttpserver' >> $1/install.sh
-# Export the project
-svn export -q "$(svn info |grep URL |sed 's/URL: //g')" $1/$1_
-cd $1/$1_
+
+# Create the install file
+echo "#!/bin/bash
+[ -d \$1 ] && [[ -d \$1/uninstall ]] && /bin/bash \$1/uninstall.sh \$1
+[ -d \$1 ] || mkdir -p \$1
+cp -r $1/* \$1
+[ -d \$2/bin ] || mkdir -p \$2/bin
+[ -d \$2/bin/tuxhttpserver ] && rm \$2/bin/tuxhttpserver
+echo \"#!/bin/bash\" > \$2/bin/tuxhttpserver
+echo \"python \$3/tuxhttpserver.py \\\$*\" >> \$2/bin/tuxhttpserver
+chmod +x \$2/bin/tuxhttpserver" >> $1/install.sh
+
+# Export the server 
+svn export -q "$(svn info |grep URL |sed 's/URL: //g')" $1/$1
+
+cd $1/$1
+
 # Create the uninstall script
-echo "#!/bin/bash" > uninstall.sh
-echo "" >> uninstall.sh
-echo '# Remove previously installed files' >> uninstall.sh
+echo "" > uninstall.sh
+str=""
 for file in `find . -type f`; do
-    echo rm $file >> uninstall.sh
+    str="$str
+    rm \$1/$file"
 done
-echo "" >> uninstall.sh
-echo "# Find python compiled files " >> uninstall.sh
-echo 'for file in `find $1 -iname "*.pyc"`; do' >> uninstall.sh
-echo '    rm $file' >> uninstall.sh
-echo 'done' >> uninstall.sh
-echo "" >> uninstall.sh
-echo '# Check for empty dirs' >> uninstall.sh
-echo "find . -type d > flist" >> uninstall.sh
-echo 'tac flist |' >> uninstall.sh
-echo 'while read line; do' >> uninstall.sh
-echo '   if [ ! "$(ls -A $line)" ]; then' >> uninstall.sh
-echo '      rm -r $line' >> uninstall.sh
-echo '   fi' >> uninstall.sh
-echo 'done' >> uninstall.sh
-echo 'rm flist' >> uninstall.sh
-echo "" >> uninstall.sh
+echo "#!/bin/bash
+$str
+for file in \`find \$1 -iname '*.pyc'\`; do
+    rm \$file
+done 
+find \$1 -type d > flist
+tac flist | while read line; do
+    if [ ! \"\$(ls -A \$line)\" ]; then
+        rm -r \$line
+    fi
+done
+rm flist" >> uninstall.sh
+
 cd - >/dev/null
+
 # Create init script
-echo '#!/bin/bash' > $1/tuxhttpserver
-echo 'PATH=/usr/sbin:/usr/bin:/sbin:/bin' >> $1/tuxhttpserver
-echo 'DESC="HTTP server for Tuxdroid"' >> $1/tuxhttpserver
-echo 'NAME=tuxhttpserver' >> $1/tuxhttpserver
-echo 'DAEMON=tuxhttpserver' >> $1/tuxhttpserver
-echo 'case "$1" in' >> $1/tuxhttpserver
-echo '    start)' >> $1/tuxhttpserver
-echo '        echo Starting $DESC' >> $1/tuxhttpserver
-echo '            $DAEMON --start' >> $1/tuxhttpserver
-echo '            if [ $? -gt 0 ]; then' >> $1/tuxhttpserver
-echo '                echo Failed to start $NAME' >> $1/tuxhttpserver
-echo '            fi' >> $1/tuxhttpserver
-echo '    ;;' >> $1/tuxhttpserver
-echo '    stop)' >> $1/tuxhttpserver
-echo '        echo "Stopping $DESC"' >> $1/tuxhttpserver
-echo '            $DAEMON --stop' >> $1/tuxhttpserver
-echo '            if [ $? -gt 0 ]; then' >> $1/tuxhttpserver
-echo '                 echo Failed to stop $NAME' >> $1/tuxhttpserver
-echo '            fi' >> $1/tuxhttpserver
-echo '    ;;' >> $1/tuxhttpserver
-echo '    restart|force-reload)' >> $1/tuxhttpserver
-echo '        $0 stop' >> $1/tuxhttpserver
-echo '        sleep 7 # Time needed to restart properly the server' >> \
-$1/tuxhttpserver
-echo '        $0 start' >> $1/tuxhttpserver
-echo '    ;;' >> $1/tuxhttpserver
-echo 'esac' >> $1/tuxhttpserver
-echo 'exit 0' >> $1/tuxhttpserver
+#echo '#!/bin/bash' > $1/tuxhttpserver
+#echo 'PATH=/usr/sbin:/usr/bin:/sbin:/bin' >> $1/tuxhttpserver
+#echo 'DESC="HTTP server for Tuxdroid"' >> $1/tuxhttpserver
+#echo 'NAME=tuxhttpserver' >> $1/tuxhttpserver
+#echo 'DAEMON=tuxhttpserver' >> $1/tuxhttpserver
+#echo 'case "$1" in' >> $1/tuxhttpserver
+#echo '    start)' >> $1/tuxhttpserver
+#echo '        echo Starting $DESC' >> $1/tuxhttpserver
+#echo '            $DAEMON --start' >> $1/tuxhttpserver
+#echo '            if [ $? -gt 0 ]; then' >> $1/tuxhttpserver
+#echo '                echo Failed to start $NAME' >> $1/tuxhttpserver
+#echo '            fi' >> $1/tuxhttpserver
+#echo '    ;;' >> $1/tuxhttpserver
+#echo '    stop)' >> $1/tuxhttpserver
+#echo '        echo "Stopping $DESC"' >> $1/tuxhttpserver
+#echo '            $DAEMON --stop' >> $1/tuxhttpserver
+#echo '            if [ $? -gt 0 ]; then' >> $1/tuxhttpserver
+#echo '                 echo Failed to stop $NAME' >> $1/tuxhttpserver
+#echo '            fi' >> $1/tuxhttpserver
+#echo '    ;;' >> $1/tuxhttpserver
+#echo '    restart|force-reload)' >> $1/tuxhttpserver
+#echo '        $0 stop' >> $1/tuxhttpserver
+#echo '        sleep 7 # Time needed to restart properly the server' >> \
+#$1/tuxhttpserver
+#echo '        $0 start' >> $1/tuxhttpserver
+#echo '    ;;' >> $1/tuxhttpserver
+#echo 'esac' >> $1/tuxhttpserver
+#echo 'exit 0' >> $1/tuxhttpserver
+
 # Compile the driver
 svn co -q \
 http://svn.tuxisalive.com/software_suite_v2/tuxware/tuxdriver/trunk/ \
 /tmp/tuxdriver
 cd /tmp/tuxdriver/unix && make >/dev/null
 cd - >/dev/null
-driver=`find $1/$1_ -name "libtuxdriver.so"`
+driver=`find $1/$1 -name "libtuxdriver.so"`
 cp /tmp/tuxdriver/unix/libtuxdriver.so $driver
 rm -rf /tmp/tuxdriver
-# 
+
 # Create tarball
 rev=`svn info |grep "Last Changed Rev"`
 rev=${rev##* }
 tar -czf $1.tar.gz $1
 mv $1.tar.gz $1-$rev.tar.gz
-# Clean
 rm -r $1


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to