diff options
author | rudson <rudson@04377dda-e619-0410-9926-eae83683ac58> | 2007-12-01 01:16:52 +0000 |
---|---|---|
committer | rudson <rudson@04377dda-e619-0410-9926-eae83683ac58> | 2007-12-01 01:16:52 +0000 |
commit | 76cb2a284631a2354a368320234b16f4316fd137 (patch) | |
tree | 5b945dc8435be4407f3d7abec746510ac5586b05 /trunk/src/createpkg | |
parent | 246475541fd2d6cb4a5e96010191f2ebaf841a23 (diff) | |
download | simplepkg-76cb2a284631a2354a368320234b16f4316fd137.tar.gz simplepkg-76cb2a284631a2354a368320234b16f4316fd137.tar.bz2 |
Várias alterações. Ver trunk/doc/CHANGELOG
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@461 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src/createpkg')
-rw-r--r-- | trunk/src/createpkg | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 2f647a7..a08750e 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -26,7 +26,7 @@ # Createpkg functions #--------------------------------------------------- -CREATEPKG_VERSION="1.1.8" +CREATEPKG_VERSION="1.1.9" function usage { @@ -42,6 +42,18 @@ function usage { exit } +function build_all_slackbuild { + + # Build all SlackBuilds in repository + createpkg --sync + + cd $SLACKBUILDS_DIR + LIST=`find . -name *.SlackBuild | sed 's/.*\/\(.*\)\.SlackBuild$/\1/' | sort | uniq` + for i in $LIST; do + [ ! lspkg $i >/dev/null ] && createpkg -i $i + done +} + function check_config { # check the configuration @@ -66,6 +78,7 @@ function check_config { function solve_dep { # Solve dependency + [ $# -ne 3 ] && handle_error $ERROR_PAR_NUMBER local PACK="$1" local COND="$2" local VER="$3" @@ -82,20 +95,15 @@ function solve_dep { eecho $messag "$BASENAME: processing $PACKAGE dependency $PACK" SYNC=$no CREATEPKG_CHILD=$CREATEPKG_CHILD createpkg --install $PACK - # check if the package was built and installed - EXIT_CODE="$?" + # Check if the package was built and installed + EXIT_CODE=$? - if [ "$EXIT_CODE" == "5" ]; then - # exit code 5 == slackbuild not found - # try to use simplaret + if [ $EXIT_CODE -eq $ERROR_CREATEPKG_SLACKBUILD_NOTFOUND ]; then + # Try to use simplaret ARCH=$CREATE_ARCH simplaret --update ARCH=$CREATE_ARCH simplaret --install $PACK - EXIT_CODE="$?" - if [ "$EXIT_CODE" != "0" ]; then - handle_error $ERROR_CREATEPKG_SLACKBUILD_NOTFOUND $PACK - fi - - elif [ "$EXIT_CODE" != "0" ]; then + [ $? -ne 0 ] && handle_error $ERROR_CREATEPKG_SLACKBUILD_NOTFOUND $PACK + elif [ $EXIT_CODE -ne 0 ]; then handle_error $EXIT_CODE $PACK fi @@ -107,6 +115,7 @@ function solve_dep { function find_slackbuild { # Find SlackBuild script in the repository + [ $# -ne 1 ] && handle_error $ERROR_PAR_NUMBER find $SLACKBUILDS_DIR -iname $1.SlackBuild } @@ -243,16 +252,21 @@ INSTALL=$off NO_DEPS=$off case $1 in + '--all'|'-a') + # build all SlackBuilds in repository + build_all_slackbuild + exit 0 + ;; '--search'|'-s') [ $# -ne 2 ] && usage # two parameters is required find_slackbuild $2 - exit + exit 0 ;; '--info'|'-f') [ $# -ne 2 ] && usage # two parameters is required PKG_PATH=`find_slackbuild $2` info_builds - exit + exit 0 ;; '--install'|'-i') [ $# -ne 2 ] && usage # two parameters is required @@ -315,7 +329,6 @@ if [ "`echo $BUILD_SCRIPT | wc -w`" -gt 1 ]; then BUILD_SCRIPT=`echo $BUILD_SCRIPT | sed 's/ /\n/g' | grep "/$PACKAGE.SlackBuild"` PS3="$AUX" else - #PACKAGE=`echo $BUILD_SCRIPT | sed -r 's/.*\/(.*)\.SlackBuild$/\1/'` PACKAGE=`basename $BUILD_SCRIPT .SlackBuild` fi @@ -332,7 +345,7 @@ elif [ -f "$SCRIPT_BASE/slack-required" ]; then fi if [ ! -z "$SLACK_REQUIRED" -a $NO_DEPS -ne $on ]; then - # this routine checks for dependencies in package's slack-required + # This routine checks for dependencies in package's slack-required ( grep '^[^#]' $SLACK_REQUIRED | while read dep; do if [ ! -z "$dep" ]; then PROGRAM="`echo $dep | awk '{ print $1 }'`" @@ -342,10 +355,8 @@ if [ ! -z "$SLACK_REQUIRED" -a $NO_DEPS -ne $on ]; then fi true done ) - if [ $? -ne 0 ]; then - eecho $messag "$BASENAME: dependency solve error" - exit 1 - fi + [ $? -ne 0 ] && handle_error $error $ERROR_CREATEPKG_DEPENDENCY + eecho $messag "$BASENAME: done checking for $PACKAGE dependencies" else eecho $messag "$BASENAME: no unmet dependencies for $PACKAGE" |