Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Ismael Luceno (a1de57e4dbb3909db024a986e775d04710baed8c)

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 sorcery by Ismael Luceno (a1de57e4dbb3909db024a986e775d04710baed8c)
  • Date: Sun, 26 Mar 2023 14:33:10 +0000

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

usr/lib/sorcery/cmd/sightsee | 42
++++++++++++++++++++++++++++++++----------
1 file changed, 32 insertions(+), 10 deletions(-)

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

sightsee: Fix parsing of VERSION variable

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

sightsee: Add debug mode

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

sightsee: Provide a default regex

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

sightsee: Print a warning if no release was extracted

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

sightsee: Fix syntax error

diff --git a/usr/lib/sorcery/cmd/sightsee b/usr/lib/sorcery/cmd/sightsee
index 3bc3e83..36affd2 100755
--- a/usr/lib/sorcery/cmd/sightsee
+++ b/usr/lib/sorcery/cmd/sightsee
@@ -1,11 +1,14 @@
#!/bin/sh
codex=/var/lib/sorcery/codex
-unset verbose paths
+unset debug verbose paths

upstream_rel_get() {
- wget -q -O- "$1" | gawk -vfname="$2" '
+ [ -z "$debug" ] || >&2 echo "D: Visiting $1"
+ wget -q -O- "$1" | gawk -vdebug="$debug" -vfname="$2" '
match($0, fname, V) {
$0 = substr($0, RSTART, RLENGTH)
+ if (debug)
+ printf "D: matched `%s`\n", $0 >"/dev/stderr"
print V[1 in V]
}
' | sort -urV
@@ -18,10 +21,15 @@ while
shift
upstream_rel_get "$@"
exit
+ ;;
(--codex)
codex="$2"
shift 2
;;
+ (--debug)
+ debug=1
+ shift
+ ;;
(-v|--verbose)
verbose=1
shift
@@ -56,7 +64,7 @@ else
done
fi

-find "${paths[@]}" -name DETAILS -exec awk '
+find "${paths[@]}" -name DETAILS -exec awk -vdebug="$debug" '
END { print_spell() }
FNR==1 {
if (spell != "") print_spell()
@@ -66,20 +74,26 @@ find "${paths[@]}" -name DETAILS -exec awk '
}
/^ *VERSION=/ {
version = $0
- sub(/.*=/, "", version)
+ sub(/[\t ]*[;#].*/, "", version)
+ sub(/.*=["'\'']?/, "", version)
+ sub(/["'\'']$/, "", version)
if (watch_url != "") nextfile
}
/^# *Watch:/ {
sub(/^[^:]+: */, "")
watch_url = $1
- sub(/^[^ ]+ +/, "")
- watch_regex = $0
- # TODO check syntax
+ sub(/^[^ ]+ */, "")
+ watch_regex = $0 ? $0 : spell \
+ "[-_](R?[-_.+~0-9]+(([a-z]|rc|alpha|beta)[0-9]*)?)" \
+ "(-src|-source)?" \
+ "[.](tar|zip|t[bgx]z|7z|sha?r|cpio|rpm|deb|[ot]tf)"
+ if (debug)
+ printf "D: regex `%s`\n", watch_regex >"/dev/stderr"
if (version != "") nextfile
}
function print_spell() {
if (watch_url == "") {
- printf "E: %s: %s\n", spell, \
+ printf "W: %s: %s\n", spell, \
"Upstream releases page not specified" \
>"/dev/stderr"
}
@@ -88,10 +102,18 @@ find "${paths[@]}" -name DETAILS -exec awk '
}
' {} + |
while read spell cur_rel url regex; do
+ if [ -n "$debug" ]; then
+ >&2 echo "D: current_release for $spell: $cur_rel"
+ fi
latest_rel=$(upstream_rel_get "$url" "$regex" | sed q) || continue
- if [ "x$latest_rel" != "x$cur_rel" ]; then
+ if [ -z "$latest_rel" ]; then
+ >&2 echo "W: $spell has no published releases, review the URL"
+ elif [ "x$latest_rel" != "x$cur_rel" ]; then
+ if [ -n "$debug" ]; then
+ >&2 echo "D: latest release for $spell: $latest_rel"
+ fi
echo "$spell $latest_rel"
- elif [ -n "$verbose" ]; then
+ elif [ -n "$verbose" ] || [ -n "$debug" ]; then
>&2 echo "I: $spell is up to date"
fi
done



  • [SM-Commit] GIT changes to master sorcery by Ismael Luceno (a1de57e4dbb3909db024a986e775d04710baed8c), Ismael Luceno, 03/26/2023

Archive powered by MHonArc 2.6.24.

Top of Page