summaryrefslogtreecommitdiff
path: root/doc/local.mk
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-11-07 21:33:32 +0100
committerMarius Bakke <marius@gnu.org>2020-11-07 21:33:32 +0100
commit32787d652460871a79f99b63230f92759e2e0de2 (patch)
treece883cac0d602b10b7c005755d035a08197e73a9 /doc/local.mk
parent052939c2f6e36de00a5e756ea29a4cc96884a55d (diff)
parentc2396ceb6eb30ac87755eb8b39583403b35fbd12 (diff)
downloadguix-patches-32787d652460871a79f99b63230f92759e2e0de2.tar
guix-patches-32787d652460871a79f99b63230f92759e2e0de2.tar.gz
Merge branch 'master' into staging
Conflicts: gnu/local.mk gnu/packages/gdb.scm gnu/packages/lisp-xyz.scm gnu/packages/web-browsers.scm
Diffstat (limited to 'doc/local.mk')
-rw-r--r--doc/local.mk18
1 files changed, 10 insertions, 8 deletions
diff --git a/doc/local.mk b/doc/local.mk
index aca1958edd..97122c737d 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -96,14 +96,16 @@ define xref_command
cat "$@.tmp" | egrep '@p?x?ref' -A1 | sed 'N;s|--\n||g;P;D' | sed 's|^| |g' | \
tr -d '\012' | sed 's|\(@p\?x\?ref\)|\n\1|g' | egrep '@p?x?ref' | \
sed 's|^.*@p\?x\?ref{\([^,}]*\).*$$|\1|g' | sort | uniq | while read e; do \
- line=$$(grep -n "^msgid \"$$e\"" "$<" | cut -f1 --delimiter=":") ;\
- ((line++)) ;\
- if [ "$$line" != "1" ]; then \
- translation=$$(head -n $$line "$<" | tail -1 | grep msgstr | sed 's|msgstr "\(.*\)"|\1|') ;\
- if [ "$$translation" != "" ]; then \
- sed "N;s@\(p\?x\?ref\){$$(echo $$e | sed 's| |[\\n ]|g')\(,\|}\)@\1{$$translation\2@g;P;D" -i "$@.tmp" ;\
- fi ;\
- fi ;\
+ if [ -n "$$e" ]; then \
+ line=$$(grep -n "^msgid \"$$e\"" "$<" | cut -f1 --delimiter=":") ;\
+ ((line++)) ;\
+ if [ "$$line" != "1" ]; then \
+ translation=$$(head -n "$$line" "$<" | tail -1 | grep msgstr | sed 's|msgstr "\(.*\)"|\1|') ;\
+ if [ "$$translation" != "" ]; then \
+ sed "N;s@\(p\?x\?ref\){$$(echo $$e | sed 's| |[\\n ]|g')\(,\|}\)@\1{$$translation\2@g;P;D" -i "$@.tmp" ;\
+ fi ;\
+ fi ;\
+ fi ;\
done
endef