sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master quill by Ismael Luceno (bfcc3f9998e7ca42ea47dce65f11cfd3ec10b450)
- From: Ismael Luceno <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master quill by Ismael Luceno (bfcc3f9998e7ca42ea47dce65f11cfd3ec10b450)
- Date: Thu, 6 Nov 2025 01:02:52 +0000
GIT changes to master quill by Ismael Luceno <ismael AT sourcemage.org>:
usr/bin/quill | 9 +++++----
var/lib/quill/modules/libgithub | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 4 deletions(-)
New commits:
commit bfcc3f9998e7ca42ea47dce65f11cfd3ec10b450
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
libgithub: Add support for fetching the spell metadata from Github
* License
* Website
* Short description
diff --git a/usr/bin/quill b/usr/bin/quill
index a12624e..8270334 100755
--- a/usr/bin/quill
+++ b/usr/bin/quill
@@ -99,22 +99,23 @@ if [[ -n $QUILL_UPDATE ]]; then
fi
if [[ -z $QUILL_TARGET ]]; then
case "$1" in
- git:*)
+ (git:*)
SPELL_SRC_URL="$1"
QUILL_ORIG_TARGET=$(sed -r 's@\.git$@@;s@.*/@@' <<< "$1")
;;
- https://github.com/*/archive/*)
+ (https://github.com/*)
SPELL_SRC_URL="$1"
QUILL_ORIG_TARGET=$(awk -F/ '{print $5}' <<< "$1")
+ QUILL_FETCH_MODE=github
;;
- *:*)
+ (*:*)
SPELL_SRC_URL="$1"
QUILL_ORIG_TARGET=$(sed -r '
s@([-.]src)?([-._][0-9][^-._/]*)*([-.]src)?([.][^-._]+)*(/download/?)?([?].*)?$@@
s@.*/@@
' <<< "$1")
;;
- *)
+ (*)
QUILL_ORIG_TARGET="$1"
SPELL_SRC_URL="$2"
;;
diff --git a/var/lib/quill/modules/libgithub b/var/lib/quill/modules/libgithub
new file mode 100644
index 0000000..822c292
--- /dev/null
+++ b/var/lib/quill/modules/libgithub
@@ -0,0 +1,34 @@
+#!/bin/bash
+quill_github_core() {
+ local api_url=$(awk -F/ '
+ {
+ printf "https://api.github.com/repos/%s/%s\n", $4, $5
+ }
+ ' <<< "${SPELL_SRC_URL}")
+ while read var val; do
+ typeset -g "$var=$val"
+ done < <(
+ wget -q -O- "$api_url" | awk '
+ BEGIN {
+ map["full_name"]
+ map["homepage"] = "SPELL_URL"
+ map["spdx_id"] = "SPELL_LICENSE"
+ map["description"] = "SPELL_SHORT_DESCRIPTION"
+ }
+ {
+ key = $1
+ gsub(/[^a-z_]/, "", key)
+ if (!(key in map)) next
+ val = $0
+ sub(/^[^:]+: *"?/, "", val)
+ sub(/"?,$/, "", val)
+ repo[key] = val
+ }
+ END {
+ if (!("homepage" in repo))
+ repo["homepage"] = "https://github.com/"
repo["full_name"]
+ for (i in map) if (map[i])
+ print map[i], repo[i]
+ }
+ ')
+}
- [[SM-Commit] ] GIT changes to master quill by Ismael Luceno (bfcc3f9998e7ca42ea47dce65f11cfd3ec10b450), Ismael Luceno, 11/05/2025
Archive powered by MHonArc 2.6.24.