[gobolinux-users] MultipleVersions and suggestion: RemoveProgram two-step

mjr at dsl.pipex.com mjr at dsl.pipex.com
Wed Jan 5 04:07:20 GMT 2005

I've posted a script which suggests non-current versions to remove at
http://mjr.towers.org.uk/comp/SuggestDuplicates - I needed to free
disk space after using SuggestUpdates today.

I like to have a chance to abort the RemoveProgram *after* I see what
links will be broken. Here's one possible implementation:

--- /Programs/Scripts/2.1.19/bin/RemoveProgram  2004-12-07 20:14:45.000000000 +0000
+++ ./RemoveProgram     2005-01-05 02:48:47.000000000 +0000
@@ -43,8 +43,6 @@
    Die "${program} ${version} not found at ${goboPrograms}"

-Boolean "batch" || Ask_Continue "Removing $program, version $version."
 Log_Verbose "Getting program file list..."
 cd ${goboPrograms}/${program}/${version}
@@ -57,8 +55,8 @@
 GrepReplace "./info/"    "./Manuals/info/" $filesdir
 GrepReplace "./Resources/Wrappers/" "./Executables/"  $filesdir

-Log_Normal "Removing ${goboPrograms}/${program}/${version}..."
-rm -rf ${goboPrograms}/${program}/${version}
+Log_Normal "Moving ${goboPrograms}/${program}/${version} in preparation..."
+mv ${goboPrograms}/${program}/${version} ${goboPrograms}/${program}/${version}-removed

 # TODO relink current?
 Quiet RemoveBroken "${goboPrograms}/${program}/Current"
@@ -68,5 +66,11 @@
 cd ${goboLinks}
 cat $filesdir | RemoveBroken
 rm $filesdir
+Boolean "batch" || Ask_Continue "Really remove $program, version $version?"
+Log_Normal "Removing ${goboPrograms}/${program}/${version}..."
+rm -rf ${goboPrograms}/${program}/${version}-removed
 Log_Normal "${program} ${version} removed."

More information about the gobolinux-users mailing list