From 4659a348863b8c34d8597af2858a8c3b17447736 Mon Sep 17 00:00:00 2001 From: rudson Date: Sun, 15 Apr 2007 21:08:30 +0000 Subject: createpkg-1.0.4.1: renomeando SLACKBUILDS_DIR git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@345 04377dda-e619-0410-9926-eae83683ac58 --- trunk/src/createpkg | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'trunk/src') diff --git a/trunk/src/createpkg b/trunk/src/createpkg index e87b37a..a80b033 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -17,7 +17,7 @@ # # /etc/simplepkg/slackbuildrc parameters: # -# SLACKBUILDS="/folder/to/place/slackbuilds", defaults to /var/slackbuilds +# SLACKBUILDS_DIR="/folder/to/place/slackbuilds", defaults to /var/slackbuilds # SVN="svn://repository", defaults do svn://slack.sarava.org/slackbuilds # SYNC="yes|no", whether to always update the repository # @@ -31,7 +31,7 @@ # Createpkg functions #--------------------------------------------------- -CREATEPKG_VERSION="1.0.4" +CREATEPKG_VERSION="1.0.4.1" function error_codes { @@ -130,11 +130,11 @@ function handle_error { function build_repo { # Checkout a new slackbuild working copy - BASEDIR="`dirname $SLACKBUILDS`" + BASEDIR="`dirname $SLACKBUILDS_DIR`" mkdir -p $BASEDIR || handle_error 4 $BASEDIR cd $BASEDIR svn checkout $SVN - cd $SLACKBUILDS + cd $SLACKBUILDS_DIR } @@ -160,14 +160,15 @@ function check_config { [ ! -e $TPM ] && mkdir $TMP [ ! -e $REPOS ] && mkdir $REPOS # - SLACKBUILDS=${SLACKBUILDS:=/var/slackbuilds} + SLACKBUILDS_DIR=${SLACKBUILDS_DIR:=/var/slackbuilds} SVN=${SVN:=svn://slack.sarava.org/slackbuilds} SYNC=${SYNC:=no} - BASEDIR="`dirname $SLACKBUILDS`" + BASEDIR="`dirname $SLACKBUILDS_DIR`" } function solve_dep { + # Solve dependency local PACK="$1" local COND="$2" @@ -211,14 +212,14 @@ function solve_dep { function check_repo { # Verify if repository exist - [ ! -d "$SLACKBUILDS" ] && build_repo + [ ! -d "$SLACKBUILDS_DIR" ] && build_repo } function sync_repo { # Synchronize repository - cd $SLACKBUILDS + cd $SLACKBUILDS_DIR svn update || build_repo #simplaret --update @@ -227,7 +228,7 @@ function sync_repo { function find_slackbuild { # Find SlackBuild script in the repository - find $SLACKBUILDS -iname $1.SlackBuild + find $SLACKBUILDS_DIR -iname $1.SlackBuild } @@ -261,7 +262,7 @@ function info_builds { function list_builds { # List all available SlackBuilds - cd $SLACKBUILDS + cd $SLACKBUILDS_DIR echo "Sarava SlackBuilds list" # level 1 for i in *; do @@ -295,9 +296,11 @@ function list_builds { ) fi done + } function color_select { + # Select color mode: gray, color or none (*) # commun - Communication # messag - Commum messages @@ -326,6 +329,7 @@ function color_select { normal="" ;; esac + } #--------------------------------------------------- @@ -426,13 +430,16 @@ if [ "`echo $BUILD_SCRIPT | wc -w`" -gt 1 ]; then AUX="$PS3" PS3="Choice: " LIST=`echo $BUILD_SCRIPT | sed 's/ /\n/g' | sed -r 's/.*\/(.*)\.SlackBuild$/\1/'`" EXIT" + select PACKAGE in `echo $LIST`; do break done + if [ "$PACKAGE" = "EXIT" ]; then eecho $error "error: None package select" exit 1 fi + # Select only one SlackBuild in BUILD_SCRIPT BUILD_SCRIPT=`echo $BUILD_SCRIPT | sed 's/ /\n/g' | grep "/$PACKAGE.SlackBuild"` PS3="$AUX" @@ -475,18 +482,16 @@ fi eecho $messag "$BASENAME: processing $SCRIPT_NAME" -# Built package +# Change to script base directory cd $SCRIPT_BASE + # Execute SlackBuild script with variables protection ( INTERACT=no sh ./$SCRIPT_NAME ) # Check if package was built handle_error $? $PACKAGE -PKG_TGZ="`ls -1 -c $REPOS/$PACKAGE-*-*-*tgz | head -n 1`" - -#mkdir -p $REPOS${SCRIPT_BASE/$SLACKBUILDS} -#mv $PKG_TGZ $REPOS${SCRIPT_BASE/$SLACKBUILDS}/ +PKG_TGZ="`ls -1 -c $REPOS/$PACKAGE-*-*-*.tgz | head -n 1`" if [ "$INSTALL" == "1" ]; then # as we dont have the full package file name, we'll -- cgit v1.2.3