From 25adde3f586f0bfe4b3d8a59b26080306f1721e4 Mon Sep 17 00:00:00 2001 From: rhatto Date: Fri, 28 Nov 2008 02:47:33 +0000 Subject: cleanup git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@577 04377dda-e619-0410-9926-eae83683ac58 --- trunk/lib/common.sh | 11 +++++++++++ trunk/src/createpkg | 30 ++++++++++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 07954c3..0810fd7 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -579,6 +579,17 @@ function svn_add { } +function svn_del { + + if [ -e "$1" ] && [ -d "`dirname $1`/.svn" ] && svn_check $1; then + chown_svn $1 && chgrp_svn $1 + su_svn del --force $1 + else + rm $1 + fi + +} + function svn_copy { # usage: svn_copy diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 81a1a70..ce9c3a5 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -561,30 +561,20 @@ if [ $REMOVE_OLD_PACKAGE -eq $on ]; then # Using -mindepth 2 so it doesn't delete the new package for file in `find . -mindepth 2 -name "$PACKAGE-*-*-*.tgz" -o -name "$PACKAGE-*-*-*.meta"`; do - if svn_check $file; then - candidate="`echo $file | sed -e 's/\.meta/\.tgz/'`" # otherwise package info functions can fail - # Just delete packages with different arch, version or build number - if [ "`package_version $candidate`" != "$PACKAGE_VERSION" ] || \ - [ "`package_arch $candidate`" != "$PACKAGE_ARCH" ] || \ - [ "`package_build $candidate`" != "$PACKAGE_BUILD" ]; then - chown_svn $MAKEPKG_REPOS && chgrp_svn $MAKEPKG_REPOS - su_svn del --force $file - fi - else - rm $file + candidate="`echo $file | sed -e 's/\.meta/\.tgz/'`" # otherwise package info functions can fail + # Just delete packages with different arch, version or build number + if [ "`package_version $candidate`" != "$PACKAGE_VERSION" ] || \ + [ "`package_arch $candidate`" != "$PACKAGE_ARCH" ] || \ + [ "`package_build $candidate`" != "$PACKAGE_BUILD" ]; then + svn_del $file fi done for file in `find $MAKEPKG_REPOS -name "$PACKAGE.slack-required"`; do - if svn_check $file; then - chown_svn $MAKEPKG_REPOS && chgrp_svn $MAKEPKG_REPOS - if [ $MOVE_SLACK_REQUIRED -eq $off ]; then - su_svn del --force $file - elif [ ! -z "$SLACK_REQUIRED" ] && [ "$NEW_REPOS/$PACKAGE.slack-required" != "$file" ]; then - su_svn del --force $file - fi - else - rm $file + if [ $MOVE_SLACK_REQUIRED -eq $off ]; then + svn_del $file + elif [ ! -z "$SLACK_REQUIRED" ] && [ "$NEW_REPOS/$PACKAGE.slack-required" != "$file" ]; then + svn_del $file fi done -- cgit v1.2.3