aboutsummaryrefslogtreecommitdiff
path: root/src/simplaret
diff options
context:
space:
mode:
Diffstat (limited to 'src/simplaret')
-rwxr-xr-xsrc/simplaret23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/simplaret b/src/simplaret
index 62e9c82..383a705 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -56,6 +56,9 @@ function simplaret_eval_config {
SIMPLARET_PURGE_WEEKS="`simplaret_eval_parameter SIMPLARET_PURGE_WEEKS 0`"
CONSIDER_ALL_PACKAGES_AS_PATCHES="`simplaret_eval_parameter CONSIDER_ALL_PACKAGES_AS_PATCHES 0`"
+ # now we place "patches" on the top of ROOT_PRIORITY
+ ROOT_PRIORITY="patches `echo $ROOT_PRIORITY | sed -e 's/patches//'`"
+
}
function simplaret_get_index {
@@ -426,22 +429,28 @@ function simplaret_get {
if [ "`package_name $candidate`" == "$1" ]; then
simplaret_repository_url
- # TODO: if repos_type == root and the package is a patch,
- # save it on $PATCHES_DIR/root-$root_name/
+ # if repos_type == root and the package is a patch,
+ # save it on $PATCHES_DIR/root-$repository_name, so all patches
+ # are placed in the same tree
+ if [ "$repos_type" == "root" ] && echo $file | grep -q "patches"; then
+ folder="$PATCHES_DIR/root-$repository_name"
+ else
+ folder="$storage/$repository_name"
+ fi
- simplaret_download $repository_url $file $storage/$repository_name
+ simplaret_download $repository_url $file $folder
- if [ ! -f "$storage/$repository_name/$candidate" ]; then
+ if [ ! -f "$folder/$candidate" ]; then
if [ "$2" != "--silent" ]; then
echo error downloading $candidate from $repos_type repository $repository_url, please check your settings
fi
return 1
else
if [ "$2" != "--silent" ]; then
- echo package $candidate stored at $storage/$repository_name
- else echo $storage/$repository_name/$candidate
+ echo package $candidate stored at $folder
+ else echo $folder/$candidate
fi
- simplaret_checksum $storage/$repository_name/CHECKSUMS.md5 $storage/$repository_name/$candidate --silent
+ simplaret_checksum $storage/$repository_name/CHECKSUMS.md5 $folder/$candidate --silent
return $?
fi