[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commit-womb] gnumaint/pkgupdate from-maildir pkg-resolve
From: |
Ineiev |
Subject: |
[commit-womb] gnumaint/pkgupdate from-maildir pkg-resolve |
Date: |
Sat, 11 May 2019 07:43:10 -0400 (EDT) |
CVSROOT: /sources/womb
Module name: gnumaint
Changes by: Ineiev <ineiev> 19/05/11 07:43:10
Removed files:
pkgupdate : from-maildir pkg-resolve
Log message:
Migrate to www web pages (prep/gnumaint).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnumaint/pkgupdate/from-maildir?cvsroot=womb&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnumaint/pkgupdate/pkg-resolve?cvsroot=womb&r1=1.1&r2=0
Patches:
Index: from-maildir
===================================================================
RCS file: from-maildir
diff -N from-maildir
--- from-maildir 10 Nov 2018 03:51:46 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,107 +0,0 @@
-#!/bin/bash
-# $Id: from-maildir,v 1.1 2018/11/10 03:51:46 mikegerwitz Exp $
-# Produce version listing from info-gnu@ maildir entries
-#
-# Copyright (C) 2018 Mike Gerwitz
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-##
-
-set -uo pipefail
-
-mail-headers()
-{
- awk -F': ' '
- BEGIN { OFS="\t" }
- /^(Date|Subject): / { h[$1] = $2 }
- /^$/ { print h["Date"], h["Subject"] }'
-}
-
-
-datefmt()
-{
- local -r date="${1?Missing date}"
- date --date="$date" +%Y%m%d
-}
-
-
-normalize-subject()
-{
- # perl used here in place of sed for non-greedy (lazy) matching
- perl -pe '
- # remove bracketed tags and common expressions
- s/\[.+?\]//g;
- s/\b(released?|version)\b( +of)?//ig;
- s/\b(now )?available\b//ig;
- s/(a )?\bnew\b//ig;
- s/\b(re-?)?announc(ing|ement)( of)?\b//ig;
- s/\bhas been\b//ig;
- s/\bbug fix\b//ig;
- s/\bthe\b//ig; # no package names have "the"
-
- # swap form "VER of PKG" to "PKG VER"
- s/(\b[0-9.]+) +of +(.+$)/\2 \1/;
-
- # strip everything after the last (version?) number
- s/^(.+?)[ -]+(?:v\.?|\()?([0-9.]+\b).*$/\2 \1/;
-
- # strip tabs that would screw up our output and remove punctuation
- s/[\t,]//g;
- s/ +/ /g;'
-}
-
-
-pkg-guess()
-{
- local -r subj="${1?Missing subject line}"
- local ver pkg
-
- # Attempt to get version and package from subject line
- read ver pkg < <( normalize-subject <<< "$subj" )
-
- # If it does not look like a version number, then we cannot
- # proceed.
- if [[ ! "$ver" =~ ^[0-9][0-9.]*$ ]]; then
- echo "missing version: $subj" >&2
- return 1
- fi
-
- # retain subject as metadata for human eyeballs
- echo -e "$ver\t$pkg"
-}
-
-
-process-message()
-{
- local -r message="${1?Missing message path}"
- local date subj
-
- IFS=$'\t' read date subj < <( mail-headers < "$message" )
-
- local -r pkg=$( pkg-guess "$subj" )
- test -n "$pkg" || return
-
- echo -e "$( datefmt "$date" )\t$pkg\tmail\t$subj"
-}
-
-
-main()
-{
- while [ $# -gt 0 ]; do
- process-message "$1"
- shift
- done
-}
-
-main "$@"
Index: pkg-resolve
===================================================================
RCS file: pkg-resolve
diff -N pkg-resolve
--- pkg-resolve 10 Nov 2018 03:51:46 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,74 +0,0 @@
-#!/bin/bash
-# $Id: pkg-resolve,v 1.1 2018/11/10 03:51:46 mikegerwitz Exp $
-# Resolve package names from version listing
-#
-# Copyright (C) 2018 Mike Gerwitz
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# This script is slow, but that is not of practical importance for now.
-##
-
-cd "$( dirname "$0" )"
-
-set -euo pipefail
-
-recfile=../rec/gnupackages.rec
-
-
-find-pkg()
-{
- local -r pkg="${1?Missing source package string}"
- local -r op="${2:-=}"
-
- local -r unix="${pkg//[^a-zA-Z0-9-]/}"
-
- # TODO: error if multiple
- local -r result=$(
- recsel -iC \
- -e "package $op '$unix' || mundane_name $op '$pkg' || search_alias
$op '$pkg'" \
- -P package \
- "$recfile" || echo "fail $pkg" >&2 )
-
- test -n "$result" || return
-
- # TODO: error if more than one
- head -n1 <<< "$result"
-}
-
-
-resolve-pkg()
-{
- local -r pkg="${1?Missing source package string}"
- local -r clean=$( sed 's/^\(GNU\|FSF\) //i' <<< "$pkg" )
-
- find-pkg "$pkg" = \
- || find-pkg "$pkg" \~ \
- || { test "$pkg" != "$clean" && resolve-pkg "$clean"; }
-}
-
-
-main()
-{
- local date ver pkg src meta
-
- while IFS=$'\t' read date ver pkg src meta; do
- local respkg=$( resolve-pkg "$pkg" )
- test -n "$respkg" || continue
-
- echo -e "$date\t$ver\t$respkg\t$src\t$meta"
- done
-}
-
-main "$@"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [commit-womb] gnumaint/pkgupdate from-maildir pkg-resolve,
Ineiev <=