diff options
Diffstat (limited to 'branches/0.6/src/createpkg')
-rw-r--r-- | branches/0.6/src/createpkg | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/branches/0.6/src/createpkg b/branches/0.6/src/createpkg index 860a684..373c8cc 100644 --- a/branches/0.6/src/createpkg +++ b/branches/0.6/src/createpkg @@ -31,7 +31,7 @@ # Createpkg functions #--------------------------------------------------- -CREATEPKG_VERSION="1.1.0" +CREATEPKG_VERSION="1.1.1" function error_codes { @@ -152,7 +152,8 @@ function check_config { # SLACKBUILDS_DIR=${SLACKBUILDS_DIR:=/var/slackbuilds} SVN=${SVN:=svn://slack.sarava.org/slackbuilds} - SYNC=${SYNC:=no} + SYNC=${SYNC:=$no} + SYNC=`convert_boolean $SYNC` BASEDIR="`dirname $SLACKBUILDS_DIR`" } @@ -174,7 +175,7 @@ function solve_dep { if [ $CHECK -ne 0 ]; then # Check package in SlackBuilds tree eecho $messag "$BASENAME: processing $PACKAGE dependency $PACK" - SYNC=no CREATEPKG_CHILD=$CREATEPKG_CHILD createpkg --install $PACK + SYNC=$no CREATEPKG_CHILD=$CREATEPKG_CHILD createpkg --install $PACK # check if the package was built and installed EXIT_CODE="$?" @@ -297,11 +298,11 @@ function load_parameters { SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/simplaret/slackbuilds`" COLOR_MODE="`eval_parameter COLOR_MODE none`" - CREATE_ARCH="`eval_parameter CREATE_ARCH i486`" - CREATE_CLEANUP="`eval_parameter CREATE_CLEANUP 'yes'`" + CREATE_ARCH="`eval_parameter CREATE_ARCH $(default_arch)`" + CREATE_CLEANUP="`eval_boolean_parameter CREATE_CLEANUP $yes`" - REMOVE_OLD_PACKAGE="`eval_parameter REMOVE_OLD_PACKAGE off`" - MOVE_BIN_PACKAGE="`eval_parameter MOVE_BIN_PACKAGE off`" + REMOVE_OLD_PACKAGE="`eval_boolean_parameter REMOVE_OLD_PACKAGE $off`" + MOVE_BIN_PACKAGE="`eval_boolean_parameter MOVE_BIN_PACKAGE $off`" } #--------------------------------------------------- @@ -319,6 +320,8 @@ else mk_exit 0 fi +set_constants + # Load simplepkg.conf variables load_parameters #eval_config $BASENAME @@ -326,13 +329,6 @@ load_parameters # Loading error codes error_codes -# First load simplepkg helper functions -#source $COMMON && source $SIMPLEPKG_CONF -#if [ $? -ne 0 ]; then -# eecho $error "error: file $COMMON not found, check your $BASENAME installation" -# exit 1 -#fi - # Load slackbuildrc definitions if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc @@ -355,7 +351,8 @@ BASENAME="`basename $0`[$CREATEPKG_CHILD]" check_config check_repo -INSTALL=off +INSTALL=$off +NO_DEPS=$off case $1 in '--search'|'-s') @@ -372,11 +369,11 @@ case $1 in '--install'|'-i') [ $# -ne 2 ] && handle_error 2 # two parameters is required PACKAGE="$2" - INSTALL="on" + INSTALL=$on ;; '--no-deps'|'-nd') [ $# -ne 2 ] && handle_error 2 # two parameters is required - NO_DEPS="1" + NO_DEPS=$on PACKAGE="$2" ;; '--sync') @@ -401,7 +398,7 @@ case $1 in esac # Synchronize repository -[ "$SYNC" == "yes" ] && sync_repo +[ $SYNC -eq $yes ] && sync_repo # Get SlackBuild script BUILD_SCRIPT="`find_slackbuild $PACKAGE`" @@ -446,7 +443,7 @@ elif [ -f "$SCRIPT_BASE/slack-required" ]; then SLACK_REQUIRED="$SCRIPT_BASE/slack-required" fi -if [ ! -z "$SLACK_REQUIRED" -a "$NO_DEPS" != "1" ]; then +if [ ! -z "$SLACK_REQUIRED" -a $NO_DEPS -ne $on ]; then # this routine checks for dependencies in package's slack-required ( grep '^[^#]' $SLACK_REQUIRED | while read dep; do if [ ! -z "$dep" ]; then @@ -492,19 +489,19 @@ handle_error $? $PACKAGE PKG_NAME="`ls -1 -c $MAKEPKG_REPOS/$PACKAGE-*-*-*.tgz | head -n 1 | xargs basename`" # Select repository directory -[ $MOVE_BIN_PACKAGE == on ] && NEW_REPOS=$MAKEPKG_REPOS/$( echo ${SCRIPT_BASE#$SLACKBUILDS_DIR/} ) || NEW_REPOS=$MAKEPKG_REPOS +[ $MOVE_BIN_PACKAGE -eq $on ] && NEW_REPOS=$MAKEPKG_REPOS/$( echo ${SCRIPT_BASE#$SLACKBUILDS_DIR/} ) || NEW_REPOS=$MAKEPKG_REPOS # Create repository directory [ ! -e $NEW_REPOS ] && mkdir -p $NEW_REPOS 2>/dev/null # Remove old packages from repository tree -[ $REMOVE_OLD_PACKAGE == on ] && rm $NEW_REPOS/$PACKAGE-*-*-*.tgz 2>/dev/null +[ $REMOVE_OLD_PACKAGE -eq $on ] && rm $NEW_REPOS/$PACKAGE-*-*-*.tgz 2>/dev/null # Move package to SlackBuilds-like tree -[ $MOVE_BIN_PACKAGE == on ] && mv $MAKEPKG_REPOS/$PKG_NAME $NEW_REPOS/ +[ $MOVE_BIN_PACKAGE -eq $on ] && mv $MAKEPKG_REPOS/$PKG_NAME $NEW_REPOS/ # Install package -if [ $INSTALL == on ]; then +if [ "$INSTALL" -eq $on ]; then # as we dont have the full package file name, we'll # use the newer file name that matches our wildcard: |