Suport for RemovePrograms to remove detached programs.

I'm using `Get_Dir` to get the real install path, i don't know if this
function is depecrated.

PATCH:

--- /Depot/Users/eof/srcs/GoboCVS/tools/Scripts/bin/RemoveProgram
2007-03-30 10:48:51.000000000 +0200
+++ /Programs/Scripts/CVS/bin/RemoveProgram     2007-04-02
21:20:26.000000000 +0200 @@ -5,6 +5,7 @@ source ScriptFunctions
 Import GoboLinux 
 Import OptionParser
+Import Directories
 
 
 ### Options
################################################################### @@
-30,6 +31,12 @@ program=`GuessProgramCase ${appname} ${appver}`
 version=${appver}
 
+# Support to remove detached programs (Aitor)
+# Should be "Get_Dir" call be replaced by $goboInstall?
+programdir=${goboPrograms}/${program}/${version}
+installdir=`Get_Dir install "$program" "$version"`
+[ -z $installdir ] && installdir=$programdir
+
 if [ ! -d ${goboPrograms}/${program}/${version} ]
 then
    Die "${program} ${version} not found at ${goboPrograms}"
@@ -38,18 +45,23 @@
 Log_Terse "Removing $program, version $version."
                                
 Log_Verbose "Getting program file list..."
-filesdir=$(Get_System_Paths "${goboPrograms}/${program}/${version}")
+filesdir=$(Get_System_Paths "$installdir")
                                
-Log_Normal "Removing ${goboPrograms}/${program}/${version}..."
-if [ -f ./Resources/UnmanagedFiles ] && ! Is_Entry "unmanaged" "keep"
+Log_Normal "Removing $installdir..."
+if [ -f $installdir/Resources/UnmanagedFiles ] && ! Is_Entry
"unmanaged" "keep" then                           
-   { Is_Entry "unmanaged" "ask" && ! Ask "There are unmanaged files
present. Do you want to remove them?"; } || Uninstall_Unmanaged_Files
"${goboPrograms}/$program/$version/Resources/UnmanagedFiles" 
+   { Is_Entry "unmanaged" "ask" && ! Ask "There are unmanaged files
present. Do you want to remove them?"; } || Uninstall_Unmanaged_Files
"$installdir/Resources/UnmanagedFiles" fi -rm -rf --
${goboPrograms}/${program}/${version} +rm -rf -- $installdir          
+[ $installdir != $programdir ] && {
+       Log_Normal "Removing $programdir..."
+       rm -rf -- $programdir   
+}                              

 # TODO relink current?
 Quiet RemoveBroken "${goboPrograms}/${program}/Current"
 Quiet rmdir ${goboPrograms}/${program}
+Quiet rmdir `Get_Dir "install" '$program' ''`
 
 Log_Normal "Removing broken links..."
 RemoveBroken $filesdir

---- END

Greets,

Aitor.

-- 
... Bardulia quae nunc vocatur Castella ...

_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel

Reply via email to