]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
simplepkg 0.4.9pre6
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 19 Oct 2006 17:52:38 +0000 (17:52 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 19 Oct 2006 17:52:38 +0000 (17:52 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@20 04377dda-e619-0410-9926-eae83683ac58

conf/repos.conf.new
doc/CHANGELOG
simplepkg.SlackBuild
src/createpkg

index 34abc697b18ab9b24925aea20269c194eee5afdc..66a499ecb26cdbca0aa817cef645ee193506f59a 100644 (file)
@@ -1,11 +1,22 @@
-# repositories definitions
+#
+# repositories definitions for simplaret
+#
 
-# 10.2
-#ROOT-i386="http://slackware.cs.utah.edu/"
+# root repositories
+ROOT-i386="http://slackware.mirrors.tds.net/pub/slackware/"
 ROOT-i386="http://slack.sarava.org/slackware/"
+ROOT-x86_64="http://mirror1.slackadelic.com/slamd64/"
 ROOT-x86_64="http://ftp.heanet.ie/pub/slamd64/"
+
+# 10.2
 REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/"
 REPOS-i386-10.2="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/"
 REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/"
 REPOS-x86_64-10.2="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/"
 
+# 11.0
+REPOS-i386-11.0="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-11.0/"
+REPOS-i386-11.0="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/"
+REPOS-x86_64-11.0="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-11.0/"
+REPOS-x86_64-11.0="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/"
+
index d143b1fe17274e95ba5dd0d56426d14f9892f13c..5a795cc1e3ab23735130ff77a5c44929ce3d8566 100644 (file)
@@ -1,9 +1,14 @@
 simplepkg changelog
 -------------------
 
-20061013 - small fixes on rebuildpkg 
+0.4.9pre6: createpkg:
+             - fixes
+             - now with slackbuild error handling
+             - increased verbosity
+           small fixes on rebuildpkg 
            lspkg enhancements
            simplaret fix on --purge
+           updated default repos.conf
 
 0.4.9pre5: added script "repos"
            moved simplaret to /usr/bin
index bb087f65ee89921bd89c4da758be3d601c904cba..1eab6746e1fdfceefd558df67b94f1e6b49fc30b 100755 (executable)
@@ -6,7 +6,7 @@
 PACKAGE="simplepkg"
 PACK_DIR="package-$PACKAGE"
 BUILD="1rha"
-VERSION="0.4.9"
+VERSION="0.4.9pre6"
 ARCH="noarch"
 LIBEXEC="/usr/libexec/$PACKAGE"
 BINDIR="/usr/bin"
index c38b17a823755f8ec66ad7f939becdd16c00f8f5..c7b35a813dbaec51738c29f9f496163e52463d7a 100644 (file)
 COMMON="/usr/libexec/simplepkg/common.sh"
 SLACKBUILDRC="/etc/slackbuildrc"
 
-# firts load simplepkg helper functions
+# first load simplepkg helper functions
 if [ -f "$COMMON" ]; then
   source $COMMON
 else
-  echo "error: file $COMMON found, check your `basename $0` installation"
+  echo "error: file $COMMON found, check your $BASENAME installation"
   exit 1
 fi
 
-function safe_exit {
+function handle_error {
 
   # this function deals with internal createpkg errors
-  # and also non-zero exit codes from slackbuilds
+  # and also with non-zero exit codes from slackbuilds
 
   # check slackbuild exit status are:
   #
   # ERROR_WGET=31;      ERROR_MAKE=32;      ERROR_INSTALL=33
   # ERROR_MD5=34;       ERROR_CONF=35;      ERROR_HELP=36
-  # ERROR_TAR=37;       ERROR_MKPKG=38      ERROR_GPG=?
-  # ERROR_PATCH=?
-  # Thanks to Rudson rudsonalves at yahoo.com.br for this spec.
+  # ERROR_TAR=37;       ERROR_MKPKG=38      ERROR_GPG=39
+  # ERROR_PATCH=40;     ERROR_VCS=41
+  #
+  # thanks to rudsonalves at yahoo.com.br for this spec.
+
+  # we don't want to process when exit status = 0
+  if [ "$1" == "0" ]; then
+    return
+  fi
 
   # exit codes
   case $1 in
     2) usage ;;
-    3) echo Could not update the repository $2 ;;
-    4) echo Could not create folder $2 ;;
-    5) echo Script not found ;;
-   31) echo Error downloading package ;;
-   32) echo Error compiling the program ;;
-   33) echo Error installing program ;;
-   34) echo Error on source code integrity check ;;
-   35) echo Error configuring the program ;;
+    3) echo $BASENAME: could not update the repository $2 ;;
+    4) echo $BASENAME: could not create folder $2 ;;
+    5) echo $BASENAME: script not found for $2 ;;
+   31) echo $BASENAME: error downloading source for $2 ;;
+   32) echo $BASENAME: error compiling $2 source code ;;
+   33) echo $BASENAME: error installing $2 ;;
+   34) echo $BASENAME: error on source code integrity check for $2 ;;
+   35) echo $BASENAME: error configuring the source code for $2 ;;
    36) exit 0 ;; # its supposed to never happen here :P
-   37) echo Error decompressing source code  ;;
-   38) echo Error creating the package ;;
-    *) exit 1
+   37) echo $BASENAME: error decompressing source code for $2 ;;
+   38) echo $BASENAME: error creating package $2 ;;
+   39) echo $BASENAME: error verifying GPG signature the source code for $2 ;;
+   40) echo $BASENAME: error patching the source code for $2 ;;
+   41) echo $BASENAME: error downloading $2 source from version control system ;; 
+    *) echo $BASENAME: unknown error or user interrupt
   esac
 
   exit $1
