[library-web/oscp] Rework release-notes-gen
- From: Andrea Veri <averi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [library-web/oscp] Rework release-notes-gen
- Date: Mon, 24 Feb 2020 13:39:31 +0000 (UTC)
commit 9a141396e37399fc82099f87659a8e293a97fc5a
Author: Andrea Veri <av gnome org>
Date: Mon Feb 24 13:39:27 2020 +0000
Rework release-notes-gen
lgo/release-notes-gen | 74 +++++++++++++++++++++++----------------------------
1 file changed, 34 insertions(+), 40 deletions(-)
---
diff --git a/lgo/release-notes-gen b/lgo/release-notes-gen
index 49a73df..ea1f2d5 100755
--- a/lgo/release-notes-gen
+++ b/lgo/release-notes-gen
@@ -1,50 +1,44 @@
#!/bin/bash
-DIR="$(basename "$(pwd)")"
-if [[ ! -d /data/cache/release-notes ]]; then
- git clone https://gitlab.gnome.org/Teams/Engagement/release-notes.git \
- /data/cache/release-notes
-fi
+REPO="https://gitlab.gnome.org/Teams/Engagement/release-notes.git"
+DIR="/data/cache/release-notes"
-cd /data/cache/release-notes
-git reset --hard
-git pull --all --rebase
-
-mapfile -t branches < <(git branch -r | cut -d/ -f2- | grep gnome-)
+mapfile -t branches < <(git ls-remote --heads ${REPO} | awk '{print $2}' | grep 'gnome-' | cut -d/ -f 3)
for branch in ${branches[@]}; do
- version="$(echo $branch | cut -d- -f2- | sed 's/-/./')"
- TGZ="/data/extra-tarballs/release-notes-${version}.tar.gz"
+ VERSION="$(echo $branch | cut -d- -f2- | sed 's/-/./')"
+ TGZ="/data/extra-tarballs/release-notes-${VERSION}.tar.gz"
if [[ -f $TGZ ]]; then
continue
+ else
+ git clone ${REPO} -b ${branch} "${DIR}-${VERSION}"
+
+ cd "${DIR}-${VERSION}/help"
+ for LANG in $(find -maxdepth 1 -type d); do
+ PO_FILE="$LANG/$LANG.po"
+ if [ -e "$PO_FILE" ]; then
+ if [ -e C/index.page ]; then
+ msgfmt -o $LANG/$LANG.mo $PO_FILE
+ (cd $LANG && itstool -m $LANG.mo ../C/*.page)
+ else
+ for XML_FILE in C/*.xml; do
+ DEST="$LANG/$(basename $XML_FILE)"
+ BUILD=0
+ test -e "$DEST" || BUILD=1
+ test "$PO_FILE" -nt "$DEST" && BUILD=1
+ test "$XML_FILE" -nt "$DEST" && BUILD=1
+ if [ "$BUILD" = "1" ]
+ then
+ xml2po -e -p "$PO_FILE" "$XML_FILE" > "$DEST"
+ fi
+ done
+ fi
+ fi
+ done
+
+ cd /data/cache
+
+ tar czf "${TGZ}" --exclude=".svn" --exclude=".git" "${DIR}-{VERSION}"
fi
-
- cd help
- for LANG in $(find -maxdepth 1 -type d); do
- PO_FILE="$LANG/$LANG.po"
- if [ -e "$PO_FILE" ]; then
- if [ -e C/index.page ]; then
- msgfmt -o $LANG/$LANG.mo $PO_FILE
- (cd $LANG && itstool -m $LANG.mo ../C/*.page)
- else
- for XML_FILE in C/*.xml; do
- DEST="$LANG/$(basename $XML_FILE)"
- BUILD=0
- test -e "$DEST" || BUILD=1
- test "$PO_FILE" -nt "$DEST" && BUILD=1
- test "$XML_FILE" -nt "$DEST" && BUILD=1
- if [ "$BUILD" = "1" ]
- then
- xml2po -e -p "$PO_FILE" "$XML_FILE" > "$DEST"
- fi
- done
- fi
- fi
- done
-
- cd ..
-
- cd ..
- tar czf "$TGZ" --exclude=".svn" --exclude=".git" "$DIR"
done
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]