Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master quill by Jaka Kranjc (2c3013fb9064b3d8ee11f84b327d13ad96608c91)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master quill by Jaka Kranjc (2c3013fb9064b3d8ee11f84b327d13ad96608c91)
  • Date: Tue, 6 Mar 2007 10:59:09 -0600

GIT changes to master quill by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

usr/bin/quill | 34 ++++++++++---
var/lib/quill/ChangeLog | 9 +++
var/lib/quill/modules/libbuild | 95
++++++++++++++++++++++++++++++++++++++-
var/lib/quill/modules/libcore | 32 ++++++++++---
var/lib/quill/modules/libdepends | 4 +
var/lib/quill/modules/libdetails | 34 +++++++------
var/lib/quill/modules/libinstall | 6 ++
var/lib/quill/version | 2
8 files changed, 184 insertions(+), 32 deletions(-)

New commits:
commit 2c3013fb9064b3d8ee11f84b327d13ad96608c91
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

committing untested WIP

* libcore: fixed saved sudo and gpg default query answer
fixed versioning to not loop anymore
factored andand_lines out of quill
* libdetails: beautified hunt_src_dir, add_details dpesn't unexpand
globals
* libbuild: started work on detect_build_system and
implement_build_system
* quill: fake call detect_build_system; TODO: INSTALL, DEPENDS
* version: 0.2.4-rc1

diff --git a/usr/bin/quill b/usr/bin/quill
index dea4cab..f967e6e 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -43,7 +43,7 @@ QUILL_OLD_QUILLRC=~/.quillrc
QUILL_SPELL_DIR=~/.sourcemage/spells
QUILL_TMP_DIR=~/.sourcemage/tmp
QUILL_CONFIG_VERSION=1
-QUILL_OLD_CONFIG_VERSION=$QUILL_CONFIG_VERSION
+QUILL_OUR_CONFIG_VERSION=$QUILL_CONFIG_VERSION

#---
## Not really a function it's supposed to parse the command line parameters
@@ -105,7 +105,7 @@ do
done

quill_rc
-if [[ ${QUILL_CONFIG_VERSION/0.2.2/1} != $QUILL_OLD_CONFIG_VERSION ]]; then
+if [[ ${QUILL_CONFIG_VERSION/0.2.2/1} != $QUILL_OUR_CONFIG_VERSION ]]; then
QUILL_MODE="reconfigure"
error_msg "Your quill settings are too old, forcing a reconfiguration!"
quill_rc
@@ -509,10 +509,7 @@ else
# add && where appropriate in DEPENDS
if [[ ${SPELL_OPTIONAL_DEPENDENCIES} != "" ]] || [[ ${SPELL_DEPENDENCIES}
!= "" ]]
then
- sed -e 's/^ *$//' -e 's/[^\\]$/& \&\&/' DEPENDS | tac |
- awk '{ if (removed!=1){ if (sub("&&$","") > 0){ removed=1 }}; print }'
|
- tac > temporary-DEPENDS
- mv temporary-DEPENDS DEPENDS
+ andand_lines DEPENDS
fi

if [[ "${SPELL_CONFLICTS}" != "" ]]
@@ -525,7 +522,7 @@ else
add_provides
fi

- # redo it for fmxml - so it works if the xml didn't contain a valid source
url
+ # redo it for QUILL_FETCH_MODE, perhaps it didn't fetch a valid source url
# first time for other modes
parse_spell_source_file_info
show_spell_source_file_info
@@ -554,12 +551,31 @@ else

if [[ "${BUILDISON}" == "BUILD, " ]]
then
- add_build
+ [[ -e $QUILL_TMP_DIR/${SPELL_SRC_FILE:-uag1au234gaugua} ]] ||
+ { error_msg "Bad or missing source: $SPELL_SRC_FILE"; exit 2; }
+
+ #message "Quill can try to autodetect the build system the package is
using."
+ #message "However for this the source tarball needs to be extracted (can
take a while)."
+ #if query "Do you want quill to try to autodetect the build system?" n
+ #then
+ # BS=$(detect_build_system)
+ # implement_build_system $BS
+ #else
+ add_build
+ #fi
fi

if [[ "${INSTALLISON}" == "INSTALL, " ]]
then
- add_install
+ if [[ -z $BS ]]; then
+ add_install
+ else
+ implement_install_system $BS
+ fi
+ fi
+
+ if [[ ! -z $BS ]]; then
+ add_bs_depends $BS
fi