@@ -72,7 +81,7 @@ function build_repo {
   # checkout a new slackbuild working copy 
 
   BASEDIR="`dirname $SLACKBUILDS`"
-  mkdir -p $BASEDIR || safe_exit 4 $BASEDIR
+  mkdir -p $BASEDIR || handle_error 4 $BASEDIR
   cd $BASEDIR
   svn checkout $SVN
   cd $SLACKBUILDS
@@ -129,9 +138,14 @@ function solve_dep {
   done
 
   if [ "$found" != "1" ]; then
-    createpkg --install $pack
+    echo $BASENAME: processing $PACKAGE dependency $pack
+    SYNC=no CREATEPKG_CHILD=$CREATEPKG_CHILD createpkg --install $pack
     # check if the package was built and installed
-    check_exit_status $?
+    exit_code="$?"
+    if [ "$exit_code" != "0" ]; then
+      echo $BASENAME: received an error when processing $pack, aborting
+      exit $exit_code
+    fi
   else
     found="0"
   fi
@@ -159,21 +173,20 @@ function find_script {
 
 }
 
-function check_exit_status {
-
-  # check whether exit status is 0 or not
-  # if not, call safe_exit to end the program
+# this is used to show how many children process we have
+if [ -z "$CREATEPKG_CHILD" ]; then
+  CREATEPKG_CHILD="1"
+else
+  CREATEPKG_CHILD="`echo $CREATEPKG_CHILD + 1 | bc -l`"
+fi
 
-  if [ "$1" != "0" ]; then
-    safe_exit $1
-  fi
-}
+BASENAME="`basename $0`[$CREATEPKG_CHILD]"
 
 check_config
 check_repo
 
 if [ -z "$1" ]; then
-  safe_exit 2
+  handle_error 2
 elif [ "$#" == "2" ]; then
   if [ "$1" == "--search" ]; then
     find_script $2
@@ -185,7 +198,7 @@ elif [ "$#" == "2" ]; then
     NO_DEPS="1"
     PACKAGE="$2"
   else
-    safe_exit 2
+    handle_error 2
   fi
 elif [ "$1" == "--sync" ]; then
   sync_repo 
@@ -193,7 +206,7 @@ elif [ "$1" == "--sync" ]; then
 elif [ "${1:0:1}" != "-" ]; then
   PACKAGE="$1"
 else
-  safe_exit 2
+  handle_error 2
 fi
 
 if [ "$SYNC" == "yes" ]; then
@@ -203,7 +216,7 @@ fi
 BUILD_SCRIPT="`find_script $PACKAGE`"
 
 if [ -z "$BUILD_SCRIPT" ]; then
-  safe_exit 5
+  handle_error 5 $PACKAGE
 fi
 
 SCRIPT_BASE="`dirname $BUILD_SCRIPT`"
@@ -215,43 +228,36 @@ elif [ -f "$SCRIPT_BASE/slack-required" ]; then
   SLACK_REQ="$SCRIPT_BASE/slack-required"
 fi
 
+echo $BASENAME: found script $PACKAGE.SlackBuild, now checking for dependencies
+
 if [ ! -z "$SLACK_REQ" ] && [ "$NO_DEPS" != "1" ]; then
 
   # this routine checks for dependencies in package's slack-required
 
-  cat $SLACK_REQ | while read dep; do
+  while read dep; do
     if [ ! -z "$dep" ]; then
       program="`echo $dep | awk '{ print $1 }'`"
       condition="`echo $dep | awk '{ print $2 }' | sed -e 's/>=/equalorgreater/' -e 's/=</equalorless/' -e 's/</less/' -e 's/>/greater/' -e 's/=/equal/'`"
       version="`echo $dep | awk '{ print $3 }' | tr -dc '[:digit:]'`"
       solve_dep $program $condition $version
     fi
-  done
+  done < <( cat $SLACK_REQ )
 
 fi
 
+echo $BASENAME: processing `basename $BUILD_SCRIPT`
+
 # built package
 cd $SCRIPT_BASE
 INTERACT=no ./`basename $BUILD_SCRIPT`
 
 # check if package was built
-check_exit_status $?
-
-# this doesn't work always
-#
-# VERSION="`grep -e '^VERSION=' $BUILD_SCRIPT | head -n 1 | sed -e "s/VERSION//g" -e 's/=//g' -e 's/-//g' | cut -d ":" -f 2 | cut -d "}" -f 1`"
-# BUILD="`grep -e '^BUILD=' $BUILD_SCRIPT | head -n 1 | sed -e "s/BUILD//g" -e 's/=//g' | cut -d ":" -f 2 | cut -d "}" -f 1`"
-# _ARCH="`grep -e '^ARCH' $BUILD_SCRIPT | head -n 1 | cut -d "=" -f 2 | sed -e 's/"//g'`"
-#
-# if [ "$_ARCH" == "noarch" ]; then
-#  ARCH="noarch"
-# fi
+handle_error $? $PACKAGE
 
 if [ "$INSTALL" == "1" ]; then
-  # we can do the following cause we dont have the full package name:
-  # upgradepkg --install-new $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz
-
-  # so we do this:
-  upgradepkg --install-new $REPOS/$PACKAGE-*-*-*tgz
+  # as we dont have the full package file name, we'll
+  # use the newer file name that matches our wildcard:
+  PACKAGE="`ls -1 -c $REPOS/$PACKAGE-*-*-*tgz | head -n 1`"
+  upgradepkg --install-new $PACKAGE
 fi