]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
simplaret: fix, see doc/CHANGELOG
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 8 Apr 2007 00:03:16 +0000 (00:03 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 8 Apr 2007 00:03:16 +0000 (00:03 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@319 04377dda-e619-0410-9926-eae83683ac58

trunk/conf/simplepkg.conf.new
trunk/doc/CHANGELOG
trunk/lib/common.sh
trunk/simplepkg.SlackBuild
trunk/src/lspkg
trunk/src/repos
trunk/src/simplaret

index a6ed9a43cce4447ce649e9be6eb54f45c1aa692a..d524659f74af98dba925ce4818ef0d13b1689089 100644 (file)
@@ -2,73 +2,73 @@
 # /etc/simplepkg/simplepkg.conf
 #
 
-# default architecture: set this option if you dont want simplepkg
+# Default architecture: set this option if you dont want simplepkg
 # to use the value from /etc/slackware-version
 # DEFAULT_ARCH="i386"
 
-# default version: set this option if you dont want simplepkg
+# Default version: set this option if you dont want simplepkg;
 # to use the value from /etc/slackware-version
 # DEFAULT_VERSION="11.0"
 
-# where jails are placed
+# Where jails are placed
 JAIL_ROOT="/vservers"
 
-# wheter mkjial should add new jails in the jail list
+# Wheter mkjial should add new jails in the jail list;
 # to enable it, set to "1" or "yes"
 ADD_TO_JAIL_LIST="1"
 
-# whether mkjail should clean the package cache before installation
+# Whether mkjail should clean the package cache before installation
 # to enable it, set to "1" or "yes"
 SIMPLARET_CLEAN="1"
 
-# whether mkjail should clean the package cache after the installation
+# whether mkjail should clean the package cache after the installation;
 # to enable it, set to "1" or "yes"
 SIMPLARET_DELETE_DOWN="1"
 
-# whether mkjail should issue a simplaret --update before install the jail
+# Whether mkjail should issue a simplaret --update before install the jail;
 # to enable it, set to "1" or "yes"
 SIMPLARET_UPDATE="1"
 
-# wheter delete also patches when simplaret --purge is called
+# Wheter delete also patches when simplaret --purge is called;
 # to enable it, set to "1" or "yes"
 SIMPLARET_PURGE_PATCHES="0"
 
-# whether delete each package rigth after its installation
+# Whether delete each package rigth after its installation;
 # to enable it, set to "1" or "yes"
 SIMPLARET_DELETE_DURING="0"
 
-# delete packages older than N weeks from the cache
+# Delete packages older than N weeks from the cache
 SIMPLARET_PURGE_WEEKS="3"
 
-# where patches are placed
+# Where patches are placed
 PATCHES_DIR="/var/simplaret/patches"
 
-# place to store your packages
+# Place to store your packages
 STORAGE="/var/simplaret/packages"
 
-# whether to use passive ftp transfers
+# Whether to use passive ftp transfers;
 # to enable it, set to "1" or "yes"
 PASSIVE_FTP="1"
 
-# http retrieval tool
+# Http retrieval tool;
 # available parameters are "wget" or "curl"
 HTTP_TOOL="wget"
 
-# ftp retrieval tool
+# Ftp retrieval tool;
 # available parameters are "wget", "curl" or "ncftpget"
 FTP_TOOL="wget"
 
-# set connection timeout in seconds
+# Set connection timeout in seconds
 CONNECT_TIMEOUT="20"
 
 # ROOT repository package priority
 ROOT_PRIORITY="patches slackware extra testing pasture"
 
-# whether to check package signatures (you should have the repository
+# Whether to check package signatures (you should have the repository
 # maintainer key on your keyring)
 SIGNATURE_CHECKING="0"
 
-# whether simplaret will try to solve dependencies by looking
+# Whether simplaret will try to solve dependencies by looking
 # for packages' slack-required
 DEPENDENCY_CHECKING="1"
 
@@ -102,7 +102,7 @@ STORE_ROOT_PATCHES_ON_PATCHES_DIR="0"
 # This just work if TEMPLATE_STORAGE_STYLE is set to own-folder (default)
 TEMPLATES_UNDER_SVN="no"
 
-# Where your templates will be located
+# Where your templates will be located.
 # Dont change it except you know what you're doing.
 TEMPLATE_FOLDER="/etc/simplepkg/templates"
 
index 2ed75061071c3cd13b070682e3f1a35da35c567e..00013b27b57b3b6d5076adedb88ca995e6731c60 100644 (file)
@@ -1,22 +1,31 @@
 simplepkg changelog
 ===================
 
+0.5pre8
+=======
+
+  - lspkg:
+    - bugfix
+
+  - common.sh:
+    - bugfix in function slash
+
 0.5pre7
 =======
 
-   - simplaret:
-     - fixed bug for ROOT definitions when there is packages
-       inside of folders different than ROOT_PRIORITY
+  - simplaret:
+    - fixed bug for ROOT definitions when there is packages
+      inside of folders different than ROOT_PRIORITY
 
 0.5pre6
 =======
 
-   - repos:
-     - FILE_LIST generation fix
+  - repos:
+    - FILE_LIST generation fix
 
-   - mkjail:
-     - new config variable ADD_TO_JAIL_LIST controls wheter to
-       add new jails into the JAIL_LIST file
+  - mkjail:
+    - new config variable ADD_TO_JAIL_LIST controls wheter to
+      add new jails into the JAIL_LIST file
 
 0.5pre5
 =======
index 1eff3346ccaf6b59f271902235932dd85171d26a..6bbfca0d3f47bddb621e283285128bb67af56be0 100644 (file)
@@ -32,7 +32,10 @@ CONF="$BASE_CONF/simplepkg.conf"
 JAIL_LIST="$BASE_CONF/jailist"
 SIMPLARET="simplaret"
 
-# pkgtool stuff
+# -----------------------------------------------
+#               pkgtool functions
+# -----------------------------------------------
+
 function package_name {
 
   STRING=`basename $1 .tgz`
@@ -58,6 +61,10 @@ function package_name {
 
 }
 
+# -----------------------------------------------
+#             package info functions
+# -----------------------------------------------
+
 function package_version {
 
   # get VERSION from a package name
@@ -91,6 +98,10 @@ function package_build {
 
 }
 
+# -----------------------------------------------
+#       package administrative functions
+# -----------------------------------------------
+
 function install_packages {
 
   local check installed unable_to_install root
@@ -145,6 +156,10 @@ function remove_packages {
 
 }
 
+# -----------------------------------------------
+#             config file functions
+# -----------------------------------------------
+
 function eval_parameter {
 
   # usage: eval $1 parameter from $CONF
@@ -294,6 +309,10 @@ function eval_config {
 
 }
 
+# -----------------------------------------------
+#           arch and version functions
+# -----------------------------------------------
+
 function default_version {
 
   # get version from /etc/slackware-version
@@ -320,6 +339,10 @@ function default_arch {
 
 }
 
+# -----------------------------------------------
+#              template functions
+# -----------------------------------------------
+
 function search_default_template {
 
   if [ -e "$BASE_CONF/default.template" ]; then
@@ -388,6 +411,10 @@ function search_template {
 
 }
 
+# -----------------------------------------------
+#           unix permission functions
+# -----------------------------------------------
+
 function numeric_perm {
 
   # get the numeric permission of a file
@@ -426,6 +453,10 @@ function get_group {
 
 }
 
+# -----------------------------------------------
+#              subversion functions
+# -----------------------------------------------
+
 function use_svn {
 
   # check if svn usage is enabled
@@ -469,6 +500,10 @@ function svn_check {
 
 }
 
+# -----------------------------------------------
+#           update jail functions
+# -----------------------------------------------
+
 function update_template_files {
 
   # update template files from svn
@@ -521,10 +556,132 @@ function set_jail_perms {
 
 }
 
+# -----------------------------------------------
+#           repository build functions
+# -----------------------------------------------
+
+function svn_add_meta {
+
+  find *meta -exec svn add {} 2> /dev/null \;
+  find . -name *meta -exec svn add {} 2> /dev/null \;
+
+}
+
+function gen_filelist {
+
+  # generate FILELIST.TXT
+
+  local cwd
+
+  for file in `find | grep -e ".tgz$"`; do ls -l $file; done > FILELIST.TXT
+  echo "Created new FILELIST.TXT"
+
+  if [ -d "patches" ]; then
+    gen_patches_filelist patches
+    for file in `find | grep -e ".tgz$"`; do ls -l $file; done > FILE_LIST
+    echo "Created new patches/FILE_LIST"
+  fi
+
+}
+
+function gen_patches_filelst {
+
+  # generate FILE_LIST
+
+  mkdir -p $1
+  cwd="`pwd`"
+  cd $1
+  for file in `find | grep -e ".tgz$"`; do ls -l $file; done > FILE_LIST
+  cd $pwd
+
+}
+
+function gen_packages_txt {
+
+  # generate PACKAGES.TXT
+
+  echo '' > PACKAGES.TXT
+  find . -type f -name '*.meta' -exec cat {} \; >> PACKAGES.TXT
+  cat PACKAGES.TXT | gzip -9 -c - > PACKAGES.TXT.gz
+  echo "Created new PACKAGES.TXT and PACKAGES.TXT.gz"
+
+  if [ -d "patches" ]; then
+    find patches -type f -name '*.meta' -exec cat {} \; >> patches/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 {
+
+  # generate CHECKSUMS.md5
+
+  echo '' > CHECKSUMS.md5
+  find . -type f -name '*.tgz' -exec md5sum {} \; >> CHECKSUMS.md5
+  cat CHECKSUMS.md5 | gzip -9 -c - > CHECKSUMS.md5.gz
+  echo "Created new CHECKSUMS.md5 and CHECKSUMS.md5.gz"
+
+  if [ -d "patches" ]; then
+    find patches -type f -name '*.tgz' -exec md5sum {} \; >> patches/CHECKSUMS.md5
+    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 {
+
+  # generate metafiles
+
+  if [ ! -f $1 ]; then
+    echo "File not found: $1"
+    exit 1;
+  else
+    echo "Processing $1"
+  fi
+
+  if [ "`echo $1|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).tgz[ ]{0,}$'`" == "" ]; then
+    return;
+  fi
+
+  NAME=$(echo $1|sed -re "s/(.*\/)(.*.tgz)$/\2/")
+  LOCATION=$(echo $1|sed -re "s/(.*)\/(.*.tgz)$/\1/")
+  SIZE=$( expr `gunzip -l $1 | tail -n 1|awk '{print $1}'` / 1024 )
+  USIZE=$( expr `gunzip -l $1 | tail -n 1|awk '{print $2}'` / 1024 )
+  REQUIRED=$(tar xzfO $1 install/slack-required 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
+  CONFLICTS=$(tar xzfO $1 install/slack-conflicts 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
+  SUGGESTS=$(tar xzfO $1 install/slack-suggests 2>/dev/null|xargs -r )
+  METAFILE=${NAME%tgz}meta
+
+  echo "PACKAGE NAME:  $NAME" > $LOCATION/$METAFILE
+
+  if [ -n "$DL_URL" ]; then
+    echo "PACKAGE MIRROR:  $DL_URL" >> $LOCATION/$METAFILE
+  fi
+
+  echo "PACKAGE LOCATION:  $LOCATION" >> $LOCATION/$METAFILE
+  echo "PACKAGE SIZE (compressed):  $SIZE K" >> $LOCATION/$METAFILE
+  echo "PACKAGE SIZE (uncompressed):  $USIZE K" >> $LOCATION/$METAFILE
+  echo "PACKAGE REQUIRED:  $REQUIRED" >> $LOCATION/$METAFILE
+  echo "PACKAGE CONFLICTS:  $CONFLICTS" >> $LOCATION/$METAFILE
+  echo "PACKAGE SUGGESTS:  $SUGGESTS" >> $LOCATION/$METAFILE
+  echo "PACKAGE DESCRIPTION:" >> $LOCATION/$METAFILE
+
+  tar xzfO $1 install/slack-desc | grep -E '\w+\:'|grep -v '^#' >> $LOCATION/$METAFILE
+
+  echo "" >> $LOCATION/$METAFILE
+
+}
+
+# -----------------------------------------------
+#                 misc functions
+# -----------------------------------------------
+
 function slash {
 
   # remove additional slashes
-  echo $1 | sed -e 's/\/\+/\//g'
+  echo $* | sed -e 's/\/\+/\//g'
 
 }
 
index 66f079bb752a867faac281ef0437963d6b5c941a..88fe4a401e2bb5a2ab8aaae2050080045c744c10 100755 (executable)
@@ -6,7 +6,7 @@
 PACKAGE="simplepkg"
 PACK_DIR="package-$PACKAGE"
 BUILD=${BUILD:=1rha}
-VERSION="0.5pre7"
+VERSION="0.5pre8"
 ARCH="noarch"
 LIBEXEC="/usr/libexec/$PACKAGE"
 BINDIR="/usr/bin"
index 74ed684e58fefd92e03c0cb1548094a9c4b8f5af..c60de493d3d28a18638b4bdada302c06767eccde 100755 (executable)
@@ -16,6 +16,7 @@
 #  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 #  Place - Suite 330, Boston, MA 02111-1307, USA
 #
+
 function head_line {
     echo "usage: [ROOT=/otherroot] `basename $0` [option expression]"
 }
@@ -46,17 +47,17 @@ else
 fi
 
 if [ $# -eq 2 ]; then
-    LIST_PKGS=`ls /$ROOT/var/log/packages/$2-[0-9]* 2> /dev/null`
+    LIST_PKGS="`ls /$ROOT/var/log/packages/$2-[0-9]* 2> /dev/null`"
     if [ -z "$LIST_PKGS" ]; then
-        LIST_PKGS=`ls /$ROOT/var/log/packages/$2* 2> /dev/null`
+        LIST_PKGS="`ls /$ROOT/var/log/packages/$2* 2> /dev/null`"
     fi
 elif [ $# -eq 1 ]; then
-    LIST_PKGS=`ls /$ROOT/var/log/packages/$1-[0-9]* 2> /dev/null`
+    LIST_PKGS="`ls /$ROOT/var/log/packages/$1-[0-9]* 2> /dev/null`"
     if [ -z "$LIST_PKGS" ]; then
-        LIST_PKGS=`ls /$ROOT/var/log/packages/$1* 2> /dev/null`
+        LIST_PKGS="`ls /$ROOT/var/log/packages/$1* 2> /dev/null`"
     fi
 else
-    LIST_PKGS=`ls /$ROOT/var/log/packages/ 2> /dev/null`
+    LIST_PKGS="`ls /$ROOT/var/log/packages/ 2> /dev/null`"
 fi
 
 LIST_PKGS="`slash $LIST_PKGS`"
@@ -118,9 +119,9 @@ case $1 in
             echo "$LIST_PKGS"
         else
             if [ ! -z "$ROOT" ]; then
-                echo "$2: package not found on /$ROOT/var/log/packages"
+                echo "$1: package not found on /$ROOT/var/log/packages"
             else
-                echo "$2: package not found on /var/log/packages"
+                echo "$1: package not found on /var/log/packages"
             fi
         fi
     ;;
index c37e625c5f7a83e5f55cba687a08150236ff216b..191af44f69637f8e74ad7777aa1860868fbc0156 100755 (executable)
 #
 # Changes by rhatto at riseup.net to fit http://slack.sarava.org needs
 #
-# TODO: - simplepkg's config file support
+# TODO: - config file options
 #       - 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 {
+BASENAME="`basename $0`"
+REPOS_CONF="/etc/simplepkg/repos.conf"
+COMMON="/usr/libexec/simplepkg/common.sh"
 
-  find *meta -exec svn add {} 2> /dev/null \;
-  find . -name *meta -exec svn add {} 2> /dev/null \;
+if [ -f "$COMMON" ]; then
+  source $COMMON
+else
+  echo "error: file $COMMON found, check your $BASENAME installation"
+  exit 1
+fi
 
-}
-
-function gen_filelist {
-
-  local cwd
-
-  for file in `find | grep -e ".tgz$"`; do ls -l $file; done > FILELIST.TXT
-  echo "Created new FILELIST.TXT"
-  if [ -d "patches" ]; then
-    cwd="`pwd`"
-    cd patches  
-    for file in `find | grep -e ".tgz$"`; do ls -l $file; done > FILE_LIST
-    echo "Created new patches/FILE_LIST"
-    cd $pwd
-  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
-   echo "Created new PACKAGES.TXT and PACKAGES.TXT.gz"
-   if [ -d "patches" ]; then
-     find patches -type f -name '*.meta' -exec cat {} \; >> patches/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
-   echo "Created new CHECKSUMS.md5 and CHECKSUMS.md5.gz"
-   if [ -d "patches" ]; then
-     find patches -type f -name '*.tgz' -exec md5sum {} \; >> patches/CHECKSUMS.md5
-     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 {
+function usage {
 
-  if [ ! -f $1 ]; then
-    echo "File not found: $1"
-    exit 1;
-  else
-    echo "Processing $1"
-  fi
-  if [ "`echo $1|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).tgz[ ]{0,}$'`" == "" ]; then
-    return;
-  fi
-  NAME=$(echo $1|sed -re "s/(.*\/)(.*.tgz)$/\2/")
-  LOCATION=$(echo $1|sed -re "s/(.*)\/(.*.tgz)$/\1/")
-  SIZE=$( expr `gunzip -l $1 | tail -n 1|awk '{print $1}'` / 1024 )
-  USIZE=$( expr `gunzip -l $1 | tail -n 1|awk '{print $2}'` / 1024 )
-  REQUIRED=$(tar xzfO $1 install/slack-required 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
-  CONFLICTS=$(tar xzfO $1 install/slack-conflicts 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
-  SUGGESTS=$(tar xzfO $1 install/slack-suggests 2>/dev/null|xargs -r )
-  METAFILE=${NAME%tgz}meta
-  echo "PACKAGE NAME:  $NAME" > $LOCATION/$METAFILE
-  if [ -n "$DL_URL" ]; then
-    echo "PACKAGE MIRROR:  $DL_URL" >> $LOCATION/$METAFILE
-  fi
-  echo "PACKAGE LOCATION:  $LOCATION" >> $LOCATION/$METAFILE
-  echo "PACKAGE SIZE (compressed):  $SIZE K" >> $LOCATION/$METAFILE
-  echo "PACKAGE SIZE (uncompressed):  $USIZE K" >> $LOCATION/$METAFILE
-  echo "PACKAGE REQUIRED:  $REQUIRED" >> $LOCATION/$METAFILE
-  echo "PACKAGE CONFLICTS:  $CONFLICTS" >> $LOCATION/$METAFILE
-  echo "PACKAGE SUGGESTS:  $SUGGESTS" >> $LOCATION/$METAFILE
-  echo "PACKAGE DESCRIPTION:" >> $LOCATION/$METAFILE
-  tar xzfO $1 install/slack-desc | grep -E '\w+\:'|grep -v '^#' >> $LOCATION/$METAFILE
-  echo "" >> $LOCATION/$METAFILE
+  echo "`basename $0` [pkg [file]|all|new|svnmeta|PACKAGESTXT|FILELIST|MD5]"
 
 }
 
index 2f6874365b7a80212eaf3dc4f277319ad4bd1537..4081f5e3ba1882490f50f06c10ff382cd3ee0ca2 100755 (executable)
@@ -474,7 +474,7 @@ function simplaret_get {
   # get a package
   # usage: simplaret_get <package-name> [--silent]
 
-  local silent
+  local silent generate_patches
 
   # prevent user to stay in $storage
   cd 
@@ -512,6 +512,7 @@ function simplaret_get {
       if [ "$repos_type" == "root" ] && \
          [ "$STORE_ROOT_PATCHES_ON_PATCHES_DIR" == "1" ] && echo $file | grep -q "patches"; then
         folder="$PATCHES_DIR/$ARCH/$VERSION/root-$repository_name"
+        generate_patches="1"
       else
         folder="$storage/$repository_name"
       fi
@@ -555,6 +556,10 @@ function simplaret_get {
         if [ -f "$folder/$candidate.asc" ] || [ "$SIGNATURE_CHECKING" == "1" ]; then
           gpg --verify $folder/$candidate.asc $folder/$candidate
         fi
+        # generate the patches FILE_LIST if needed
+        if [ "$generate_patches" == "1" ]; then
+          gen_patches_filelst $folder
+        fi
         simplaret_checksum $storage/$repository_name/CHECKSUMS.md5 $folder/$candidate $silent
         return $?
       fi