#-if [[ "${POSTINSTALLISON}" == "POST_INSTALL, " ]]
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index 6f82726..3f2911b 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,3 +1,12 @@
+2007-03-06 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libcore: fixed saved sudo and gpg default query answer
+ fixed versioning to not loop anymore
+ factored andand_lines out of quill
+ * libdetails: beautified hunt_src_dir, add_details dpesn't unexpand
globals
+ * libbuild: started work on detect_build_system and
implement_build_system
+ * quill: fake call detect_build_system; TODO: INSTALL, DEPENDS
+ * version: 0.2.4-rc1
+
2007-03-05 Andra?? "ruskie" Levstik <ruskie AT mages.ath.cx>
* libdetails: minor fixes to the src dir hunt code and
to the sf misc code, forgot a \, hopefully it will work now
diff --git a/var/lib/quill/modules/libbuild b/var/lib/quill/modules/libbuild
index 1e9f44e..d39c441 100644
--- a/var/lib/quill/modules/libbuild
+++ b/var/lib/quill/modules/libbuild
@@ -1,6 +1,5 @@
#---
## @Synopsis BUILD module for quill
-## @Note DONE
#---

BUILDISON=""
@@ -27,6 +26,100 @@ function add_build() {
fi
$EDITOR BUILD
}
+
+#---
+## @Synopsis ask and try to detect the build system by checking for marker
+## @Synopsis files in the tarball
+#---
+function detect_build_system() {
+ local bs SPELL SOURCE_CACHE
+
+ # we override some sorcery variables to make uncompress_unpack work
+ # uncompress so more file formats are supported than what tar -t can handle
+ # although currently hunt_src_url doesn't support anything else
+ SPELL=$SPELL_NAME
+ SOURCE_CACHE="$QUILL_TMP_DIR"
+ uncompress_unpack "$SPELL_SRC_FILE"
+ cd "$SPELL_SRC_DIR"
+
+ #check for markers
+ if [[ -e setup.py ]]; then
+ bs=python
+ elif [[ -e Rakefile ]]; then
+ bs=rake
+ elif [[ -e Makefile.PL ]]; then
+ bs=PerL
+ elif [[ -e Makefile.pl ]]; then
+ bs=perl
+ elif [[ -e .wscript ]]; then
+ bs=waf
+ elif [[ -e SConstruct ]]; then
+ bs=scons
+ elif [[ -e Makefile ]]; then
+ if [[ -e configure ]]; then
+ bs=make,configure
+ elif [[ -e autogen.sh ]]; then
+ bs=make,autogen,configure
+ else
+ bs=make
+ fi
+ elif [[ -e Jamfile ]]; then
+ if [[ -e configure ]]; then
+ bs=jam,configure
+ elif [[ -e autogen.sh ]]; then
+ bs=jam,autogen,configure
+ else
+ bs=jam
+ fi
+ else
+ error_msg "Couldn't determine the build system, please file a bug."
+ cd ..
+ rm -r "$SPELL_SRC_FILE"
+ return 1
+ fi
+
+ cd ..
+ rm -r "$SPELL_SRC_FILE"
+
+ message "Detected build system: $bs"
+ echo $bs
+}
+
+#---
+## @Synopsis creates a BUILD file according to the build system used
+## @Synopsis unless it is make,configure (default_build)
+#---
+function implement_build_system() {
+ local bs=$1
+ [[ $bs == make,configure ]] && return 0
+
+ if grep -q autogen <<< $bs; then
+ echo "./autogen.sh &&" >> BUILD
+ fi
+ if grep -q configure <<< $bs; then
+ cat <<"FEO" >> BUILD
+ ./configure --prefix=$INSTALL_ROOT/usr \
+ --sysconfdir=$INSTALL_ROOT/etc \
+ --localstatedir=$INSTALL_ROOT/var \
+ --mandir=$INSTALL_ROOT/usr/share/man \
+ --infodir=$INSTALL_ROOT/usr/share/info \
+ $OPTS &&
+ FEO
+ fi
+
+ case $bs in
+ rake) echo "rake" >> BUILD ;;
+ perl) echo "perl Makefile.pl" >> BUILD ;;
+ PerL) echo "perl Makefile.PL" >> BUILD ;;
+ python) echo "python setup.py" >> BUILD ;;
+ waf) echo "waf_build" >> BUILD ;;
+ scons) echo "scons PREFIX=$INSTALL_ROOT/usr" >> BUILD ;;
+ jam) echo "jam" >> BUILD ;;
+ make) echo "make" >> BUILD ;;
+ esac
+
+}
+
#---
##
## This software is free software; you can redistribute it and/or modify
diff --git a/var/lib/quill/modules/libcore b/var/lib/quill/modules/libcore
index dc1ae2f..9861812 100644
--- a/var/lib/quill/modules/libcore
+++ b/var/lib/quill/modules/libcore
@@ -59,6 +59,7 @@ function quill_hash_get() {
#---

function quill_rc() {
+ local saved
if [[ -f ${QUILL_OLD_QUILLRC} ]]
then
query_msg "With accordance to Source Mage standards moving"
@@ -78,27 +79,34 @@ function quill_rc() {
then
mkdir -p $QUILL_HOME_DIR
touch $QUILL_QUILLRC
- local quill_config_version=$QUILL_CONFIG_VERSION # can get overridden by
the sourcing
. $QUILL_QUILLRC # get the contents if there are any (for defaults)
message "${MESSAGE_COLOR}This will (re)create ${QUILL_QUILLRC} for
you${DEFAULT_COLOR}"
query_string GURU_NAME "${QUERY_COLOR}Please enter your name for the
HISTORY entries.${DEFAULT_COLOR}" "$GURU_NAME"
query_string GURU_EMAIL "${QUERY_COLOR}Please enter your email for the
HISTORY entries.${DEFAULT_COLOR}" "$GURU_EMAIL"
query_string QUILL_SPELL_DIR "${QUERY_COLOR}Where do you want to store
generated spells (absolute path)?${DEFAULT_COLOR}" "$QUILL_SPELL_DIR"
query_string QUILL_GIT_DIR "${QUERY_COLOR}Where is the dir that contains
your git grimoires if you have any (absolute path)?${DEFAULT_COLOR}"
"$QUILL_GIT_DIR"
- if query "Do you want to use sudo where possible?" ${QUILL_SUDO:-n}
- then
+
+ if [[ -z $QUILL_SUDO ]]; then
+ saved=n
+ else
+ [[ -z ${QUILL_SUDO/sudo bash/} ]] && saved=y || saved=n
+ fi
+ if query "Do you want to use sudo where possible?" $saved; then
# we need the bash since we call multiple commands at a time
# and sudo doesn't like just sudo -c "ls; ls; ls"
QUILL_SUDO="sudo bash"
else
QUILL_SUDO="su"
fi
- if query "Do you use guru GPG signatures?" n ; then
- query_list "${QUERY_COLOR}Please select one of the following keys as
the guru signing key${DEFAULT_COLOR}" GURU_GPGKEY "" $(gpg -K | sed -n
"/^sec[^#]/ s,^sec\s*[^/]*/\(\S*\)\s.*$,\1,p")
+
+ [[ -z $GURU_GPGKEY ]] && saved=n || saved=y
+ if query "Do you use guru GPG signatures?" $saved ; then
+ query_list "${QUERY_COLOR}Please select one of the following keys as
the guru signing key${DEFAULT_COLOR}" GURU_GPGKEY "$GURU_GPGKEY" $(gpg -K |
sed -n "/^sec[^#]/ s,^sec\s*[^/]*/\(\S*\)\s.*$,\1,p")
fi
+
message "Thank you. Now generating ${QUILL_QUILLRC}"
cat << QUA > $QUILL_QUILLRC
- QUILL_CONFIG_VERSION="$quill_config_version"
+ QUILL_CONFIG_VERSION="$QUILL_OUR_CONFIG_VERSION"
GURU_NAME="$GURU_NAME"
GURU_EMAIL="$GURU_EMAIL"
QUILL_SPELL_DIR="$QUILL_SPELL_DIR"
@@ -470,6 +478,18 @@ function dir_check() {
}

#---
+## @Synopsis adds && to all full lines not ending by and escape \ or last
line
+#---
+function andand_lines() {
+ local file="$1"
+ sed -e 's/^ *$//' -e 's/[^\\]$/& \&\&/' "$file" |
+ tac |
+ awk '{ if (removed!=1){ if (sub("&&$","") > 0){ removed=1 }}; print }' |
+ tac > "temporary-$file"
+ mv "temporary-$file" "$file"
+}
+
+#---
## @Synopsis prints a colored error message
#---
function error_msg() {
diff --git a/var/lib/quill/modules/libdepends
b/var/lib/quill/modules/libdepends
index b0f8293..e8a2f9b 100644
--- a/var/lib/quill/modules/libdepends
+++ b/var/lib/quill/modules/libdepends
@@ -53,6 +53,10 @@ function add_optional_dependencies() {
done
# "optional_depends ${j} \"enabled-option\" \"disabled-option\"
\"description\""
}
+
+function add_bs_depends() {
+ return
+}
#---
##
## This software is free software; you can redistribute it and/or modify
diff --git a/var/lib/quill/modules/libdetails
b/var/lib/quill/modules/libdetails
index 9a773d1..b4545d0 100644
--- a/var/lib/quill/modules/libdetails
+++ b/var/lib/quill/modules/libdetails
@@ -180,16 +180,17 @@ function hunt_src_dir(){
local compressor
message "Checking for the source directory..."
compressor=$(guess_compressor ${QUILL_TMP_DIR}/${SPELL_SRC_FILE})
+
case "$compressor" in
- bzip2|gzip|compress*|tar) SPELL_SRC_DIR=$(tar tf
"${QUILL_TMP_DIR}/${SPELL_SRC_FILE}" | \
- grep / | \
- sed -e "s=/.*$==g;q") || \
- (error_msg "Error: getting
path from tarball" && \
- return 1) ;;
- *) SPELL_SRC_DIR=${SPELL}-${VERSION} &&
- message "Unsupported format..." &&
- return 2 ;;
+ bzip2|gzip|compress*|tar) true ;;
+ *) SPELL_SRC_DIR=${SPELL}-${VERSION}
+ message "Unsupported format..."
+ return 2 ;;
esac
+ SPELL_SRC_DIR=$(tar tf "${QUILL_TMP_DIR}/${SPELL_SRC_FILE}" |
+ sed -n "1 s=/.*$==p") ||
+ { error_msg "Error: getting path from tarball" && return 1; }
+
message "Done.\n"
}

