aboutsummaryrefslogtreecommitdiff
path: root/branches/0.6/src/createpkg
diff options
context:
space:
mode:
Diffstat (limited to 'branches/0.6/src/createpkg')
-rw-r--r--branches/0.6/src/createpkg47
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