]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
more binary repository management improvements
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 27 Nov 2008 19:58:42 +0000 (19:58 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 27 Nov 2008 19:58:42 +0000 (19:58 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@545 04377dda-e619-0410-9926-eae83683ac58

trunk/conf/repos.conf
trunk/doc/CHANGELOG
trunk/lib/common.sh
trunk/src/createpkg

index 4f3866351ccf2c703abaae2fef7b0934c6df0e35..c6f806f077a7e44f2f28f592486b96096549133e 100644 (file)
@@ -11,7 +11,7 @@ ROOT-powerpc="local%file:///var/simplepkg/repos/slackintosh"
 ROOT-s390="local%file:///var/simplepkg/repos/slack390"
 
 # slackware root repositories
-#ROOT-i386="sarava%http://slack.sarava.org/slackware/"
+ROOT-i386="sarava%http://slack.sarava.org/packages/slackware/"
 ROOT-i386="tds%http://slackware.mirrors.tds.net/pub/slackware/"
 ROOT-i386="easynews%http://slackware.mirrors.easynews.com/linux/slackware/"
 ROOT-i386="gwdg%http://ftp.gwdg.de/pub/linux/slackware/"
index 08bae3f5ffca42a78c76fc68d6d6b6654e8ea8bd..593a0e2070139fdb98addb4cf2b98106a71a94c4 100644 (file)
@@ -7,7 +7,7 @@ simplepkg changelog
     - common.sh:
       - other minor changes
       - repository metainformationg is now added at svn control if applicable
-      - new functions default_distro and svn_add
+      - new functions su_svn, regexp_slash, default_distro and svn_add
       - new config parameter "TMP" 
       - renamed function use_svn to templates_under_svn
     - simplaret: simplaret_search_and_process_patch do not donwload a package with the same
index 857d01e0130091bd9ea1a96eeb14ee0f4da4388e..2fc49c9746fe6d49a45c6f76dc1b20f951150623 100644 (file)
@@ -753,7 +753,8 @@ function gen_md5_checksums {
     cwd="`pwd`"
     cd $1
 
-    echo '' > CHECKSUMS.md5
+    echo 'MD5 digest for files in this directory.' > CHECKSUMS.md5
+    echo '' >> CHECKSUMS.md5
     find . -type f -name '*.tgz' -exec md5sum {} \; >> CHECKSUMS.md5
     cat CHECKSUMS.md5 | gzip -9 -c - > CHECKSUMS.md5.gz
 
@@ -772,6 +773,37 @@ function gen_md5_checksums {
 
 }
 
+function update_md5_checksum {
+
+  # update CHECKSUMS.md5
+  # usage: update_md5_checksums <folder> <file>
+
+  if [ -z "$2" ] || [ ! -d "$1" ] || [ ! -f "$file" ]; then
+    return 1
+  fi
+
+  if ! echo $2 | grep -q -e "^\.\/"; then
+    # add ./ in front of the file name
+    file="./$1"
+  else
+    file="$1"
+  fi
+
+  if [ ! -f CHECKSUMS.md5 ]; then
+    gen_md5_checksums .
+  else
+    # remove the old entry and add a new one
+    sed -i "/ $(regexp_slash $file)$/d" CHECKSUMS.md5
+    md5sum $file >> CHECKSUMS.md5
+  fi
+
+  cat CHECKSUMS.md5 | gzip -9 -c - > CHECKSUMS.md5.gz
+
+  svn_add CHECKSUMS.md5
+  svn_add CHECKSUMS.md5.gz
+
+}
+
 function gen_meta {
 
   # generate metafiles
@@ -1040,3 +1072,21 @@ function is_number {
     fi
 
 }
+
+function regexp_slash {
+
+  # escape slashes
+  echo $1 | sed -e 's/\//\\\//g'
+
+}
+
+function su_svn {
+
+  # execute svn using a different user
+  if [ ! -z "$SVN_USER" ]; then
+    su $SVN_USER -c "svn $*"
+  else
+    svn $*
+  fi
+
+}
index 26617883adc3b49fa282939e20858299324ae324..f158a21cb389dfcbe7404aee01d582ded7deb8ff 100644 (file)
@@ -544,7 +544,7 @@ if [ $REMOVE_OLD_PACKAGE -eq $on ]; then
     PACKAGE_ARCH="`package_arch $PKG_NAME`"
     PACKAGE_BUILD="`package_build $PKG_NAME`"
 
-    for file in `ls $PACKAGE-*-*-*.tgz`; do
+    for file in `find . -name "$PACKAGE-*-*-*.*"`; do
       if svn_check $file; then
         # Just delete packages with different arch, version or build number
         if [ "`package_version $file`" != "$PACKAGE_VERSION" ] || \
@@ -556,11 +556,22 @@ if [ $REMOVE_OLD_PACKAGE -eq $on ]; then
         rm $file
       fi
     done
+  
+    for file in `find $MAKEPKG_REPOS -name "$PACKAGE.slack-required"`; do
+      if svn_check $file; then
+        if [ $MOVE_SLACK_REQUIRED -eq $off ]; then
+          svn del --force $file
+        elif [ ! -z "$SLACK_REQUIRED" ] && [ "$NEW_REPOS/$PACKAGE.slack-required" != "$file" ]; then
+          svn del --force $file
+      else
+        rm $file
+      fi
 
     cd $cwd
 
   else
-    rm $NEW_REPOS/$PACKAGE-*-*-*.tgz 2>/dev/null
+    find $MAKEPKG_REPOS -name "$PACKAGE-*-*-*.*" -exec rm {} 2>/dev/null \;
+    find $MAKEPKG_REPOS -name "$PACKAGE.slack-required" -exec rm {} 2>/dev/null \;
   fi
 fi
 
@@ -597,10 +608,21 @@ fi
 
 # Update repository FILELIST.TXT, ...
 (
+
   cd $MAKEPKG_REPOS
   gen_filelist
-  gen_md5_checksums .
   gen_patches_filelist patches
+
+  SUBFOLDER="`echo $NEW_REPOS | sed -e "s/^$(regexp_slash $MAKEPKG_REPOS)//"`"
+  update_md5_checksum $MAKEPKG_REPOS $SUBFOLDER/$PKG_NAME
+  gen_meta $SUBFOLDER/$PKG_NAME
+
+  # update md5 file from patches/ folder if needed
+  for file in `find patches/ -name "$PACKAGE-*-*-*.tgz"`; do
+    SUBFOLDER="`echo $NEW_REPOS | sed -e "s/^$(regexp_slash $MAKEPKG_REPOS/patches)//"`"
+    update_md5_checksum $MAKEPKG_REPOS/patches $SUBFOLDER/$PKG_NAME
+  done
+
 )
 
 exit $EXIT_CODE