aboutsummaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src')
-rw-r--r--trunk/src/createpkg6
-rwxr-xr-xtrunk/src/simplaret74
2 files changed, 43 insertions, 37 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg
index 4508e14..5562f19 100644
--- a/trunk/src/createpkg
+++ b/trunk/src/createpkg
@@ -493,12 +493,15 @@ PKG_NAME="`ls -1 -c $MAKEPKG_REPOS/$PACKAGE-*-*-*.tgz | head -n 1 | xargs basena
[ $MOVE_BIN_PACKAGE -eq $on ] && NEW_REPOS=$MAKEPKG_REPOS/$( echo ${SCRIPT_BASE#$SLACKBUILDS_DIR/} ) || NEW_REPOS=$MAKEPKG_REPOS
# Create repository directory
+# TODO: subversion integration
[ ! -e $NEW_REPOS ] && mkdir -p $NEW_REPOS 2>/dev/null
# Remove old packages from repository tree
+# TODO: subversion integration
[ $REMOVE_OLD_PACKAGE -eq $on ] && rm $NEW_REPOS/$PACKAGE-*-*-*.tgz 2>/dev/null
# Move package and slack-required to SlackBuilds-like tree
+# TODO: subversion integration
[ $MOVE_BIN_PACKAGE -eq $on ] && mv $MAKEPKG_REPOS/$PKG_NAME $NEW_REPOS/
[ ! -z "$SLACK_REQUIRED" ] && cp $SLACK_REQUIRED $NEW_REPOS/$PKG_NAME.slack-required
@@ -510,6 +513,9 @@ if [ "$INSTALL" -eq $on ]; then
upgradepkg --install-new $NEW_REPOS/$PKG_NAME
fi
+# TODO: subversion integration
+# generate or update all metadata
+# svn commit
# Update repository FILELIST.TXT, ...
(
cd $MAKEPKG_REPOS
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index c8cc2f7..483bba8 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -688,7 +688,7 @@ function simplaret_get {
function simplaret_search_and_process_patch {
- local package_version package_build installed_version
+ local package_version package_build installed_version pack
local installed_build repos_type get is_patch package_match
# get the repository type
@@ -718,48 +718,41 @@ function simplaret_search_and_process_patch {
fi
# search if its installed in the jail
- installed_packs="`ls /$root/var/log/packages/$sugested* 2> /dev/null`"
- if [ ! -z "$installed_packs" ]; then
-
- for installed in $installed_packs; do
- if [[ "$sugested" == "`package_name $installed.tgz`" ]]; then
- package_installed="1"
- installed_version="`package_version $installed.tgz`"
- installed_build="`package_build $installed.tgz`"
- break
- fi
- done
+ if grep -e "^$sugested$" $PACKAGES_TMP; then
+
+ pack="`echo $sugested | sed -e 's/\+/\\\+/'`"
+ installed=`eval "ls $root/var/log/packages/ | egrep -E '^$pack-[^-]+-[^-]+-[^-]+$'"`
+ installed_version="`package_version $installed.tgz`"
+ installed_build="`package_build $installed.tgz`"
get="no"
- # if the package is installed, download the patch
- if [ "$package_installed" == "1" ]; then
- if [ "$repos_type" == "patches" ]; then
+ # if needed, download the patch
+ if [ "$repos_type" == "patches" ]; then
- if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then
- get="yes"
- package_match="no"
- elif [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then
- get="yes"
- fi
+ if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then
+ get="yes"
+ package_match="no"
+ elif [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then
+ get="yes"
+ fi
- elif [ "$repos_type" == "root" ] && [ "$is_patch" == "yes" ]; then
+ elif [ "$repos_type" == "root" ] && [ "$is_patch" == "yes" ]; then
- if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then
- get="yes"
- package_match="no"
- elif [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then
- get="yes"
- fi
+ if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then
+ get="yes"
+ package_match="no"
+ elif [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; 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,
- # otherwise all installed packages would be downloaded
- if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then
- get="yes"
- package_match="no"
- 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,
+ # otherwise all installed packages would be downloaded
+ if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then
+ get="yes"
+ package_match="no"
fi
fi
@@ -781,7 +774,7 @@ function simplaret_search_and_process_patch {
fi
- unset package_installed get
+ unset get
}
@@ -817,6 +810,11 @@ function simplaret_get_jail_patches {
echo ""
fi
+ # installed packages at $root
+ PACKAGES_TMP=/tmp/simplaret_"$root"_packages.$RANDOM
+ rm -f $PACKAGES_TMP ; touch $PACKAGES_TMP ; chmod 600 $PACKAGES_TMP
+ ls -1 $root/var/log/packages/ | sed -e 's/-[^-]*-[^-]*-[^-]*$//' > $PACKAGES_TMP
+
echo Fetching patches for arch $ARCH and version $VERSION for jail $root
# list all available patches from PATCHES and ROOT repositories
@@ -837,6 +835,8 @@ function simplaret_get_jail_patches {
fi
+ rm $PACKAGES_TMP
+
# restore arch and version
ARCH="$oldarch"
VERSION="$oldversion"