Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master quill by Ismael Luceno (995efdfb5251133eb8e64e2d315b0cb578e305c1)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master quill by Ismael Luceno (995efdfb5251133eb8e64e2d315b0cb578e305c1)
  • Date: Wed, 24 Jun 2015 20:04:08 +0000

GIT changes to master quill by Ismael Luceno <ismael AT sourcemage.org>:

usr/bin/quill | 4
var/lib/quill/ChangeLog | 13 +-
var/lib/quill/modules/site_handlers/libhackagedb | 103
++++++++++++++---------
3 files changed, 75 insertions(+), 45 deletions(-)

New commits:
commit 995efdfb5251133eb8e64e2d315b0cb578e305c1
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libhackagedb: Prefix spell name with "haskell-"

commit 1bc2872290dffa5b42ed9532eea52d63331d7b92
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libhackagedb: Fix parsing of build dependencies

commit e93e0065cd2e1811316c5793f06d47faeb6291f7
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libhackagedb: Build source URL from information in the cabal file

commit 1e7a41278ac91ee72443a85febf250883318971f
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libhackagedb: Implement simpler description parsing (in AWK)

commit 823094aa1ea8de0a2d03cd10aea108e60e9753b8
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libhackagedb: Update URLs

commit 321a8bb488746d36e44093f525d4258653ecc05d
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libhackagedb: Improve variable quoting

commit f442db39151576c8ca1a1229f5294032211422e6
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libhackagedb: Optimize usage of sed

commit 08f11013d8d8613260b9128134283472165613a4
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

quill: Fix parsing of git URLs as first argument

commit 377af4c8b084c0ca57f1bf898975a049b54e79e6
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

ChangeLog: Fix order for recently added entries

diff --git a/usr/bin/quill b/usr/bin/quill
index 5f6cf99..7bf5f26 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -99,6 +99,10 @@ if [[ -n $QUILL_UPDATE ]]; then
fi
if [[ -z $QUILL_TARGET ]]; then
case "$1" in
+ git:*)
+ SPELL_SRC_URL="$1"
+ QUILL_ORIG_TARGET=$(sed -r 's@\.git$@@;s@.*/@@' <<< "$1")
+ ;;
*:*)
SPELL_SRC_URL="$1"
QUILL_ORIG_TARGET=$(sed -r '
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index d4285c2..53ffd60 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,21 +1,24 @@
+2015-01-12 Ismael Luceno <ismael AT sourcemage.org>
+ * quill: Correctly parse git URLs as first argument
+
2015-01-10 Ismael Luceno <ismael AT sourcemage.org>
* libcopy: Optimize SECTION2 search

2015-01-04 Ismael Luceno <ismael AT sourcemage.org>
* quill: Improve parsing of URL as first argument

-2014-12-25 Ismael Luceno <ismael AT sourcemage.org>
- * libcopy: Sort presented grimoire and section lists
-
2015-01-02 Ismael Luceno <ismael AT sourcemage.org>
* quill: Remove the useless argument discarding warning

-2013-11-22 Ismael Luceno <ismael AT sourcemage.org>
- * quill: Allow specifying version on command line when updating
+2014-12-25 Ismael Luceno <ismael AT sourcemage.org>
+ * libcopy: Sort presented grimoire and section lists

2014-12-09 Ismael Luceno <ismael AT sourcemage.org>
* quill: Allow specifying URL as second argument on CLI

+2013-11-22 Ismael Luceno <ismael AT sourcemage.org>
+ * quill: Allow specifying version on command line when updating
+
2013-05-07 Ismael Luceno <ismael AT sourcemage.org>
* quill: Allow specifying source URL on command line

diff --git a/var/lib/quill/modules/site_handlers/libhackagedb
b/var/lib/quill/modules/site_handlers/libhackagedb
index 31c6a72..417b9f4 100644
--- a/var/lib/quill/modules/site_handlers/libhackagedb
+++ b/var/lib/quill/modules/site_handlers/libhackagedb
@@ -20,24 +20,24 @@ function quill_hdb_get_files(){
package_page="$2"
cabal_file="$3"

- if [[ ! -e $package_page ]] ; then
+ if [[ ! -e "$package_page" ]] ; then
message "Attempting to retrieve package page..."
- wget -q -O $package_page \
-
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/${package}/ || \
+ wget -q -O "$package_page" \
+ "http://hackage.haskell.org/package/$package"; || \
{ error_msg "Error: unable to fetch package page";
return 1; }
else
message "Using cached package page..."
fi
- if [[ ! -e $cabal_file ]] ; then
- cabal_file_path=$(egrep -o
"/packages/archive/${package}/.+/${package}\.cabal" $package_page)
+ if [[ ! -e "$cabal_file" ]] ; then
+ cabal_file_path=$(egrep -o "/package/$package-[^/]+/$package\.cabal"
"$package_page")
message "Attempting to retrieve cabal file..."
- wget -q -O ${cabal_file}.tmp \
- http://hackage.haskell.org${cabal_file_path} || \
+ wget -q -O "$cabal_file.tmp" \
+ "http://hackage.haskell.org$cabal_file_path"; || \
{ error_msg "Error: unable to fetch cabal file";
return 1; }
- cat ${cabal_file}.tmp | tr '\t' ' ' > $cabal_file
- rm ${cabal_file}.tmp
+ tr '\t' ' ' < "$cabal_file.tmp" > "$cabal_file"
+ rm "$cabal_file.tmp"
else
message "Using cached cabal file..."
fi
@@ -57,31 +57,54 @@ function quill_hdb_get_info(){

info="$1"
file="$2"
-
- if [[ "$info" == "src" ]] ; then
- echo "http://hackage.haskell.org$(egrep -o
"/packages/archive/${package}/.+/${package}-.+\.tar.gz" $file)"
- elif [[ "$info" == "description" ]] ; then
- cat $file | while IFS="" ; read line ; do
- if grep -i -q "^description:" <<< "$line" ; then
- possible_line=$(sed -e "s/^description: *\(.*\)/\1/" <<< $line)
- if [[ -n "$possible_line" ]] ; then
- echo $possible_line
- fi
- desc_here=True
- elif [[ -n "$desc_here" ]] && egrep -q "^[[:alpha:]|-]+:" <<< "$line"
; then
- break
- elif [[ -n "$desc_here" ]] ; then
- echo ${line} | sed -e "s/^ *\.\?//"
- fi
- done
- elif [[ "$info" == "build-depends" ]] ; then
- grep -i "${info}:" $file | sed -e "s/${info}: *\(.*\)/\1/" | \
- sed -e "s/\([^><=]\+\)[><=]\+[0-9.]\+/\1/g" | tr -d ',' | \
- sed -e "s/^base \+\| \+base \+\| \+base$/ /" | \
- sed -e "s/^unix \+\| \+unix \+\| \+unix$/ /"
- else
- grep -i "${info}:" $file | sed -e "s/${info}: *\(.*\)/\1/"
- fi
+ case "$info" in
+ src)
+ awk '
+ /^name:/ { n = $2 }
+ /^version:/ { n = n "-" $2; exit }
+ END {
+ printf "http://hackage.haskell.org/package/%s/%s.tar.gz\n";, n, n
+ }
+ '
+ ;;
+ description)
+ awk '
+ !/^description:/ { next }
+ {
+ sub(/[^:]*: */, "")
+ do if ($0) print; while (getline && !/^[-a-z]+:/)
+ exit
+ }
+ '
+ ;;
+ build-depends)
+ awk '
+ BEGIN {
+ discard["base"]
+ discard["unix"]
+ discard["bytestring"]
+ }
+ /^name:/ { discard[$2] }
+ $1 !~ /build-depends:/ { next }
+ {
+ $1 = ""
+ do {
+ gsub(/,|&&|[><=]+ *[0-9.]+/, "")
+ for (i = 1; i <= NF; i++)
+ if (!($i in discard))
+ dep[$i]
+ } while (getline && $1 && $1 !~ /[-a-z]+:/)
+ }
+ END {
+ for (i in dep)
+ printf " haskell-%s", tolower(i)
+ }
+ '
+ ;;
+ *)
+ sed -e "/$info:/!d;s/[^:]*: *//"
+ ;;
+ esac < "$file"
}

