aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-12-09 15:40:20 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-12-09 15:40:20 +0000
commit3f1dec19a406d0bd63dc04c8cc39e6910ae26219 (patch)
tree37f8e7d059f2c8d919d40dcb2003c3692bc8dfa8
parentcbdee9b4551199d785005154ca85d63f00957670 (diff)
downloadsimplepkg-3f1dec19a406d0bd63dc04c8cc39e6910ae26219.tar.gz
simplepkg-3f1dec19a406d0bd63dc04c8cc39e6910ae26219.tar.bz2
simplaret: simplaret_purge fixes
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@52 04377dda-e619-0410-9926-eae83683ac58
-rwxr-xr-xsrc/simplaret9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/simplaret b/src/simplaret
index 776e1b4..ffc703d 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -55,6 +55,7 @@ function simplaret_eval_config {
PASSIVE_FTP="`simplaret_eval_parameter PASSIVE_FTP 0`"
WARNING="`simplaret_eval_parameter WARNING 0`"
ROOT_PRIORITY="`simplaret_eval_parameter ROOT_PRIORITY patches slackware extra testing pasture`"
+ SIMPLARET_PURGE_WEEKS="`simplaret_eval_parameter SIMPLARET_PURGE_WEEKS 0`"
}
@@ -309,6 +310,9 @@ function simplaret_purge {
if [ "$2" == "-w" ] && [ ! -z "$3" ]; then
mtime="-mtime +`echo "$3*7" | bc -l`"
mtime_message="older than $3 weeks"
+ elif [ "$SIMPLARET_PURGE_WEEKS" != "0" ]; then
+ mtime="-mtime +`echo "$SIMPLARET_PURGE_WEEKS*7" | bc -l`"
+ mtime_message="older than $SIMPLARET_PURGE_WEEKS weeks"
else
mtime=""
mtime_mesage=""
@@ -343,6 +347,7 @@ function simplaret_purge {
function simplaret_get {
+ # get the first matching package $1
# TODO: support to --get package-version-arch-build.tgz or just part of the name
# first search for an already downloaded package
@@ -385,7 +390,7 @@ function simplaret_get {
simplaret_download $repository_url $file $storage/$repository_name
if [ ! -f "$storage/$repository_name/$candidate" ]; then
echo error downloading $candidate from $repos_type repository $repository_url, please check your settings
- exit 1
+ return 1
else
echo package $candidate stored at $storage/$repository_name
simplaret_checksum $storage/$repository_name/CHECKSUMS.md5 $storage/$repository_name/$candidate
@@ -512,7 +517,7 @@ case $1 in
--search) simplaret_search $2 ;;
--get) simplaret_get $2 ;;
--get-patches) simplaret_get_patches ;;
- --purge) simplaret_purge ;;
+ --purge) shift ; simplaret_purge $* ;;
*) simplaret_usage ;;
esac