aboutsummaryrefslogtreecommitdiff
path: root/src/simplaret
diff options
context:
space:
mode:
Diffstat (limited to 'src/simplaret')
-rwxr-xr-xsrc/simplaret46
1 files changed, 19 insertions, 27 deletions
diff --git a/src/simplaret b/src/simplaret
index f9b3c2f..a0e2a83 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -241,6 +241,8 @@ function simplaret_show_package {
echo `basename $1`
elif [ "$2" == "-filename-only" ]; then
echo $1
+ elif [ "$2" == "-formatted" ]; then
+ echo $1 $repos_type $repository
else
if echo $1 | grep -q "/patches/"; then
patch="(patch)"
@@ -270,6 +272,7 @@ function simplaret_search {
if [ ! -f "$storage/$repository_name/FILELIST.TXT" ]; then
if [ "$WARNING" != "0" ] || [ ! -z "$SILENT" ]; then
+ # TODO: message should also work for noarch repositories
echo warning: no file list for $repository_name repository $repository_name on arch $ARCH version $VERSION
echo please do a simplaret --update
fi
@@ -338,8 +341,6 @@ function simplaret_get {
# TODO: with no parameters, update the existing packages at the local repo?
# support to --get package-version-arch-build.tgz or just half the name
- # ROOT_PRIORITY
- # etc
# first search for an already downloaded package
for repos_type in patches root repos noarch; do
@@ -366,38 +367,29 @@ function simplaret_get {
done
# then search for the package in the repositories
- for repos_type in patches root repos noarch; do
+ for result in `simplaret_search $1 -formatted`; do
- simplaret_set_storage_folder
+ file="`echo $result | awk '{ print $1 }'`"
+ repos_type="`echo $result | awk '{ print $2 }'`"
+ repository="`echo $result | awk '{ print $3 }'`"
- for repository in `simplaret_repository $repos_type`; do
+ simplaret_set_storage_folder
+ simplaret_repository_name
- simplaret_repository_name
+ candidate="`basename $file`"
+ if [ "`package_name $candidate`" == "$1" ]; then
simplaret_repository_url
-
- if [ ! -f "$storage/FILELIST.TXT" ]; then
- if [ "$WARNING" != "0" ] || [ ! -z "$SILENT" ]; then
- # TODO: message should also work for noarch repositories
- echo warning: no file list for $repos_type repository on arch $ARCH version $VERSION, please do a simplaret --update
- fi
+ 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
else
- for file in `simplaret_find_package $1 $storage`; do
- candidate="`basename $file`"
- if [ "`package_name $candidate`" == "$1" ]; then
- simplaret_download $repository_url $file $storage
- if [ ! -f "$storage/$candidate" ]; then
- echo error downloading $candidate from $repos_type repository $root_url, please check your settings
- exit 1
- else
- echo package $candidate stored at $STORAGE/$ARCH/$VERSION
- simplaret_checksum $storage/CHECKSUMS.md5 $storage/$candidate
- exit 0
- fi
- fi
- done
+ echo package $candidate stored at $storage/$repository_name
+ simplaret_checksum $storage/$repository_name/CHECKSUMS.md5 $storage/$repository_name/$candidate
+ exit 0
fi
+ fi
- done
done
}