remasterpup2

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

remasterpup2

Karl Godt
Administrator
some functions to make managing of /tmp/root and /tmp/etc easier for me :

+__emerg_exit()
+{
+local RV
+RV=$1
+if test "${RV//[[:digit:]]/}"; then
+echo "Usage: __emerg_exit EXITCODE \"MESSAGE\""
+RV=9
+else
+shift
+fi
+echo "$*"
+exit $RV
+}
+
+_open_rox_window()
+{
+pidof ROX-Filer >/dev/null || return
+rox "$1"
+}
+
+__sure()
+{
+local RV
+#--yesno	<text> <height> <width>
+Xdialog --title "$m_01" --yesno	"$(gettext "Are You Sure ?
+Click 'Yes' to proceed with $0 program.
+Click 'No' to wait.
+Click 'Cancel' icon in window titlebar to quit $0
+")" 0 0
+RV=$?
+case $RV in
+0) return 0;;
+1) return 1;;
+255) exit 0;;
+*) echo "$(gettext 'Unhandled Xdialog return code '$RV'')" >&2; return 1;;
+esac
+}
+
+_sure()
+{
+local SURE
+SURE=1
+while test "$SURE" != 0; do
+__sure
+SURE=$?
+done
+}
 

use a DISTRO_NAME-DISTRO_VERSION build directory name :
+buildDIR="puppylivecd-${DISTRO_NAME}-${DISTRO_VERSION}-build.d"
+echo "'$buildDIR'"
+buildDIR=`echo "$buildDIR" | tr '[:blank:]' '_' | sed 's/\./XxX/g;s/-/xXx/g'`
+echo "'$buildDIR'"
+buildDIR=`echo "$buildDIR" | sed 's/_/YyY/g'`
+echo "'$buildDIR'"
+if test "`echo "$buildDIR" | grep -E '[[:blank:]]|[[:punct:]]'`"; then
+buildDIR=puppylivecdbuild
+else
+buildDIR=`echo "$buildDIR" | sed 's/XxX/\./g;s/xXx/-/g;s/YyY/_/g'`
+fi
+echo "'$buildDIR'"
+

use loop to cp files from /root from a LIST and diff these files,
add .Xdefaults and .Xresources to LIST
+
+rootfiles_cpLIST='
+.pmountauto
+.pmountengine
+.pmountquit
+.pmountsingle
+.jwm/jwmrc-theme
+.jwm/jwmrc-personal2
+.jwm/jwm_colors
+.gtkrc-2.0
+.xset.sh
+.xinitrc
+.Xdefaults
+.Xresources
+.config/rox.sourceforge.net/ROX-Filer/Options
+.config/rox.sourceforge.net/ROX-Filer/globicons
+Choices/ROX-Filer/globicons
+Choices/ROX-Filer/PuppyPin
+.icewm/menu
+.fvwm95rc
+.jwmrc-tray
+.jwmrc
+'
+
+while read oneFILE
+do
+test "$oneFILE" || continue
+fileDIR=${oneFILE%/*}
+fileBAS=${oneFILE##*/}
+test -d /tmp/root/"$fileDIR" || { mkdir -p /tmp/root/"$fileDIR" || continue; }
+diff -qs /root/"$oneFILE" /tmp/root/"$oneFILE" && continue
+cp -af /root/"$oneFILE" /tmp/root/"$oneFILE" || continue ## or break ? :)
+done<<EoI
+`echo "$rootfiles_cpLIST"`
+EoI
+
+#v411 tidy up, remove desktop drive icons...
+_fix_puppypin(){
+grep -v '/root/.pup_event/drive_' /tmp/root/Choices/ROX-Filer/PuppyPin > /tmp/remaster-PuppyPin
+test $? = 0 || return 9
+test -s /tmp/remaster-PuppyPin || return 9
+grep -q '</pinboard>' /tmp/remaster-PuppyPin || return 9
+mv -f /tmp/remaster-PuppyPin /tmp/root/Choices/ROX-Filer/PuppyPin
+return $?
+}
+_fix_puppypin
+RV=$?
+test $RV = 0 || {
+test $RV != 9 && cp -af /root/Choices/ROX-Filer/PuppyPin /tmp/root/Choices/ROX-Filer/PuppyPin; }
 
same with /etc ?

open rox window in /root and /tmp/root
+_open_rox_window "/root"
+_open_rox_window "/tmp/root/"
+
give some useful info in message_19
$(gettext '(if you think that this program has missed out something important that  should be burnt into /root on the CD, please let me know -- Barry Kauler)')
 
+$(gettext 'files that are new are mainly window/desktop manager,')
+$(gettext 'X and ppm configuration files')
ask for confirmation to go on using _sure function ( in case have forgotten something ( as usual) )
 $(eval_gettext "After examining /tmp/root, click 'Ok' to add /root in \${PUPPYSFS} file...")"
 Xdialog --wrap --left --title "$m_01" --msgbox "$m_19" 0 80
+_sure

Anyone interested ?

Loading...