#---
@@ -96,17 +119,17 @@ function quill_hdb_core(){
local package_page
local cabal_file

- SPELL_NAME="$1"
+ SPELL_NAME="haskell-$1"
package="$2"

- package_page=${QUILL_TMP_DIR}/${package}.hdb
- cabal_file=${QUILL_TMP_DIR}/${package}.cabal
+ package_page="$QUILL_TMP_DIR/$package.hdb"
+ cabal_file="$QUILL_TMP_DIR/$package.cabal"
quill_hdb_get_files "$package" "$package_page" "$cabal_file" || return 1
SPELL_LICENSE="$(quill_hdb_get_info "license" "$cabal_file")"
SPELL_SHORT_DESCRIPTION="$(quill_hdb_get_info "synopsis" "$cabal_file")"
SPELL_DESC_NAME=${SPELL_NAME}.desc
- quill_hdb_get_info "description" "$cabal_file" >
${QUILL_TMP_DIR}/${SPELL_DESC_NAME}
+ quill_hdb_get_info "description" "$cabal_file" >
"$QUILL_TMP_DIR/$SPELL_DESC_NAME"
SPELL_URL="$(quill_hdb_get_info "homepage" "$cabal_file")"
- SPELL_SRC_URL="$(quill_hdb_get_info "src" "$package_page")"
- SPELL_DEPENDENCIES="ghc "$(quill_hdb_get_info "build-depends"
"$cabal_file")
+ SPELL_SRC_URL="$(quill_hdb_get_info "src" "$cabal_file")"
+ SPELL_DEPENDENCIES="ghc$(quill_hdb_get_info "build-depends" "$cabal_file")"
}



  • [SM-Commit] GIT changes to master quill by Ismael Luceno (995efdfb5251133eb8e64e2d315b0cb578e305c1), Ismael Luceno, 06/24/2015

Archive powered by MHonArc 2.6.24.

Top of Page