]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
cleanup
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Fri, 28 Nov 2008 02:47:33 +0000 (02:47 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Fri, 28 Nov 2008 02:47:33 +0000 (02:47 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@577 04377dda-e619-0410-9926-eae83683ac58

trunk/lib/common.sh
trunk/src/createpkg

index 07954c33f7f8840aeb74988265777e101b1b0077..0810fd74c864fe6df04640b8830ad6ad3a8fb5e0 100644 (file)
@@ -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 <orig> <dest>
index 81a1a70f89e5e64c73d35acd238fdb23fe4f46c2..ce9c3a5cc871ee229283dbfc11f3bad38189e660 100644 (file)
@@ -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