aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/simplaret
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-09 15:54:19 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-09 15:54:19 +0000
commit87babaf85a109126a86ef1de539ebd3525d8b28d (patch)
treea24c9c8df23fd7369e69ed59e005aa19348cc825 /trunk/src/simplaret
parent921803921ee524645a5593424340195b310f16b3 (diff)
downloadsimplepkg-87babaf85a109126a86ef1de539ebd3525d8b28d.tar.gz
simplepkg-87babaf85a109126a86ef1de539ebd3525d8b28d.tar.bz2
simplaret: new var SIMPLARET_DOWNLOAD_FROM_NEXT_REPO
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@326 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src/simplaret')
-rwxr-xr-xtrunk/src/simplaret21
1 files changed, 15 insertions, 6 deletions
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index 374c988..719063c 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -489,7 +489,7 @@ function simplaret_get {
# get a package
# usage: simplaret_get <package-name> [--silent]
- local silent generate_patches
+ local silent generate_patches search search_results
# prevent user to stay in $storage
cd
@@ -507,7 +507,13 @@ function simplaret_get {
done
# then search for the package in the repositories
- for result in `simplaret_search $1 --formatted`; do
+ search="`simplaret_search $1 --formatted`"
+ search_results="`echo $search | bc -l`"
+
+ for result in $search; do
+
+ # remaining search results
+ let search_results--
file="`echo $result | cut -d , -f 1`"
repos_type="`echo $result | cut -d , -f 2`"
@@ -558,11 +564,14 @@ function simplaret_get {
if [ "$2" != "--silent" ]; then
echo Error downloading $candidate from $repos_type repository $repository_url, please check your settings
fi
- # TODO: must check if there's also more repositories to try,
- # otherwise this function will never return an error code
- #if [ "$SIMPLARET_DOWNLOAD_FROM_NEXT_REPO" != "1" ]; then
+ # check if there's also more repositories to try
+ if [ "$SIMPLARET_DOWNLOAD_FROM_NEXT_REPO" != "1" ]; then
return 1
- #fi
+ else
+ if (($search_results <= 0)); then
+ return 1
+ fi
+ fi
else
LAST_DOWNLOADED_PACKAGE="$folder/$candidate"
if [ "$2" != "--silent" ]; then