aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/simplepkg.conf.new58
-rwxr-xr-xsrc/simplaret30
2 files changed, 73 insertions, 15 deletions
diff --git a/conf/simplepkg.conf.new b/conf/simplepkg.conf.new
index 5d01f59..b0117e5 100644
--- a/conf/simplepkg.conf.new
+++ b/conf/simplepkg.conf.new
@@ -1,17 +1,53 @@
+#
# /etc/simplepkg/simplepkg.conf
-JAIL_ROOT="/vservers" # where jails are placed
-SIMPLARET="simplaret" # package grabber program (can be swaret if you have it installed)
-SIMPLARET_CLEAN="1" # clean package cache before installation
-SIMPLARET_DELETE_DOWN="1" # clean package cache after the installation
-SIMPLARET_UPDATE="0" # issue an simplaret --update before install the jail
-SIMPLARET_PURGE_WEEKS="3" # delete packages older than N weeks from the cache
-SIMPLARET_DELETE_DURING="0" # delete each package rigth after its installation
-PATCHES_DIR="/var/simplaret/patches" # where patches are placed
-DEFAULT_ARCH="i386"
-DEFAULT_VERSION="10.2"
+#
+
+# default architecture: set this option if you dont want simplepkg
+# to use the value from /etc/slackware-version
+# DEFAULT_ARCH="i386"
+
+# default version: set this option if you dont want simplepkg
+# to use the value from /etc/slackware-version
+# DEFAULT_VERSION="11.0"
+
+# where jails are placed
+JAIL_ROOT="/vservers"
+
+# package grabber program (can be swaret if you have it installed)
+# just change to swaret if you know what you're doing
+SIMPLARET="simplaret"
+
+# whether to clean package cache before installation
+SIMPLARET_CLEAN="1"
+
+# whether clean package cache after the installation
+SIMPLARET_DELETE_DOWN="1"
+
+# whether issue an simplaret --update before install the jail
+SIMPLARET_UPDATE="0"
+
+# delete packages older than N weeks from the cache
+SIMPLARET_PURGE_WEEKS="3"
+
+# whether delete each package rigth after its installation
+SIMPLARET_DELETE_DURING="0"
+
+# where patches are placed
+PATCHES_DIR="/var/simplaret/patches"
+
+# place to store your packages
STORAGE="/var/simplaret/packages"
+
+# whether to use passive ftp transfers
PASSIVE_FTP="1"
-ROOT_PRIORITY="patches slackware extra testing pasture" # ROOT repository package priority
+
+# ROOT repository package priority
+ROOT_PRIORITY="patches slackware extra testing pasture"
+
+# Enabling this option (i.e, setting to 1), simplaret will donwload even
+# already applied patches, a good option when you plan to keep local
+# copies of all needed patches for your system
+DOWNLOAD_EVEN_APPLIED_PATCHES="0"
# Enabling this option, jail-upgrade will look at your
# standard repositories for new packages; if it find a package
diff --git a/src/simplaret b/src/simplaret
index f080748..83d2ea9 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -55,6 +55,7 @@ function simplaret_eval_config {
ROOT_PRIORITY="`simplaret_eval_parameter ROOT_PRIORITY patches slackware extra testing pasture`"
SIMPLARET_PURGE_WEEKS="`simplaret_eval_parameter SIMPLARET_PURGE_WEEKS 0`"
CONSIDER_ALL_PACKAGES_AS_PATCHES="`simplaret_eval_parameter CONSIDER_ALL_PACKAGES_AS_PATCHES 0`"
+ DOWNLOAD_EVEN_APPLIED_PATCHES="`simplaret_eval_parameter DOWNLOAD_EVEN_APPLIED_PATCHES 0`"
# now we place "patches" on the top of ROOT_PRIORITY
ROOT_PRIORITY="patches `echo $ROOT_PRIORITY | sed -e 's/patches//'`"
@@ -469,7 +470,7 @@ function simplaret_get {
function simplaret_search_and_download_patch {
local package_version package_build installed_version
- local installed_build repos_type get
+ local installed_build repos_type get is_patch
# get the repository type
repos_type="`echo $sugested | cut -d , -f 2`"
@@ -477,6 +478,12 @@ function simplaret_search_and_download_patch {
# get just the file name
sugested="`echo $sugested | cut -d , -f 1`"
+ if echo $sugested | grep -q "patches"; then
+ is_patch="yes"
+ else
+ is_patch="no"
+ fi
+
# now split the file name into pieces
package_version="`package_version $sugested`"
package_build="`package_build $sugested`"
@@ -500,11 +507,26 @@ function simplaret_search_and_download_patch {
fi
done
+ get="no"
+
# if the package is installed, download the patch
if [ "$package_installed" == "1" ]; then
- if [ "$repos_type" == "patches" ] || [ "$repos_type" == "root" ]; then
- # TODO: DOWNLOAD_EVEN_APPLIED_PATCHES
- get="yes"
+ if [ "$repos_type" == "patches" ]; then
+
+ if [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then
+ get="yes"
+ elif [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then
+ get="yes"
+ fi
+
+ elif [ "$repos_type" == "root" ] && [ "$is_patch" == "yes" ]; then
+
+ if [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then
+ get="yes"
+ elif [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then
+ get="yes"
+ fi
+
else
# here, we're dealing with repositories other than ROOT and REPOS,
# so we need to check if either version or build number are different,