osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/40344?usp=email )


Change subject: OBS: remove pdf draft watermark for latest pkgs
......................................................................

OBS: remove pdf draft watermark for latest pkgs

Add the line
  ASCIIDOCSTYLE = $(BUILDDIR)\/custom-dblatex.sty
before the line
  include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc
when building source packages for the latest feed, so there is no
"DRAFT" watermark.

Closes: OS#6188
Change-Id: Ie2e49ba89913321edaa90660a5348209355e61ce
---
M scripts/obs/lib/srcpkg.py
1 file changed, 14 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/44/40344/1

diff --git a/scripts/obs/lib/srcpkg.py b/scripts/obs/lib/srcpkg.py
index fc39563..6f4e613 100644
--- a/scripts/obs/lib/srcpkg.py
+++ b/scripts/obs/lib/srcpkg.py
@@ -167,6 +167,18 @@
     pathlib.Path(f"{output_path}/commit_{commit}.txt").touch()


+def set_asciidoc_style_without_draft_watermark(project):
+    repo_path = lib.git.get_repo_path(project)
+    doc_makefiles = lib.run_cmd(["grep", "-r", "-l", "include 
$(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc"], cwd=repo_path)
+    doc_makefiles = doc_makefiles.output.rstrip().split("\n")
+
+    for doc_makefile in doc_makefiles:
+        print(f"{project}: setting asciidoc style to remove draft watermark in 
{doc_makefile}")
+        lib.run_cmd(["sed", "-i",
+                     '/\\/build\\/Makefile\\.asciidoc\\.inc/s/^/  
ASCIIDOCSTYLE = $(BUILDDIR)\\/custom-dblatex.sty\\n/',
+                     doc_makefile], cwd=repo_path)
+
+
 def build(project, gerrit_id=0):
     conflict_version = lib.args.conflict_version
     feed = lib.args.feed
@@ -214,6 +226,8 @@

     if lib.args.disable_manuals:
         lib.debian.disable_manuals(project)
+    elif feed == "latest":
+        set_asciidoc_style_without_draft_watermark(project)

     lib.debian.build_source_package(project)
     lib.debian.move_files_to_output(project)

--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/40344?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ie2e49ba89913321edaa90660a5348209355e61ce
Gerrit-Change-Number: 40344
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osm...@sysmocom.de>

Reply via email to