a convenience script - mostly oneshot though
authorthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Thu, 17 Jan 2008 10:41:53 +0000 (10:41 +0000)
committerthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Thu, 17 Jan 2008 10:41:53 +0000 (10:41 +0000)
scripts/trash-old-build.sh [new file with mode: 0755]

diff --git a/scripts/trash-old-build.sh b/scripts/trash-old-build.sh
new file mode 100755 (executable)
index 0000000..a485ea3
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# for old-fashioned builds (new scheme is more sensible to this respect)
+#
+# typical disk space
+# total                : 4.5 G
+# BUILD                : 3.2 G
+# CODEBASES    : 400 M
+# SOURCES      : 460 M
+# we keep only RPMS and SPRMS
+
+totrash="BUILD CODEBASES SOURCES tmp"
+
+for build in "$@" ; do
+    base=$(basename $build)
+    trashbase=/build/trash/$base
+    [ -d $trashbase ] || mkdir $trashbase
+    for dir in $totrash ; do
+       [ -d $build/$dir ] && mv $build/$dir $trashbase/$dir
+    done
+done
+