]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
mkbuild: remove stuff from old places at the repository
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Mon, 1 Dec 2008 21:38:19 +0000 (21:38 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Mon, 1 Dec 2008 21:38:19 +0000 (21:38 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@620 04377dda-e619-0410-9926-eae83683ac58

trunk/src/mkbuild
trunk/src/simplaret

index 60ca2de38ca158dc91c08276504654a2b6b80514..e79b023fa997401fe78525eaa864a892206ff33a 100755 (executable)
@@ -566,12 +566,10 @@ function apply_mkpatch {
 function submit_slackbuild {
 
   # Submit SlackBuild in local Slack.Sarava tree
-  #if [ $UID -ne 0 ]; then
-  #  echo "Only root can submit SlackBuilds..."
-  #  return 1
-  #fi
   echo -e "\nSubmiting $SLACKBUILD"
 
+  local candidate oldplace
+
   # check SlackBuilds directory
   [ ! -e $SLACKBUILDS_DIR ] && createpkg --sync
 
@@ -581,6 +579,16 @@ function submit_slackbuild {
   # Add SlackBuild scripts
   # check path
   [ ! -e $SLACKBUILD_PATH ] && svn_mkdir $SLACKBUILD_PATH
+
+  # remove stuff in old places
+  for candidate in `find . -name $SLACKBUILD`; do
+    oldplace="`dirname $candidate | sed -e 's/^\.\///'`"
+    if [ "$oldplace" != "`dirname $SLACKBUILD_PATH | sed -e 's/^\.\///'`" ]; then
+      echo "Removing SlackBuild found at old path $oldplace"
+      svn_del $oldplace
+    fi
+  done
+
   # add SlackBuild
   svn_copy $WORK/$SLACKBUILD $SLACKBUILD_PATH
 
@@ -599,12 +607,10 @@ function submit_slackbuild {
 function submit_mkbuild {
 
   # Submit mkbuild in local mkbuild Slack.Sarava tree
-  #if [ $UID -ne 0 ]; then
-  #  echo "Only root can submit mkbuild..."
-  #  return 1
-  #fi
   echo -e "\nSubmiting $MKBUILD_NAME"
 
+  local candidate oldplace
+
   # check mkbuild directory
   [ ! -d $MKBUILDS_DIR ] && build_repo $MKBUILDS_DIR $MKBUILDS_SVN
 
@@ -617,6 +623,16 @@ function submit_mkbuild {
   # Add mkbuild scripts
   # check path
   [ ! -e $MKBUILD_PATH ] && svn_mkdir $MKBUILD_PATH
+
+  # remove stuff in old places
+  for candidate in `find . -name $MKBUILD_NAME`; do
+    oldplace="`dirname $candidate | sed -e 's/^\.\///'`"
+    if [ "$oldplace" != "`dirname $MKBUILD_PATH | sed -e 's/^\.\///'`" ]; then
+      echo "Removing mkbuild found at old path $oldplace"
+      svn_del $oldplace
+    fi
+  done  
+
   # add mkbuild
   svn_copy $WORK/$MKBUILD_NAME $MKBUILD_PATH
 
index b36f4c49c690ac28bf084615828d977a992787be..ec24ded289b2ee9b9f260a1500427e5ef165ae35 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# simplaret $Rev$: simplepkg's retrieval tool
+# simplaret: simplepkg's retrieval tool
 # feedback: rhatto at riseup.net | gpl
 #
 #  Simplaret is free software; you can redistribute it and/or modify it under the
@@ -15,6 +15,8 @@
 #  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 #  Place - Suite 330, Boston, MA 02111-1307, USA
 #
+# $Rev$ - $Author$
+#
 
 BASENAME="`basename $0`"
 COMMON="/usr/libexec/simplepkg/common.sh"