aboutsummaryrefslogtreecommitdiff
path: root/branches
diff options
context:
space:
mode:
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-06-16 06:09:39 +0000
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-06-16 06:09:39 +0000
commit5472c3f7264f2ef9e1b16707c81a16beb39113a0 (patch)
tree7f1c34cb5d3972a449a789e1ca1a4dc19ea51cfd /branches
parent16b7a652226aa1646a59bdebeee520465e171e8d (diff)
downloadsimplepkg-5472c3f7264f2ef9e1b16707c81a16beb39113a0.tar.gz
simplepkg-5472c3f7264f2ef9e1b16707c81a16beb39113a0.tar.bz2
mkbuild-0.9.4: adição da opção --commit
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@388 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'branches')
-rwxr-xr-xbranches/0.6/src/mkbuild58
1 files changed, 53 insertions, 5 deletions
diff --git a/branches/0.6/src/mkbuild b/branches/0.6/src/mkbuild
index 7d85d34..9e3ba5a 100755
--- a/branches/0.6/src/mkbuild
+++ b/branches/0.6/src/mkbuild
@@ -9,8 +9,8 @@
# SlackBuilds são scripts utilizados no Slackware para gerar
# pacotes tgz.
#
-# Version 0.9.3
-PROG_VERSION=0.9.3
+# Version 0.9.4
+PROG_VERSION=0.9.4
#--------------------------------------------------------------------
# Functions
@@ -54,8 +54,8 @@ DESCRIPTION
Program options:
-h, --help
this help mesage
- -s, --show
- show output files
+ -c, --commit
+ commit slackbuild
-v, --version
program version
@@ -138,6 +138,10 @@ function set_parameters {
# get parameter[i]
PAR=${ALL_PAR[$i]}
case $PAR in
+ '-c'|'--commit')
+ # Commit directory
+ COMMIT=1
+ ;;
'-d'|'--debug')
# Debug mode
set -x
@@ -328,6 +332,7 @@ function activate_sections {
function build_slackbuild {
# Remove off sections
+ [ -e $SLACKBUILD ] && mv $SLACKBUILD $SLACKBUILD.old
sed '/^<[a-z].*> off/, /^<\/[a-z].*>$/ d' $SLACKBUILD_TEMP > $AUX_TMP
# Remove sections names
sed '/^<.*$/ d' $AUX_TMP > $SLACKBUILD_TEMP
@@ -393,7 +398,7 @@ function section_change {
function make_slack_required {
# Build slack-required file
- rm slack-required 2>/dev/null
+ [ -e slack-required ] && mv slack-required slack-required.old
[ -z "$SLACK_REQUIRED" ] && return 0
echo -e "# Dependency list to broffice\n#\n# dependency [condition] [version]]" > slack-required
@@ -416,9 +421,49 @@ function change_others_fields {
done
}
+function commit_slackbuild {
+
+ AUX=`lynx -dump http://gentoo-portage.com/Search?search=$PKG_NAME | sed -n '/Results:/,+1 { /Results:/ b ; p }' | head --lines=1 | tr -d " "`
+ [ -z $AUX ] && echo $SLACKBUILD path not found! && return 0
+
+ SLACKBUILD_PATH="`dirname $AUX | tr - /`/`basename $AUX`"
+
+ if [ -e $SLACKBUILDS_DIR/$SLACKBUILD_PATH/$SLACKBUILD ]; then
+ echo "$SLACKBUILD_PATH/$SLACKBUILD exist!"
+ else
+ cp $SLACKBUILD $SLACKBUILDS_DIR/$SLACKBUILD_PATH/
+ echo "copy $SLACKBUILD to $SLACKBUILDS_DIR/$SLACKBUILD_PATH/"
+ fi
+
+ if [ -e $SLACKBUILDS_DIR/$SLACKBUILD_PATH/slack-required ]; then
+ echo "$SLACKBUILD_PATH/slack-required exist!"
+ else
+ cp slack-required $SLACKBUILDS_DIR/$SLACKBUILD_PATH/
+ echo "copy slack-required to $SLACKBUILDS_DIR/$SLACKBUILD_PATH/"
+ fi
+}
+
+
#=============================
# Main Program
#=============================
+#-----------------------------
+# Common functions
+COMMON="/usr/libexec/simplepkg/common.sh"
+SIMPLEPKG_CONF="/etc/simplepkg/simplepkg.conf"
+
+if [ -f "$COMMON" ]; then
+ source $COMMON
+else
+ echo "error: file $COMMON found, check your $BASENAME installation"
+ mk_exit 0
+fi
+
+# createpkg and mkbuild section
+SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/slackbuilds`"
+#MAKEPKG_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplaret/binaries`"
+#-----------------------------
+
# Start variables
DOWNLOAD_SOURCE=0 # desable download source
# Auxiliar file
@@ -554,3 +599,6 @@ change_others_fields
# Clear temporary files
clear_files
+
+[ $COMMIT -eq 1 ] && commit_slackbuild
+