#
# repository definitions for simplaret
+# please dont use any spaces inside a repository definition
#
# root repositories
# x86_64 10.2b
REPOS-x86_64-10.2b="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2b/"
-PATCHES-x86_64-10.2b=""sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2b/patches/"
+PATCHES-x86_64-10.2b="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2b/patches/"
# i386 11.0
REPOS-i386-11.0="sarava%http://slack.sarava.org/packages/slackware/slackware-11.0/"
TEMPLATE_BASE="$TEMPLATE_FOLDER/$1"
elif [ -f "$TEMPLATE_FOLDER/$1/$1.template" ]; then
TEMPLATE_BASE="$TEMPLATE_FOLDER/$1/$1"
- elif [ -f "$BASE_CONF/defaults/templates/$1/$1.template" ]; then
+ elif [ -f "$BASE_CONF/defaults/templates/$1/$1.template" ] && \
+ [ "$2" != "--update" ]; then
TEMPLATE_BASE="$BASE_CONF/defaults/templates/$1/$1"
else
if [ "$2" == "--new" ]; then
# 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
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`"
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