}
+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
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
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
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
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
[ "`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