summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-07-20 14:44:37 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-07-20 14:44:37 +0000
commitf17896d1b996da13d21e07836de59cbb4d57e706 (patch)
tree74ce175fbc2ead6b6677b5a794eeeb29b9a20821 /perl-install
parentf8044c571465cfe674bf82066076340aa93d13d5 (diff)
downloaddrakx-backup-do-not-use-f17896d1b996da13d21e07836de59cbb4d57e706.tar
drakx-backup-do-not-use-f17896d1b996da13d21e07836de59cbb4d57e706.tar.gz
drakx-backup-do-not-use-f17896d1b996da13d21e07836de59cbb4d57e706.tar.bz2
drakx-backup-do-not-use-f17896d1b996da13d21e07836de59cbb4d57e706.tar.xz
drakx-backup-do-not-use-f17896d1b996da13d21e07836de59cbb4d57e706.zip
externalize the pm 2 pm_.c in fake_c.pl
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/share/po/Makefile2
-rwxr-xr-xperl-install/share/po/fake_c.pl14
2 files changed, 15 insertions, 1 deletions
diff --git a/perl-install/share/po/Makefile b/perl-install/share/po/Makefile
index a9bcad71d..1e2f640ce 100644
--- a/perl-install/share/po/Makefile
+++ b/perl-install/share/po/Makefile
@@ -34,6 +34,6 @@ verif2:
grep "^msgid" DrakX.pot | sort | diff - tmp.pot.light | grep "^>" || true
$(PMSCFILES): %_.c: %
- perl -lpe 's|^(__?\()| $$1|; s,\Qs/#.*//,,; s|//|/""/|g; s,(^|[^\$$])#([^+].*),\1/*\2*/,; s|$$|\\n\\|' $< > $@
+ ./fake_c.pl $< > $@
# for i in *.po; do echo -n "$i "; msgfmt -v $i 2>&1; done | perl -e 'print map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, (split)[1] ] } <>'
diff --git a/perl-install/share/po/fake_c.pl b/perl-install/share/po/fake_c.pl
new file mode 100755
index 000000000..86146bdaf
--- /dev/null
+++ b/perl-install/share/po/fake_c.pl
@@ -0,0 +1,14 @@
+#!/usr/bin/perl -lp
+
+s|_\(\[(.*),\s*(.*),\s*(.*)\]| ngettext($2,$3,$1)|; # special plural form handling
+
+s|^(__?\()| $1|; # add a blank at the beginning (?!)
+s,\Qs/#.*//,,; # ugly special case
+s|//|/""/|g; # ensure // or not understood as comments
+
+s,(^|[^\$])#([^+].*),\1/*\2*/,; # rewrite comments to C format except for:
+ # - ``#+ xxx'' comments which are kept
+ # - ``$#xxx'' which are not comments
+
+s|$|\\n\\|; # multi-line strings not handled in C
+