diff options
author | rudson <rudson@04377dda-e619-0410-9926-eae83683ac58> | 2007-04-21 16:37:55 +0000 |
---|---|---|
committer | rudson <rudson@04377dda-e619-0410-9926-eae83683ac58> | 2007-04-21 16:37:55 +0000 |
commit | d0a7843a8bbd5b6b9f9bb9b238f405c222e4aa39 (patch) | |
tree | 766dc79bf3010bd7ab9dd512ed145c45bfc746c9 /branches/0.6/src/createpkg | |
parent | 1a90f0e5e1486f3303e5d11053a841b67970a115 (diff) | |
download | simplepkg-d0a7843a8bbd5b6b9f9bb9b238f405c222e4aa39.tar.gz simplepkg-d0a7843a8bbd5b6b9f9bb9b238f405c222e4aa39.tar.bz2 |
atualizações ao branches/0.6
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@356 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'branches/0.6/src/createpkg')
-rw-r--r-- | branches/0.6/src/createpkg | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/branches/0.6/src/createpkg b/branches/0.6/src/createpkg index 03612a9..757972e 100644 --- a/branches/0.6/src/createpkg +++ b/branches/0.6/src/createpkg @@ -31,7 +31,24 @@ # Createpkg functions #--------------------------------------------------- -CREATEPKG_VERSION="1.0.5" +CREATEPKG_VERSION="1.0.5.1" + +# Start common.sh functions +COMMON="/usr/libexec/simplepkg/common.sh" +BASENAME="`basename $0`" + +if [ -f "$COMMON" ]; then + source $COMMON +else + echo "error: file $COMMON found, check your $BASENAME installation" + mk_exit 0 +fi + +# Load simplepkg.conf variables +eval_config $BASENAME + +# Enable debug mode +#set -x function error_codes { @@ -140,7 +157,7 @@ function build_repo { function usage { - # Help mensage + # Help message eecho $commun "Createpkg version $CREATEPKG_VERSION\n" eecho $commun "Usage: createpkg [--install/-i] package-name" eecho $commun " createpkg --no-deps/-np package-name" @@ -485,27 +502,31 @@ eecho $messag "$BASENAME: processing $SCRIPT_NAME" # 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 + +# Get package name +PKG_NAME="`ls -1 -c $REPOS/$PACKAGE-*-*-*.tgz | head -n 1 | xargs basename`" + # Select repository directory NEW_REPOS=$REPOS/$( echo ${SCRIPT_BASE#$SLACKBUILDS_DIR/} ) # Create repository directory [ ! -e $NEW_REPOS ] && mkdir -p $NEW_REPOS 2>/dev/null +# Remove old packages from repository tree +[ $REMOVE_OLD_PACKAGE -eq 0 ] && rm $NEW_REPOS/$PACKAGE-*-*-*.tgz 2>/dev/null -# Remove old-versions -rm $NEW_REPOS/$PACKAGE-*-*-*.tgz 2>/dev/null - -# Execute SlackBuild script with variables protection -( INTERACT=no REPOS=$NEW_REPOS sh ./$SCRIPT_NAME ) - -# Check if package was built -handle_error $? $PACKAGE - -PKG_TGZ="`ls -1 -c $NEW_REPOS/$PACKAGE-*-*-*.tgz | head -n 1`" +# Move package to SlackBuilds-like tree +[ $MOVE_BIN_PACKAGE -eq 0 ] && mv $REPOS/$PKG_NAME $NEW_REPOS/ +# Install package if [ "$INSTALL" == "1" ]; then # as we dont have the full package file name, we'll # use the newer file name that matches our wildcard: - upgradepkg --install-new $PKG_TGZ + upgradepkg --install-new $NEW_REPOS/$PKG_NAME fi |