aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/simplaret39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/simplaret b/src/simplaret
index 88f5978..50eb5a7 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -177,6 +177,17 @@ function simplaret_repository_url {
}
+function simplaret_set_storage_folder {
+
+ storage="$STORAGE/$ARCH/$VERSION/$repos_type"
+ if [ "$repos_type" == "noarch" ]; then
+ storage="$STORAGE/noarch"
+ elif [ "$repos_type" == "patches" ]; then
+ storage="$PATCHES_DIR/$ARCH/$VERSION"
+ fi
+
+}
+
function simplaret_update {
local storage
@@ -188,13 +199,9 @@ function simplaret_update {
simplaret_repository_name
simplaret_repository_url
+ simplaret_set_storage_folder
- storage="$STORAGE/$ARCH/$VERSION/$repos_type"
- if [ "$repos_type" == "noarch" ]; then
- storage="$STORAGE/noarch"
- elif [ "$repos_type" == "patches" ]; then
- storage="$PATCHES_DIR/$ARCH/$VERSION"
- elif [ "$repost_type" == "root" ]; then
+ if [ "$repost_type" == "root" ]; then
repository_url="$repository_url/$DISTRO_FOLDER/$EXTRA_FOLDER"
fi
@@ -253,13 +260,7 @@ function simplaret_search {
for repos_type in patches root repos noarch; do
name="`echo $repos_type | tr '[:lower:]' '[:upper:]'`"
-
- storage="$STORAGE/$ARCH/$VERSION/$repos_type"
- if [ "$repos_type" == "noarch" ]; then
- storage="$STORAGE/noarch"
- elif [ "$repos_type" == "patches" ]; then
- storage="$PATCHES_DIR/$ARCH/$VERSION"
- fi
+ simplaret_set_storage_folder
for repository in `simplaret_repository $repos_type`; do
@@ -312,12 +313,7 @@ function simplaret_purge {
for repos_type in patches root repos noarch; do
- storage="$STORAGE/$ARCH/$VERSION/$repos_type"
- if [ "$repos_type" == "noarch" ]; then
- storage="$STORAGE/noarch"
- elif [ "$repos_type" == "patches" ]; then
- storage="$PATCHES_DIR/$ARCH/$VERSION"
- fi
+ simplaret_set_storage_folder
for file in `find $storage/ $mtime 2> /dev/null`; do
for extension in tgz asc meta; do
@@ -338,7 +334,8 @@ function simplaret_purge {
function simplaret_get {
- # TODO: with no parameters, update the existing packages at the local repo?
+ # TODO: new repository format
+ # with no parameters, update the existing packages at the local repo?
# support to --get package-version-arch-build.tgz or just half the name
# precedence: patches slackware repos noarch
# ROOT_PRIORITY
@@ -354,7 +351,7 @@ function simplaret_get {
[ "`package_version $candidate`" == "`package_version $result`" ] && \
[ "`package_build $candidate`" == "`package_build $result`" ]; then
echo package $candidate already downloaded and stored at `dirname $file`
- exit 0
+ return 0
else
rm $file
fi