aboutsummaryrefslogtreecommitdiffstats
path: root/kerl
diff options
context:
space:
mode:
authorMichael S. Klishin <[email protected]>2012-07-21 10:40:30 +0400
committerMichael S. Klishin <[email protected]>2012-07-21 10:40:30 +0400
commit07767e0ca1289f271a5d9de85433b712f4096b67 (patch)
tree60b77766b3dff6c72517040febfdff70b2f3df37 /kerl
parent90db4b08efb141c9f129a006f07722d21079b564 (diff)
downloadkerl-07767e0ca1289f271a5d9de85433b712f4096b67.tar.gz
kerl-07767e0ca1289f271a5d9de85433b712f4096b67.tar.bz2
kerl-07767e0ca1289f271a5d9de85433b712f4096b67.zip
Add a command that cleans up downloaded archives and build artifacts
Diffstat (limited to 'kerl')
-rwxr-xr-xkerl26
1 files changed, 25 insertions, 1 deletions
diff --git a/kerl b/kerl
index d20025c..c4485e4 100755
--- a/kerl
+++ b/kerl
@@ -111,6 +111,7 @@ usage()
echo " active Print the path of the active installation"
echo " status Print available builds and installations"
echo " prompt Print a string suitable for insertion in prompt"
+ echo " cleanup Remove compilation artifacts (use after installation)"
exit 1
}
@@ -628,6 +629,11 @@ delete_usage()
echo "usage: $0 delete <build|installation> <build_name or path>"
}
+cleanup_usage()
+{
+ echo "usage: $0 cleanup <build_name|all>"
+}
+
update_usage()
{
echo "usage: $0 $1 <releases|agner>"
@@ -847,8 +853,26 @@ case "$1" in
fi
exit 0
;;
+ cleanup)
+ if [ $# -ne 2 ]; then
+ cleanup_usage
+ exit 1
+ fi
+ case "$2" in
+ all)
+ echo "Cleaning up compilation products for ALL builds"
+ rm -rf $KERL_BUILD_DIR/*
+ rm -rf $KERL_DOWNLOAD_DIR/*
+ echo "Cleaned up all compilation products under $KERL_BUILD_DIR"
+ ;;
+ *)
+ echo "Cleaning up compilation products for $3"
+ rm -rf $KERL_BUILD_DIR/$3
+ echo "Cleaned up all compilation products under $KERL_BUILD_DIR"
+ ;;
+ esac
+ ;;
*)
echo "unkwnown command: $1"; usage; exit 1
;;
esac
-