logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

gettext-0.3.2-autopoint_serial.patch (1037B)


  1. From 3407c90cacb976838b174b661f49f7565f77c5e5 Mon Sep 17 00:00:00 2001
  2. From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
  3. Date: Fri, 24 May 2024 23:41:10 +0200
  4. Subject: [PATCH] autopoint.in: Skip overwriting on >= serial at destination
  5. Closes: https://github.com/sabotage-linux/gettext-tiny/issues/63
  6. ---
  7. src/autopoint.in | 12 ++++++++++++
  8. 1 file changed, 12 insertions(+)
  9. diff --git a/src/autopoint.in b/src/autopoint.in
  10. index fd00afd..c88e1c9 100755
  11. --- a/src/autopoint.in
  12. +++ b/src/autopoint.in
  13. @@ -1,6 +1,10 @@
  14. #!/bin/sh
  15. m4src=@datadir@/m4
  16. +get_m4_serial() {
  17. + sed -n -e '/^#.* serial /s;^#.* serial \([^ ]*\).*;\1;p' "$@"
  18. +}
  19. +
  20. if ! test -e configure.ac ; then
  21. echo "$0: error: configure.ac not found" >&2
  22. exit 1
  23. @@ -8,6 +12,14 @@ fi
  24. mkdir -p m4 intl po
  25. for i in $m4src/*.m4 ; do
  26. + dest="m4/$(basename "$i")"
  27. + if test -f "$dest"; then
  28. + serial_dest="$(get_m4_serial "$dest")"
  29. + serial_gettext="$(get_m4_serial "$i")"
  30. +
  31. + test "$serial_dest" -ge "$serial_gettext" && continue
  32. + fi
  33. +
  34. cp -f $i m4/
  35. done