aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--trunk/conf/simplepkg.conf.new6
-rw-r--r--trunk/doc/CHANGELOG10
-rw-r--r--trunk/lib/common.sh2
-rwxr-xr-xtrunk/simplepkg.SlackBuild2
-rwxr-xr-xtrunk/src/lspkg21
-rwxr-xr-xtrunk/src/simplaret23
6 files changed, 52 insertions, 12 deletions
diff --git a/trunk/conf/simplepkg.conf.new b/trunk/conf/simplepkg.conf.new
index d524659..6a3c687 100644
--- a/trunk/conf/simplepkg.conf.new
+++ b/trunk/conf/simplepkg.conf.new
@@ -29,6 +29,9 @@ SIMPLARET_DELETE_DOWN="1"
# to enable it, set to "1" or "yes"
SIMPLARET_UPDATE="1"
+# Wheter try to download from the next repository on failed download.
+SIMPLARET_DOWNLOAD_FROM_NEXT_REPO="1"
+
# Wheter delete also patches when simplaret --purge is called;
# to enable it, set to "1" or "yes"
SIMPLARET_PURGE_PATCHES="0"
@@ -64,6 +67,9 @@ CONNECT_TIMEOUT="20"
# ROOT repository package priority
ROOT_PRIORITY="patches slackware extra testing pasture"
+# REPOS repository package priority
+REPOS_PRIORITY="patches slackware extra testing pasture"
+
# Whether to check package signatures (you should have the repository
# maintainer key on your keyring)
SIGNATURE_CHECKING="0"
diff --git a/trunk/doc/CHANGELOG b/trunk/doc/CHANGELOG
index 5295fdc..afc190a 100644
--- a/trunk/doc/CHANGELOG
+++ b/trunk/doc/CHANGELOG
@@ -1,6 +1,16 @@
simplepkg changelog
===================
+0.5pre14
+========
+
+ - simplaret
+ - added variable REPOS_PRIORITY
+ - added variable SIMPLARET_DOWNLOAD_FROM_NEXT_REPO
+
+ - lspkg:
+ - small bugfix
+
0.5pre9 - 0.5pre13
==================
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh
index cae5db5..2680cff 100644
--- a/trunk/lib/common.sh
+++ b/trunk/lib/common.sh
@@ -209,6 +209,7 @@ function eval_config {
JAIL_ROOT="`eval_parameter JAIL_ROOT /vservers`"
PATCHES_DIR="`eval_parameter PATCHES_DIR /var/simplaret/patches`"
ROOT_PRIORITY="`eval_parameter ROOT_PRIORITY patches slackware extra testing pasture`"
+ REPOS_PRIORITY="`eval_parameter REPOS_PRIORITY patches slackware extra testing pasture`"
SIMPLARET_PURGE_WEEKS="`eval_parameter SIMPLARET_PURGE_WEEKS 0`"
FTP_TOOL="`eval_parameter FTP_TOOL curl`"
HTTP_TOOL="`eval_parameter HTTP_TOOL curl`"
@@ -221,6 +222,7 @@ function eval_config {
SIMPLARET_UPDATE="`eval_boolean_parameter SIMPLARET_UPDATE 0`"
SIMPLARET_DELETE_DURING="`eval_boolean_parameter SIMPLARET_DELETE_DURING 0`"
SIMPLARET_PURGE_PATCHES="`eval_boolean_parameter SIMPLARET_PURGE_PATCHES 0`"
+ SIMPLARET_DOWNLOAD_FROM_NEXT_REPO="`eval_boolean_parameter SIMPLARET_DOWNLOAD_FROM_NEXT_REPO 1`"
PASSIVE_FTP="`eval_boolean_parameter PASSIVE_FTP 0`"
WARNING="`eval_boolean_parameter WARNING 0`"
SIGNATURE_CHECKING="`eval_boolean_parameter SIGNATURE_CHECKING 0`"
diff --git a/trunk/simplepkg.SlackBuild b/trunk/simplepkg.SlackBuild
index 827f12c..d56d2c5 100755
--- a/trunk/simplepkg.SlackBuild
+++ b/trunk/simplepkg.SlackBuild
@@ -6,7 +6,7 @@
PACKAGE="simplepkg"
PACK_DIR="package-$PACKAGE"
BUILD=${BUILD:=1rha}
-VERSION="0.5pre13"
+VERSION="0.5pre14"
ARCH="noarch"
LIBEXEC="/usr/libexec/$PACKAGE"
BINDIR="/usr/bin"
diff --git a/trunk/src/lspkg b/trunk/src/lspkg
index c60de49..167b547 100755
--- a/trunk/src/lspkg
+++ b/trunk/src/lspkg
@@ -17,6 +17,15 @@
# Place - Suite 330, Boston, MA 02111-1307, USA
#
+COMMON="/usr/libexec/simplepkg/common.sh"
+
+if [ -f "$COMMON" ]; then
+ source $COMMON
+else
+ echo "error: file $COMMON not found, check your `basename $0` installation"
+ exit 1
+fi
+
function head_line {
echo "usage: [ROOT=/otherroot] `basename $0` [option expression]"
}
@@ -37,14 +46,6 @@ options are:
# -----------------------------------------------------
# lspkg
# -----------------------------------------------------
-COMMON="/usr/libexec/simplepkg/common.sh"
-
-if [ -f "$COMMON" ]; then
- source $COMMON
-else
- echo "error: file $COMMON not found, check your `basename $0` installation"
- exit 1
-fi
if [ $# -eq 2 ]; then
LIST_PKGS="`ls /$ROOT/var/log/packages/$2-[0-9]* 2> /dev/null`"
@@ -116,7 +117,9 @@ case $1 in
;;
*)
if [ ! -z "$LIST_PKGS" ]; then
- echo "$LIST_PKGS"
+ for pack in $LIST_PKGS; do
+ echo $pack
+ done
else
if [ ! -z "$ROOT" ]; then
echo "$1: package not found on /$ROOT/var/log/packages"
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index cbb6cb7..374c988 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -367,6 +367,21 @@ function simplaret_search {
for file in `simplaret_find_package $pattern $storage/$repository_name | egrep -v $priority_match`; do
simplaret_show_package $file $mode
done
+ priority_match=""
+ elif [ "$repos_type" == "repos" ]; then
+ # repos repositories has REPOS_PRIORITY
+ for priority in $REPOS_PRIORITY; do
+ for file in `simplaret_find_package $pattern $storage/$repository_name | grep "/$priority/"`; do
+ simplaret_show_package $file $mode
+ done
+ priority_match="$priority_match|/$priority/"
+ done
+ # now we should return all matches that are not part of REPOS_PRIORITY
+ priority_match="`echo $priority_match | sed -e 's/^|//'`"
+ for file in `simplaret_find_package $pattern $storage/$repository_name | egrep -v $priority_match`; do
+ simplaret_show_package $file $mode
+ done
+ priority_match=""
else
for file in `simplaret_find_package $pattern $storage/$repository_name`; do
simplaret_show_package $file $mode
@@ -506,7 +521,7 @@ function simplaret_get {
simplaret_repository_url
# if repos_type == root, the package is a patch and
- # STORE_ROOT_PATCHES_ON_PATCHES_DIR config parameter is enabled
+ # STORE_ROOT_PATCHES_ON_PATCHES_DIR config parameter is enabled, then
# save it on $PATCHES_DIR/root-$repository_name, so all patches
# are placed in the same tree
if [ "$repos_type" == "root" ] && \
@@ -543,7 +558,11 @@ function simplaret_get {
if [ "$2" != "--silent" ]; then
echo Error downloading $candidate from $repos_type repository $repository_url, please check your settings
fi
- return 1
+ # 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
+ return 1
+ #fi
else
LAST_DOWNLOADED_PACKAGE="$folder/$candidate"
if [ "$2" != "--silent" ]; then