diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-04-08 16:14:38 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-04-08 16:14:38 +0000 |
commit | 921803921ee524645a5593424340195b310f16b3 (patch) | |
tree | 14d0d7840501826eef9234cefed5bf99958d4bbe /trunk/src | |
parent | 38860a77c2fb0dd2b92bf30e779dd405e8800940 (diff) | |
download | simplepkg-921803921ee524645a5593424340195b310f16b3.tar.gz simplepkg-921803921ee524645a5593424340195b310f16b3.tar.bz2 |
see doc/CHANGELOG for changes
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@325 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src')
-rwxr-xr-x | trunk/src/lspkg | 21 | ||||
-rwxr-xr-x | trunk/src/simplaret | 23 |
2 files changed, 33 insertions, 11 deletions
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 |