From 4e04db42916e6b5bce711e17ae11ca2f65c4a523 Mon Sep 17 00:00:00 2001 From: rhatto Date: Thu, 27 Nov 2008 20:50:48 +0000 Subject: more repo improvements git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@557 04377dda-e619-0410-9926-eae83683ac58 --- trunk/lib/common.sh | 2 ++ trunk/src/createpkg | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 5b69772..0e70572 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -799,6 +799,8 @@ function update_md5_checksum { cat CHECKSUMS.md5 | gzip -9 -c - > CHECKSUMS.md5.gz + echo "Updated CHECKSUMS.md5" + svn_add CHECKSUMS.md5 svn_add CHECKSUMS.md5.gz diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 2db3269..a511e2f 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -534,6 +534,16 @@ fi # 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 @@ -544,12 +554,13 @@ if [ $REMOVE_OLD_PACKAGE -eq $on ]; 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 @@ -572,6 +583,7 @@ if [ $REMOVE_OLD_PACKAGE -eq $on ]; then 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 -- cgit v1.2.3