]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
- jail-commit warning for file not found
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Tue, 3 Apr 2007 22:19:09 +0000 (22:19 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Tue, 3 Apr 2007 22:19:09 +0000 (22:19 +0000)
- repos: cosmetic changes
- templatepkg: now supports a tagfile or slack-required as a template

git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@212 04377dda-e619-0410-9926-eae83683ac58

trunk/doc/CHANGELOG
trunk/src/jail-commit
trunk/src/repos
trunk/src/templatepkg

index 3c9988ec8554554641c821dce79cd558bd19e06b..270379df62f2e6d1ae319c22913cfb8e6060be96 100644 (file)
@@ -4,6 +4,10 @@ simplepkg changelog
 0.5pre1
 =======
 
+  - repos: cosmetic changes
+
+  - jail-commit warning for file not found
+
   - lspkg:
     - support for $ROOT env variable
     - some improvements
@@ -34,6 +38,7 @@ simplepkg changelog
   - templatepkg:
     -a option changed to add files into a template
     -u option now updated a template
+    - now supports a tagfile or slack-required as a template
 
 0.4.9pre18-23
 =============
index 59fccadc5151405ea1b22cced4228746ba38f6fa..45aea1eb6269dece85361537ed5dc54ca202f3d8 100755 (executable)
@@ -56,6 +56,12 @@ function template_merge {
       owner="`get_owner $1/$file`"
       group="`get_group $1/$file`"
       echo "$file;$owner;$group;$perms" >> $TEMPLATE_BASE.perms
+    else
+      if [ ! -f "$file" ]; then
+        echo $BASENAME: warning: missing file $file 
+      else
+        echo $BASENAME: warning: missing template file $1/$file 
+      fi
     fi
   done
 
index 465714b4e63c9a25643cde5b16338ebbc471a402..95a3936eefb6eae78d6a069d172a30af6c98f9e2 100755 (executable)
@@ -8,24 +8,39 @@
 # the Free Software Foundation; either version 2 of the License, or
 # any later version.
 #
-# changes by rhatto at riseup.net to fit http://slack.sarava.org needs
-# 
+# Changes by rhatto at riseup.net to fit http://slack.sarava.org needs
+#
+# TODO: - simplepkg's config file support
+#       - integration with binary repository
+#       - package's and CHECKSUMS.md5 signature creation
+#
+
+function usage {
+
+  echo "`basename $0` [pkg [file]|all|new|svnmeta|PACKAGESTXT|FILELIST|MD5]"
+
+}
 
 function svn_add_meta {
+
   find *meta -exec svn add {} 2> /dev/null \;
   find . -name *meta -exec svn add {} 2> /dev/null \;
+
 }
 
 function gen_filelist {
+
   for file in `find | grep -e ".tgz$"`; do ls -l $file; done > FILELIST.TXT
   echo "Created new FILELIST.TXT"
   if [ -d "patches" ]; then
     for file in `find patches | grep -e ".tgz$"`; do ls -l $file; done > patches/FILE_LIST
     echo "Created new patches/FILE_LIST"
   fi
+
 }
 
 function gen_packages_txt {
+
    echo '' > PACKAGES.TXT
    find . -type f -name '*.meta' -exec cat {} \; >> PACKAGES.TXT
    cat PACKAGES.TXT | gzip -9 -c - > PACKAGES.TXT.gz
@@ -35,9 +50,11 @@ function gen_packages_txt {
      cat patches/PACKAGES.TXT | gzip -9 -c - > patches/PACKAGES.TXT.gz
      echo "Created new patches/PACKAGES.TXT and patches/PACKAGES.TXT.gz"
    fi
+
 }
 
 function gen_md5_checksums {
+
    echo '' > CHECKSUMS.md5
    find . -type f -name '*.tgz' -exec md5sum {} \; >> CHECKSUMS.md5
    cat CHECKSUMS.md5 | gzip -9 -c - > CHECKSUMS.md5.gz
@@ -47,9 +64,11 @@ function gen_md5_checksums {
      cat patches/CHECKSUMS.md5 | gzip -9 -c - > patches/CHECKSUMS.md5.gz
      echo "Created new patches/CHECKSUMS.md5 and patches/CHECKSUMS.md5.gz"
    fi
+
 }
 
 function gen_meta {
+
   if [ ! -f $1 ]; then
     echo "File not found: $1"
     exit 1;
@@ -80,27 +99,30 @@ function gen_meta {
   echo "PACKAGE DESCRIPTION:" >> $LOCATION/$METAFILE
   tar xzfO $1 install/slack-desc | grep -E '\w+\:'|grep -v '^#' >> $LOCATION/$METAFILE
   echo "" >> $LOCATION/$METAFILE
+
 }
 
 function do_all {
+
   for pkg in `find . -type f -name '*.tgz' -print`; do
     gen_meta $pkg
   done
   $0 PACKAGESTXT
   $0 FILELIST
   $0 MD5
-}
 
-function show_usage {
-  echo "`basename $0` [pkg [file]|all|new|svnmeta|PACKAGESTXT|FILELIST|MD5]"
 }
 
+# ---------------------------------
+#              main
+# ---------------------------------
+
 case "$1" in
   pkg)
       if [ -n "$2" ]; then
         gen_meta $2
       else
-        show_usage
+        usage
       fi
     ;;
     all)
@@ -126,10 +148,11 @@ case "$1" in
       gen_md5_checksums
     ;;
     usage)
-      show_usage
+      usage
     ;;
     *)
       do_all
       svn_add_meta
     ;;
 esac
+
index c9771b7cc663625343d58d32e00dbd22bd5e8c64..8faab8944954b34e793c49c0c6f9f1bbf702a6c1 100755 (executable)
@@ -147,7 +147,7 @@ function template_update {
   for package in `ls -1 $ROOT/var/log/packages/`; do
     pack=`package_name $package`
     if [ -f $TEMPLATE ]; then
-      if ! `grep -v -e "^#" $TEMPLATE | cut -d : -f 1 | grep -q -e "^$pack\$"`; then
+      if ! `grep -v -e "^#" $TEMPLATE | cut -d : -f 1 | awk '{ print $1 }' | grep -q -e "^$pack\$"`; then
         echo $pack >> $TEMPLATE
         echo Added $pack on $TEMPLATE
       fi
@@ -158,7 +158,7 @@ function template_update {
   done
 
   # check if each package from the template is installed
-  grep -v -e "^#" $TEMPLATE | cut -d : -f 1 | while read pack; do
+  grep -v -e "^#" $TEMPLATE | cut -d : -f 1 | awk '{ print $1 }' | while read pack; do
 
     if [ ! -z "$pack" ]; then
       unset found
@@ -171,7 +171,7 @@ function template_update {
       done
       if [ "$found" != "1" ]; then
         # remove a non-installed package from the template
-        sed "/^$pack$/d" $TEMPLATE | sed "/^$pack $/d" | sed "/^$pack:*/d" > $TEMPLATE.tmp
+        sed "/^$pack$/d" $TEMPLATE | sed "/^$pack $/d" | sed "/^$pack:*/d" | sed "/^$pack */d" > $TEMPLATE.tmp
         cat $TEMPLATE.tmp > $TEMPLATE
         rm -f $TEMPLATE.tmp
         echo Removed $pack from $TEMPLATE