# Remove old packages from repository tree
if [ $REMOVE_OLD_PACKAGE -eq $on ]; then
+ # first remove entries from CHECKSUMS.md5
+ if [ -f "$MAKEPKG_REPOS/CHECKSUMS.md5" ]; then
+ sed -i "/$PACKAGE-.*-.*-.*.*$/d" $MAKEPKG_REPOS/CHECKSUMS.md5
+ fi
+
+ # then remove entries from patches/CHECKSUMS.md5
+ if [ -f "$MAKEPKG_REPOS/patches/CHECKSUMS.md5" ]; then
+ sed -i "/$PACKAGE-.*-.*-.*.*$/d" $MAKEPKG_REPOS/patches/CHECKSUMS.md5
+ fi
+
# Using subversion
if [ -d "$MAKEPKG_REPOS/.svn" ]; then
PACKAGE_ARCH="`package_arch $PKG_NAME`"
PACKAGE_BUILD="`package_build $PKG_NAME`"
+ # Using -mindepth 2 so it doesn't delete the new package
for file in `find . -mindepth 2 -name "$PACKAGE-*-*-*.*"`; do
if svn_check $file; then
# Just delete packages with different arch, version or build number
if [ "`package_version $file`" != "$PACKAGE_VERSION" ] || \
- [ "`package_arch $file`" != "$PACKAGE_ARCH" ] || \
- [ "`package_build $file`" != "$PACKAGE_BUILD" ]; then
+ [ "`package_arch $file`" != "$PACKAGE_ARCH" ] || \
+ [ "`package_build $file`" != "$PACKAGE_BUILD" ]; then
svn del --force $file
fi
else
cd $cwd
else
+ # Using -mindepth 2 so it doesn't delete the new package
find $MAKEPKG_REPOS -mindepth 2 -name "$PACKAGE-*-*-*.*" -exec rm {} 2>/dev/null \;
find $MAKEPKG_REPOS -name "$PACKAGE.slack-required" -exec rm {} 2>/dev/null \;
fi