[release-notes/help-gnome-org] build from source tarball




commit 50c62f6c367326c26c46e8222abb0f0de1c3b325
Author: Link Dupont <link sub-pop net>
Date:   Fri Aug 27 13:17:13 2021 -0400

    build from source tarball

 build.sh | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)
---
diff --git a/build.sh b/build.sh
index 30514cef..b4a3b56b 100644
--- a/build.sh
+++ b/build.sh
@@ -3,18 +3,36 @@
 REPO="https://gitlab.gnome.org/Teams/Engagement/release-notes.git";
 
 mapfile -t branches < <(git ls-remote --heads ${REPO} | awk '{print $2}' | cut -d/ -f3 | grep '^gnome-' | 
sort -V)
+branches=(wip/subpop/build-html)
 
 for branch in "${branches[@]}"; do
     VERSION="$(echo "$branch" | cut -d- -f2- | sed 's/-/./')"
+    VERSION=41
     if [ "${VERSION}" -ge 41 ]; then
-        curl -L --output "release-notes-${VERSION}.zip" 
"https://gitlab.gnome.org/Teams/Engagement/release-notes/-/jobs/artifacts/${branch}/download?job=build";
-        unzip "release-notes-${VERSION}.zip"
+        curl -L --output "artifacts.zip" 
"https://gitlab.gnome.org/Teams/Engagement/release-notes/-/jobs/artifacts/${branch}/download?job=build";
+        unzip artifacts.zip
+        tar -xf "release-notes-${VERSION}.tar.gz"
         mkdir -p "${CI_PROJECT_DIR}/public/${VERSION}/"
-        pushd help-release-notes || exit 1
-        mapfile -t langs < <(ls -1 .)
+        pushd "release-notes-${VERSION}/help" || exit 1
+        mapfile -t langs < <(find . -type d -maxdepth 1)
         for LANG in "${langs[@]}"; do
-            mkdir -p "${CI_PROJECT_DIR}/public/${VERSION}/${LANG}"
-            yelp-build html --output "${CI_PROJECT_DIR}/public/${VERSION}/${LANG}" "${LANG}/release-notes"
+            PO_FILE="${LANG}/${LANG}.po"
+            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
         done
         popd || exit 1
     fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]