@@ -198,22 +199,25 @@ function hunt_src_dir(){
#---
function add_details(){
message "Generating the DETAILS file ..."
+ local spell_src_url="$SPELL_SRC_URL"
+ local spell_src_dir="$SPELL_SRC_DIR"
+ local spell_src_file="$SPELL_SRC_FILE"

QUILL_SPELL_HASH="$(quill_hash_get $QUILL_TMP_DIR/$SPELL_SRC_FILE)"

- substitute_with_mirror_variables SPELL_SRC_URL
- substitute_with_variables SPELL_SRC_URL "$SPELL_SRC_FILE" {SOURCE} \
+ substitute_with_mirror_variables spell_src_url
+ substitute_with_variables spell_src_url "$spell_src_file" {SOURCE} \
"$SPELL_NAME" {SPELL} "$SPELL_VERSION" {VERSION}
- substitute_with_variables SPELL_SRC_DIR "$SPELL_NAME" {SPELL}
"$SPELL_VERSION" {VERSION}
- substitute_with_variables SPELL_SRC_FILE "$SPELL_NAME" {SPELL}
"$SPELL_VERSION" {VERSION}
+ substitute_with_variables spell_src_dir "$SPELL_NAME" {SPELL}
"$SPELL_VERSION" {VERSION}
+ substitute_with_variables spell_src_file "$SPELL_NAME" {SPELL}
"$SPELL_VERSION" {VERSION}

echo \
" SPELL=${SPELL_NAME}
VERSION=${SPELL_VERSION}
- SOURCE=\"${SPELL_SRC_FILE}\"
- SOURCE_URL[0]=${SPELL_SRC_URL}
+ SOURCE=\"$spell_src_file\"
+ SOURCE_URL[0]=$spell_src_url
SOURCE_HASH=sha512:${QUILL_SPELL_HASH}
-SOURCE_DIRECTORY=\"\${BUILD_DIRECTORY}/$SPELL_SRC_DIR\"
+SOURCE_DIRECTORY=\"\${BUILD_DIRECTORY}/$spell_src_dir\"
WEB_SITE=\"${SPELL_URL}\"
LICENSE[0]=${SPELL_LICENSE}
ENTERED=${HISTORY_DATE//-/}
diff --git a/var/lib/quill/modules/libinstall
b/var/lib/quill/modules/libinstall
index c463450..002f748 100644
--- a/var/lib/quill/modules/libinstall
+++ b/var/lib/quill/modules/libinstall
@@ -23,6 +23,12 @@ then
INSTALLISON="INSTALL, "
fi
}
+
+function implement_install_system()
+{
+ return
+}
+
#---
##
## This software is free software; you can redistribute it and/or modify
diff --git a/var/lib/quill/version b/var/lib/quill/version
index 5d87b90..2e55248 100644
--- a/var/lib/quill/version
+++ b/var/lib/quill/version
@@ -1 +1 @@
-0.2.3-2007-03-05
+0.2.4-rc1



  • [SM-Commit] GIT changes to master quill by Jaka Kranjc (2c3013fb9064b3d8ee11f84b327d13ad96608c91), Jaka Kranjc, 03/06/2007

Archive powered by MHonArc 2.6.24.

Top of Page