From 6e79b08e5b984b8dbfc97d5029707719e30a3749 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jul 2017 17:18:40 -0400 Subject: po/HACKING: mention package dependencies --- po/HACKING | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/po/HACKING b/po/HACKING index 2a29adc..9ab35a7 100644 --- a/po/HACKING +++ b/po/HACKING @@ -9,8 +9,12 @@ files, and then (2) copy them and (3) fill them in. libretools' .pot files are not tracked in git; they are created by running `make` (you'll need a checkout of both devtools-par and - libretools to run `make` if building from git): + libretools to run `make` if building from git). In addition to the + usual (`base-devel`) depenencies when running `make`, you'll need + the `ruby-ronn` package as well. + $ sudo pacman -S --needed base-devel ruby-ronn + ... $ git clone https://git.parabola.nu/packages/devtools-par.git/ $ git clone https://git.parabola.nu/packages/libretools.git/ $ cd libretools -- cgit v1.2.3-54-g00ecf From 6c99c19a7663248a85df81f2db24a323d2956606 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jul 2017 17:38:02 -0400 Subject: test: librechroot: verify that the `-n` flag works --- test/librechroot-test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index d225834..42d4803 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -82,6 +82,17 @@ it_displays_help_and_fails_with_0_args() { [[ "$(sed -n 2p $tmpdir/stderr)" =~ Usage:.* ]] } +it_obeys_the_n_flag() { + require network sudo || return 0 + + not test -f "$chrootdir/$roundup_test_name/$roundup_test_name/$roundup_test_name.stamp" + + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + testsudo librechroot -n "$roundup_test_name" -l "$roundup_test_name" run touch /"$roundup_test_name.stamp" + + test -f "$chrootdir/$roundup_test_name/$roundup_test_name/$roundup_test_name.stamp" +} + # requires sudo so we know it's not failing because it needs root it_fails_for_unknown_commands() { require sudo || return 0 -- cgit v1.2.3-54-g00ecf From b3e5bf9dec22dd447ddb7d466f3e73b6f0f5b533 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jul 2017 17:52:32 -0400 Subject: librechroot: Respect the -n flag (fixes test) --- src/chroot-tools/librechroot | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 01353a4..ff764b6 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -291,6 +291,9 @@ main() { COPY=$LIBREUSER [[ $COPY != root ]] || COPY=copy + declare -i retconf=0 + load_conf chroot.conf CHROOTDIR CHROOT || retconf=$? + local mode=enter while getopts 'n:l:NC:M:A:w:r:' opt; do case $opt in @@ -372,13 +375,12 @@ main() { :;; esac - if [[ $mode == help ]]; then usage return $EXIT_SUCCESS fi - load_conf chroot.conf CHROOTDIR CHROOT + [[ $retconf = 0 ]] || exit $retconf eval "$(calculate_directories)" readonly LIBREUSER LIBREHOME -- cgit v1.2.3-54-g00ecf From aa4a03eae20d3de63c6e2659ebdfe1be5db434ee Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jul 2017 21:31:13 -0400 Subject: Makefile: have docdir behave the way the GNU standards say. I had docdir = $(datarootdir)/doc pkgdocdir = $(docdir)/libretools # install docs to $(pkgdocdir) but the GNU Coding Standards (July 25, 2016 revision), say I should be doing docdir = $(datarootdir)/doc/libretools # install docs to $(docdir) As the config.mk states, we aren't a GNU package. But let's still follow their standards here, to follow the principle of least surprise. --- build-aux/Makefile.each.head/20-libretools.mk | 1 - build-aux/Makefile.each.tail/20-libretools.mk | 4 ++-- build-aux/Makefile.once.head/00-libretools.mk | 1 - config.mk | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/build-aux/Makefile.each.head/20-libretools.mk b/build-aux/Makefile.each.head/20-libretools.mk index 20abd8b..be4b8aa 100644 --- a/build-aux/Makefile.each.head/20-libretools.mk +++ b/build-aux/Makefile.each.head/20-libretools.mk @@ -14,7 +14,6 @@ # along with this program. If not, see . pkgconfdir = $(sysconfdir)/libretools.d -pkgdocdir = $(docdir)/libretools pkglibexecdir = $(libexecdir)/libretools # Auto-detect ######################################################## diff --git a/build-aux/Makefile.each.tail/20-libretools.mk b/build-aux/Makefile.each.tail/20-libretools.mk index 49e8fb8..4398e2c 100644 --- a/build-aux/Makefile.each.tail/20-libretools.mk +++ b/build-aux/Makefile.each.tail/20-libretools.mk @@ -26,7 +26,7 @@ files.out.all += $(filter-out $(files.src),$(libretools.out)) \ files.sys.all += $(addprefix $(bindir)/,$(libretools.out.bins)) \ $(addprefix $(pkgconfdir)/,$(libretools.out.confs)) \ $(addprefix $(pkglibexecdir)/,$(libretools.out.libexecs) $(libretools.out.libs)) \ - $(addprefix $(pkgdocdir)/,$(libretools.out.docs)) \ + $(addprefix $(docdir)/,$(libretools.out.docs)) \ $(addprefix $(mandir)/man1/,$(filter %.1,$(libretools.out.mans))) \ $(addprefix $(mandir)/man2/,$(filter %.2,$(libretools.out.mans))) \ $(addprefix $(mandir)/man3/,$(filter %.3,$(libretools.out.mans))) \ @@ -61,7 +61,7 @@ $(outdir)/everything.pot: $(addprefix $(outdir)/,$(addsuffix .pot,$(libretools.p # Install rules ###################################################### $(DESTDIR)$(pkgconfdir)/% : $(outdir)/% ; install -T -Dm644 '$<' '$@' -$(DESTDIR)$(pkgdocdir)/% : $(outdir)/% ; install -T -Dm644 '$<' '$@' +$(DESTDIR)$(docdir)/% : $(outdir)/% ; install -T -Dm644 '$<' '$@' $(DESTDIR)$(mandir)/man1/%.1: $(outdir)/%.1; install -T -Dm644 '$<' '$@' $(DESTDIR)$(mandir)/man2/%.2: $(outdir)/%.2; install -T -Dm644 '$<' '$@' $(DESTDIR)$(mandir)/man3/%.3: $(outdir)/%.3; install -T -Dm644 '$<' '$@' diff --git a/build-aux/Makefile.once.head/00-libretools.mk b/build-aux/Makefile.once.head/00-libretools.mk index 1f2957d..7c1ffef 100644 --- a/build-aux/Makefile.once.head/00-libretools.mk +++ b/build-aux/Makefile.once.head/00-libretools.mk @@ -18,7 +18,6 @@ define mod.libretools.doc # Inputs: # - Install paths (Directory variables): # - `pkgconfdir = $(sysconfdir)/libretools.d` -# - `pkgdocdir = $(docdir)/libretools` # - `pkglibexecdir = $(libexecdir)/libretools` # - Outputs (Directory variables): # - `libretools.out.mans` diff --git a/config.mk b/config.mk index 0d564e0..882e2e9 100644 --- a/config.mk +++ b/config.mk @@ -26,7 +26,6 @@ datadir = $(datarootdir) #sysconfdir = $(prefix)/etc sysconfdir = /etc -docdir = $(datarootdir)/doc mandir = $(datarootdir)/man devtoolsdir = $(call abspath,$(topsrcdir)/../devtools-par) -- cgit v1.2.3-54-g00ecf From afc6093ea5b87d2d4c870cef7ef66548d3d576ba Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jul 2017 21:32:08 -0400 Subject: Makefile: rename $(outdir)/everything.pot to $(srcdir)/dir.pot --- Makefile | 2 +- build-aux/Makefile.each.tail/20-libretools.mk | 8 +++----- build-aux/Makefile.once.head/00-libretools.mk | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e7b35e4..444a669 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ $(outdir)/shellcheck: cd $(@D)/test && ./testenv $(TESTENVFLAGS) 'cd "$$TMPDIR/destdir" && find \( $(shellcheck.prune) \) -prune -o -not -type d -exec shellcheck $(shellcheck.flags) {} +' _po_rule = \ -po/%(pkg).pot: $(addsuffix /everything.pot,$(pkg.%(pkg))); \ +$(srcdir)/po/%(pkg).pot: $(addsuffix /dir.pot,$(pkg.%(pkg))); \ cat $^ | msguniq -Fi --to-code=UTF-8 > '$@' $(eval $(foreach pkg,$(pkgs),\ $(subst %(pkg),$(pkg),$(value _po_rule))$(at.nl))) diff --git a/build-aux/Makefile.each.tail/20-libretools.mk b/build-aux/Makefile.each.tail/20-libretools.mk index 4398e2c..8902a26 100644 --- a/build-aux/Makefile.each.tail/20-libretools.mk +++ b/build-aux/Makefile.each.tail/20-libretools.mk @@ -22,7 +22,7 @@ endif # Connect with `files` module ######################################## files.src.gen += $(libretools.src.devtools) files.out.all += $(filter-out $(files.src),$(libretools.out)) \ - $(if $(strip $(libretools.pots)),everything.pot) + $(if $(strip $(libretools.pots)),dir.pot) files.sys.all += $(addprefix $(bindir)/,$(libretools.out.bins)) \ $(addprefix $(pkgconfdir)/,$(libretools.out.confs)) \ $(addprefix $(pkglibexecdir)/,$(libretools.out.libexecs) $(libretools.out.libs)) \ @@ -52,11 +52,9 @@ $(outdir)/%: $(srcdir)/%.ronn ronn --roff $(RONNFLAGS) < '$<' > '$@' $(outdir)/%.html: $(srcdir)/%.ronn ronn --html $(RONNFLAGS) < '$<' > '$@' -$(outdir)/%.pot: $(outdir)/% $(topsrcdir)/src/lib/librexgettext +$(srcdir)/%.pot: $(srcdir)/% $(topsrcdir)/src/lib/librexgettext $(topsrcdir)/src/lib/librexgettext $(LIBREXGETTEXT_FLAGS) '$<' > '$@' -$(outdir)/%.pot: $(srcdir)/% $(topsrcdir)/src/lib/librexgettext - $(topsrcdir)/src/lib/librexgettext $(LIBREXGETTEXT_FLAGS) '$<' > '$@' -$(outdir)/everything.pot: $(addprefix $(outdir)/,$(addsuffix .pot,$(libretools.pots))) +$(srcdir)/dir.pot: $(addprefix $(outdir)/,$(addsuffix .pot,$(libretools.pots))) cat $^ | $(libretools.pofmt) > '$@' # Install rules ###################################################### diff --git a/build-aux/Makefile.once.head/00-libretools.mk b/build-aux/Makefile.once.head/00-libretools.mk index 7c1ffef..832649d 100644 --- a/build-aux/Makefile.once.head/00-libretools.mk +++ b/build-aux/Makefile.once.head/00-libretools.mk @@ -61,7 +61,7 @@ define mod.libretools.doc # - Target : `$(outdir)/%.html: $(srcdir)/%.ronn` # - Target : `$(outdir)/%.pot: $(outdir)/%` # - Target : `$(outdir)/%.pot: $(srcdir)/%` -# - Target : `$(outdir)/everything.pot` +# - Target : `$(srcdir)/dir.pot` # - Target : `$(outdir)/%.ugly: $(srcdir)/%.in $(srcdir)/%.patch` # - Target : `$(outdir)/%: $(outdir)/%.ugly # - Target : `$(DESTDIR)...:` -- cgit v1.2.3-54-g00ecf From bcc12b176fc19070aa16940ff4840830bc2ecd59 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jul 2017 22:08:04 -0400 Subject: Makefile: add support for compiling and installing localizations This means that the new `po/files.generate` target can be used to build the `.pot` files without doing anything else; we can stop requiring translators to install ruby-ronn. It also means that we can put the `.pot` files in the source tarball, to make it even easier for translators. Unfortunately, it does add the extra step of having to create another symlink when adding a new locale. --- Makefile | 2 +- po/.gitignore | 1 + po/HACKING | 23 +++++++++++++---------- po/Makefile | 11 +++++++++++ po/es/Makefile | 1 + po/subdir.mk | 17 +++++++++++++++++ 6 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 po/Makefile create mode 120000 po/es/Makefile create mode 100644 po/subdir.mk diff --git a/Makefile b/Makefile index 444a669..f6b78e9 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,6 @@ libretools.out.confs = libretools.out = $(foreach pkg,$(pkgs),po/$(pkg).pot) files.src.gen += .srcversion-libretools.mk .srcversion-devtools.mk -nested.subdirs = $(foreach pkg,$(pkgs),$(pkg.$(pkg))) +nested.subdirs = $(foreach pkg,$(pkgs),$(pkg.$(pkg))) po include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/po/.gitignore b/po/.gitignore index e3a8c5d..514b3d0 100644 --- a/po/.gitignore +++ b/po/.gitignore @@ -1 +1,2 @@ *.pot +*/*.mo diff --git a/po/HACKING b/po/HACKING index 9ab35a7..5dd207c 100644 --- a/po/HACKING +++ b/po/HACKING @@ -2,23 +2,24 @@ Translations for programs are provided in files with the `.po` suffix. These are created by copying PO-template (`.pot`) files, and filling in the missing "msgstr" values. -To add a translation, you'll first (1) need to create the `.pot` -files, and then (2) copy them and (3) fill them in. +To add a translation, you'll first (1) need to create the `.pot` files +if you don't already have them, and then (2) copy them and (3) fill +them in. # 1. Create `.pot` files + If you are working from a release source tarball, you can skip this + step (the `.pot` files are included in the tarball); if you are + working from git, read on. + libretools' .pot files are not tracked in git; they are created by - running `make` (you'll need a checkout of both devtools-par and - libretools to run `make` if building from git). In addition to the - usual (`base-devel`) depenencies when running `make`, you'll need - the `ruby-ronn` package as well. + running `make`. You'll need a checkout of both "devtools-par" and + "libretools" to run `make` if building from git. - $ sudo pacman -S --needed base-devel ruby-ronn - ... $ git clone https://git.parabola.nu/packages/devtools-par.git/ $ git clone https://git.parabola.nu/packages/libretools.git/ $ cd libretools - $ make + $ make po/files.generate ... $ cd po/ $ ls @@ -33,10 +34,12 @@ files, and then (2) copy them and (3) fill them in. Create a folder under `po/` with the two-letter language code[^1] you want to add. Then, copy the `.pot` files to that folder, - changing the file extension to `.po`; for example: + changing the file extension to `.po`. Finally, link the `subdir.mk` + file to be the Makefile for that directory. For example: $ mkdir es $ for file in *.pot; do cp $file es/${file%t}; done + $ ln -s ../subdir.mk es/Makefile [^1]: See the langauge code table here: diff --git a/po/Makefile b/po/Makefile new file mode 100644 index 0000000..1e56edd --- /dev/null +++ b/po/Makefile @@ -0,0 +1,11 @@ +include $(dir $(lastword $(MAKEFILE_LIST)))/../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +domains = libretools librelib gitget xbs +locales := $(filter-out .,$(sort $(patsubst %/,%,$(dir $(files.src.src))))) + +files.src.gen += $(addsuffix .pot,$(domains)) +nested.subdirs += $(locales) +at.subdirs += .. + +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/po/es/Makefile b/po/es/Makefile new file mode 120000 index 0000000..71a1159 --- /dev/null +++ b/po/es/Makefile @@ -0,0 +1 @@ +../subdir.mk \ No newline at end of file diff --git a/po/subdir.mk b/po/subdir.mk new file mode 100644 index 0000000..6c4120b --- /dev/null +++ b/po/subdir.mk @@ -0,0 +1,17 @@ +include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +locale = $(notdir $(srcdir)) +domains = $(patsubst %.po,%,$(filter %.po,$(files.src.src))) + +$(outdir)/%.mo: $(srcdir)/%.po $(call at.path,../%.po) + msgfmt -o $@ $< + +$(DESTDIR)$(localedir)/$(locale)/LC_MESSAGES/%.mo: $(outdir)/%.mo + install -T -Dm644 '$<' '$@' + +files.out.all += $(addsuffix .mo,$(domains)) +files.sys.all += $(foreach domain,$(domains),$(localedir)/$(locale)/LC_MESSAGES/$(domain).mo) +at.subdirs += .. + +include $(topsrcdir)/build-aux/Makefile.tail.mk -- cgit v1.2.3-54-g00ecf From 5b686bdd35959ff8ffc8636035e89c1457c6d9c9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jul 2017 22:09:56 -0400 Subject: l10n: es: Fix obvious problems There are two places where the punctuation was on the outside of the end-quote; leading to syntax errors. There's one place where the msgid was partially translated. --- po/es/gitget.po | 2 +- po/es/librelib.po | 2 +- po/es/libretools.po | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/po/es/gitget.po b/po/es/gitget.po index f248569..d3478f7 100644 --- a/po/es/gitget.po +++ b/po/es/gitget.po @@ -112,7 +112,7 @@ msgid "This exists because gitget used to be called libregit, and took the " "floating around that use it." msgstr "Esto existe porque gitget solía llamarse libregit, y tomó los " "argumentos en este formato, y estoy seguro de que hay unos cuantos scripts " - "flotando alrededor que lo usan". + "flotando alrededor que lo usan." #: src/gitget/libregit:30 msgid "Clones or pulls from the git URL '', and checks out the git " diff --git a/po/es/librelib.po b/po/es/librelib.po index ff4c460..2a8c977 100644 --- a/po/es/librelib.po +++ b/po/es/librelib.po @@ -27,7 +27,7 @@ msgstr "Imprime el blacklist" msgid "Uses the cache, but downloads it if it doesn't exist. Also " "normalizes the blacklist for easier parsing." msgstr "Utiliza el caché, pero la descarga si no existe. También " - "normaliza la lista negra para facilitar el análisis sintáctico". + "normaliza la lista negra para facilitar el análisis sintáctico." #. embedded usage text #: src/lib/blacklist.sh:42 diff --git a/po/es/libretools.po b/po/es/libretools.po index ee3acf8..6add814 100644 --- a/po/es/libretools.po +++ b/po/es/libretools.po @@ -15,7 +15,7 @@ msgid "Finished, your packaging directory tree looks like this now:" msgstr "Terminado, su árbol de directorio de empaquetado es así ahora:" #: src/abslibre-tools/diff-unfree:30 -msgid "Usage: %s [community|packages] [paquete-no-libre] [repo]" +msgid "Usage: %s [community|packages] [unfree-package] [repo]" msgstr "Uso: %s [community|packages] [paquete-no-libre] [repo]" #: src/abslibre-tools/diff-unfree:31 -- cgit v1.2.3-54-g00ecf From 5dfaaed8f7002ee1385c93fa14647ff128138f12 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 18:17:29 -0400 Subject: testenv: make resilient to changes in config.mk --- test/testenv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/testenv b/test/testenv index 3bb827f..a744308 100755 --- a/test/testenv +++ b/test/testenv @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e # Parse the arguments NETWORK=true @@ -31,7 +32,7 @@ old_pwd="$(pwd)" if [[ -f $0 ]]; then cd "${0%/*}" fi -if ! make -C .. install DESTDIR="$destdir" &>"$TMPDIR/make-output"; then +if ! make -C .. install prefix=/usr sysconfdir=/etc DESTDIR="$destdir" &>"$TMPDIR/make-output"; then echo 'error creating local install, cannot run tests' >&2 cat "$TMPDIR/make-output" exit 1 -- cgit v1.2.3-54-g00ecf From 6b772f881dd8bb1a2a40181e6c76187c9c847c30 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 18:15:49 -0400 Subject: test: librexgettext: Add tests --- test/librexgettext-test.sh | 58 ++++++++++++++++++++++ test/librexgettext.d/.gitignore | 1 + test/librexgettext.d/combine.pot | 15 ++++++ test/librexgettext.d/combine1.sh | 5 ++ test/librexgettext.d/combine2.sh | 5 ++ .../it_fails_on_missing_final_flag_description.sh | 4 ++ .../it_fails_on_subshell_flag_descriptions.sh | 7 +++ .../it_handles_librefetch_flags.pot | 40 +++++++++++++++ .../librexgettext.d/it_handles_librefetch_flags.sh | 15 ++++++ .../it_handles_multiple_skipped_flags.pot | 58 ++++++++++++++++++++++ .../it_handles_multiple_skipped_flags.sh | 17 +++++++ test/librexgettext.d/it_handles_zero_flags.pot | 0 test/librexgettext.d/it_handles_zero_flags.sh | 4 ++ 13 files changed, 229 insertions(+) create mode 100644 test/librexgettext-test.sh create mode 100644 test/librexgettext.d/.gitignore create mode 100644 test/librexgettext.d/combine.pot create mode 100644 test/librexgettext.d/combine1.sh create mode 100644 test/librexgettext.d/combine2.sh create mode 100644 test/librexgettext.d/it_fails_on_missing_final_flag_description.sh create mode 100644 test/librexgettext.d/it_fails_on_subshell_flag_descriptions.sh create mode 100644 test/librexgettext.d/it_handles_librefetch_flags.pot create mode 100644 test/librexgettext.d/it_handles_librefetch_flags.sh create mode 100644 test/librexgettext.d/it_handles_multiple_skipped_flags.pot create mode 100644 test/librexgettext.d/it_handles_multiple_skipped_flags.sh create mode 100644 test/librexgettext.d/it_handles_zero_flags.pot create mode 100644 test/librexgettext.d/it_handles_zero_flags.sh diff --git a/test/librexgettext-test.sh b/test/librexgettext-test.sh new file mode 100644 index 0000000..f9a0031 --- /dev/null +++ b/test/librexgettext-test.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env roundup + +describe librexgettext +. ./test-common.sh + +it_displays_help() { + LC_ALL=C librexgettext -h >$tmpdir/stdout 2>$tmpdir/stderr + + [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] + empty $tmpdir/stderr +} + +it_fails_with_0_args() { + librexgettext >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + + [[ $stat != 0 ]] + empty $tmpdir/stdout + not empty $tmpdir/stderr +} + +passcase() { + librexgettext librexgettext.d/$roundup_test_name.sh > $tmpdir/actual.pot 2>$tmpdir/stderr + empty $tmpdir/stderr + diff -u librexgettext.d/$roundup_test_name.pot $tmpdir/actual.pot +} + +it_handles_multiple_skipped_flags() { passcase; } +it_handles_zero_flags() { passcase; } +it_handles_librefetch_flags() { passcase; } + +it_fails_on_missing_final_flag_description() { + librexgettext librexgettext.d/$roundup_test_name.sh > /dev/null 2>$tmpdir/stderr || stat=$? + + [[ $stat != 0 ]] + [[ "$(sed 1q $tmpdir/stderr)" = "librexgettext.d/$roundup_test_name.sh:4:"* ]] +} + + +it_fails_on_subshell_flag_descriptions() { + librexgettext librexgettext.d/$roundup_test_name.sh > /dev/null 2>$tmpdir/stderr || stat=$? + + [[ $stat != 0 ]] + [[ "$(sed 1q $tmpdir/stderr)" = "librexgettext.d/$roundup_test_name.sh:4-6:"* ]] +} + +it_doesnt_keep_failing() { + librexgettext some_file_that_doesnt_exist >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + + [[ $stat != 0 ]] + empty $tmpdir/stdout + [[ "$(wc -l <$tmpdir/stderr)" == 1 ]] +} + +it_handles_multiple_files() { + librexgettext librexgettext.d/combine1.sh librexgettext.d/combine2.sh > $tmpdir/actual.pot 2>$tmpdir/stderr + empty $tmpdir/stderr + diff -u librexgettext.d/combine.pot $tmpdir/actual.pot +} diff --git a/test/librexgettext.d/.gitignore b/test/librexgettext.d/.gitignore new file mode 100644 index 0000000..f0febc8 --- /dev/null +++ b/test/librexgettext.d/.gitignore @@ -0,0 +1 @@ +!/*.pot diff --git a/test/librexgettext.d/combine.pot b/test/librexgettext.d/combine.pot new file mode 100644 index 0000000..80d066f --- /dev/null +++ b/test/librexgettext.d/combine.pot @@ -0,0 +1,15 @@ +#: librexgettext.d/combine1.sh:4 +msgid "Flag a" +msgstr "" + +#: librexgettext.d/combine1.sh:5 +msgid "Flag b" +msgstr "" + +#: librexgettext.d/combine2.sh:4 +msgid "Flag 1" +msgstr "" + +#: librexgettext.d/combine2.sh:5 +msgid "Flag 2" +msgstr "" diff --git a/test/librexgettext.d/combine1.sh b/test/librexgettext.d/combine1.sh new file mode 100644 index 0000000..9946076 --- /dev/null +++ b/test/librexgettext.d/combine1.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +. libremessages + +flag -a 'Flag a' \ + -b 'Flag b' diff --git a/test/librexgettext.d/combine2.sh b/test/librexgettext.d/combine2.sh new file mode 100644 index 0000000..441e87a --- /dev/null +++ b/test/librexgettext.d/combine2.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +. libremessages + +flag -1 'Flag 1' \ + -2 'Flag 2' diff --git a/test/librexgettext.d/it_fails_on_missing_final_flag_description.sh b/test/librexgettext.d/it_fails_on_missing_final_flag_description.sh new file mode 100644 index 0000000..1c9fc23 --- /dev/null +++ b/test/librexgettext.d/it_fails_on_missing_final_flag_description.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +. libremessages + +flag -a diff --git a/test/librexgettext.d/it_fails_on_subshell_flag_descriptions.sh b/test/librexgettext.d/it_fails_on_subshell_flag_descriptions.sh new file mode 100644 index 0000000..f6be764 --- /dev/null +++ b/test/librexgettext.d/it_fails_on_subshell_flag_descriptions.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +. libremessages + +flag '-a' \ + "$(echo foo)" \ + '-h' \ + help diff --git a/test/librexgettext.d/it_handles_librefetch_flags.pot b/test/librexgettext.d/it_handles_librefetch_flags.pot new file mode 100644 index 0000000..0d76a49 --- /dev/null +++ b/test/librexgettext.d/it_handles_librefetch_flags.pot @@ -0,0 +1,40 @@ +#: librexgettext.d/it_handles_librefetch_flags.sh:4 +msgid "Settings:" +msgstr "" + +#: librexgettext.d/it_handles_librefetch_flags.sh:5 +msgid "Force create mode (don't download)" +msgstr "" + +#: librexgettext.d/it_handles_librefetch_flags.sh:6 +msgid "Force download mode (don't create)" +msgstr "" + +#: librexgettext.d/it_handles_librefetch_flags.sh:7 +msgid "FILE" +msgstr "" + +#: librexgettext.d/it_handles_librefetch_flags.sh:7 +msgid "Use an alternate build script (instead of 'PKGBUILD'). If an " + "SRCBUILD exists in the same directory, it is used instead" +msgstr "" + +#: librexgettext.d/it_handles_librefetch_flags.sh:10 +msgid "Alternate modes:" +msgstr "" + +#: librexgettext.d/it_handles_librefetch_flags.sh:11 +msgid "Generate integrity checks for source files" +msgstr "" + +#: librexgettext.d/it_handles_librefetch_flags.sh:12 +msgid "Print the effective build script (SRCBUILD)" +msgstr "" + +#: librexgettext.d/it_handles_librefetch_flags.sh:13 +msgid "Generate and print the location of the effective makepkg script" +msgstr "" + +#: librexgettext.d/it_handles_librefetch_flags.sh:15 +msgid "Show this message" +msgstr "" diff --git a/test/librexgettext.d/it_handles_librefetch_flags.sh b/test/librexgettext.d/it_handles_librefetch_flags.sh new file mode 100644 index 0000000..579ca96 --- /dev/null +++ b/test/librexgettext.d/it_handles_librefetch_flags.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +. libremessages + +flag 'Settings:' \ + "-C" "Force create mode (don't download)" \ + "-D" "Force download mode (don't create)" \ + "-p <$(_ FILE)>" "Use an alternate build script (instead of + 'PKGBUILD'). If an SRCBUILD exists in the same + directory, it is used instead" \ + 'Alternate modes:' \ + "-g, --geninteg" "Generate integrity checks for source files" \ + "-S, --srcbuild" "Print the effective build script (SRCBUILD)" \ + "-M, --makepkg" "Generate and print the location of the + effective makepkg script" \ + "-h, --help" "Show this message" diff --git a/test/librexgettext.d/it_handles_multiple_skipped_flags.pot b/test/librexgettext.d/it_handles_multiple_skipped_flags.pot new file mode 100644 index 0000000..cae2a17 --- /dev/null +++ b/test/librexgettext.d/it_handles_multiple_skipped_flags.pot @@ -0,0 +1,58 @@ +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:4 +msgid "Flag 1" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:4 +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:6 +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:7 +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:8 +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:9 +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:10 +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:11 +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:13 +msgid "OPTARG" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:5 +msgid "Flag 2" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:6 +msgid "Flag 3" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:7 +msgid "Flag 4" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:8 +msgid "Flag 5" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:9 +msgid "Flag 6" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:10 +msgid "Flag 7" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:11 +msgid "Flag 8" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:13 +msgid "FLAG 1" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:14 +msgid "FLAG 2" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:16 +msgid "FLAG A" +msgstr "" + +#: librexgettext.d/it_handles_multiple_skipped_flags.sh:17 +msgid "FLAG B" +msgstr "" diff --git a/test/librexgettext.d/it_handles_multiple_skipped_flags.sh b/test/librexgettext.d/it_handles_multiple_skipped_flags.sh new file mode 100644 index 0000000..3b4dcee --- /dev/null +++ b/test/librexgettext.d/it_handles_multiple_skipped_flags.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +. libremessages + +flag "-a $(_ OPTARG)" 'Flag 1' \ + '-b' 'Flag 2' \ + "-c $(_ OPTARG)" 'Flag 3' \ + "-d $(_ OPTARG)" 'Flag 4' \ + "-e $(_ OPTARG)" 'Flag 5' \ + "-f $(_ OPTARG)" 'Flag 6' \ + "-g $(_ OPTARG)" 'Flag 7' \ + "-h $(_ OPTARG)" 'Flag 8' + +flag "-A $(_ OPTARG)" 'FLAG 1' \ + '-B' 'FLAG 2' + +flag '-1' 'FLAG A' \ + '-2' 'FLAG B' diff --git a/test/librexgettext.d/it_handles_zero_flags.pot b/test/librexgettext.d/it_handles_zero_flags.pot new file mode 100644 index 0000000..e69de29 diff --git a/test/librexgettext.d/it_handles_zero_flags.sh b/test/librexgettext.d/it_handles_zero_flags.sh new file mode 100644 index 0000000..2b6369c --- /dev/null +++ b/test/librexgettext.d/it_handles_zero_flags.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +. libremessages + +flag -- cgit v1.2.3-54-g00ecf From 5ebc9f2a5ad207b8621e1aacf7bb23d32a7ce772 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 18:32:20 -0400 Subject: librexgettext: Make the tests pass --- src/lib/librexgettext | 84 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 16 deletions(-) diff --git a/src/lib/librexgettext b/src/lib/librexgettext index cc18999..27a701d 100755 --- a/src/lib/librexgettext +++ b/src/lib/librexgettext @@ -40,7 +40,7 @@ fi errusage() { if [[ $# -gt 0 ]]; then fmt="$(gettext "$1")"; shift - printf "${0##*/}: $fmt\n" "$@" + printf "${0##*/}: $fmt\n" "$@" >&2 fi usage >&2 } @@ -76,6 +76,7 @@ xgettext-sh() { } xgettext-flag() { + local file="$1" { # Stage 1: Generate # @@ -95,9 +96,10 @@ xgettext-flag() { declare -i i for (( i=1; empties < 3; i++ )); do local out - out="$(xgettext-sh --keyword="flag:$i,\"$i\"" "$@")" + out="$(xgettext-sh --keyword="flag:$i,\"$i\"" -- "$file")" if [[ -n $out ]]; then printf -- '%s\n' "$out" + empties=0 else empties+=1 fi @@ -130,36 +132,77 @@ xgettext-flag() { # # We do this by simply sorting them by the location # that they appear in the file. Then, when we see the - # argument number go back down to 1, we know that a - # new invocation has started! - IFS=$'\n' - local locations=($( + # argument number go back down, we know that a new + # invocation has started! + local locations=() + readarray -t locations < <( local i for i in "${!msgs[@]}"; do + local lines=() + readarray -t lines < <(printf '%s' "${msgs[$i]}") + declare -i arg row - local lines=(${msgs[$i]}) arg=${lines[0]#'#. '} row=${lines[1]##*:} - printf '%d.%d %d\n' "$row" "$arg" "$i" - done | sort -n - )) + + printf '%d %d %d\n' "$row" "$arg" "$i" + done | sort -k 1n -k 2n + ) # Stage 4: Output # # Now, we prune out the arguments that aren't # localizable. Also, remove the "#." comment lines. # As explained above (in stage 3), when we see $arg go - # to 1, that's the beginning of a new invocation. + # down, that's the beginning of a new invocation. local expectflag=true + local prev_arg=0 + local prev_row=0 # for better error messages only; no real logic local location for location in "${locations[@]}"; do - IFS=' .' + IFS=' ' local row arg i read -r row arg i <<<"$location" local msg="${msgs[$i]#*$'\n'}" - # Now we operate based on $row, $arg, and $msg - if [[ $arg == 1 ]]; then - expectflag=true + + # See if we need to fiddle with $expectflag + # (and do some sanity checking). + if [[ $arg != "$((prev_arg+1))" ]]; then + if ! $expectflag; then + local pos + if [[ $row != "$prev_row" ]]; then + printf -v pos "%s:%d-%d" "$file" "$prev_row" "$row" + else + printf -v pos "%s:%d" "$file" "$prev_row" + fi + >&2 printf "%s: $(gettext "flag error: Missing expected flag meaning at argument %d")\n" \ + "$pos" "$((prev_arg+1))" + exit 1 # $EXIT_FAILURE + elif [[ $arg == "$((prev_arg+2))" ]]; then + # skipped flag argument + expectflag=false + elif [[ "$arg" == 1 ]]; then + # started new invocation + expectflag=true + elif [[ $arg == 2 ]]; then + # started new invocation and skipped flag argument + expectflag=false + else + local pos + if [[ $row != "$prev_row" ]]; then + printf -v pos "%s:%d-%d" "$file" "$prev_row" "$row" + else + printf -v pos "%s:%d" "$file" "$prev_row" + fi + >&2 printf "%s: $(gettext "flag error: Jumped from argument %d to %d")\n" \ + "$pos" "$prev_arg" "$arg" + exit 1 # $EXIT_FAILURE + fi fi + prev_arg=$arg + prev_row=$row + + # Now we operate based on $row, $arg, $msg, + # and $expectflag. if $expectflag; then IFS=$'\n' local lines=(${msg}) @@ -177,6 +220,12 @@ xgettext-flag() { expectflag=true fi done + if ! $expectflag; then + >&2 printf "%s:%d: $(gettext "flag error: Missing expected flag meaning at argument %d")\n" \ + "$file" "$prev_row" \ + "$((prev_arg+1))" + exit 1 # $EXIT_FAILURE + fi } } @@ -186,6 +235,7 @@ whitespace-collapse() { } main() { + set -euE -o pipefail local simple=() local prose=() local files=() @@ -223,7 +273,9 @@ main() { { xgettext-sh "${simple[@]}" -- "${files[@]}" xgettext-sh "${prose[@]}" -- "${files[@]}" | whitespace-collapse - xgettext-flag -- "${files[@]}" + for file in "${files[@]}"; do + xgettext-flag "$file" + done } | sed '/^\#, sh-format/d' | msguniq -Fi --to-code=UTF-8 } -- cgit v1.2.3-54-g00ecf From 371a7e29d5718cadbe7cd1830050487f60946266 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 18:53:55 -0400 Subject: Get it producing .mo files again. --- po/subdir.mk | 2 +- src/lib/messages.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/po/subdir.mk b/po/subdir.mk index 6c4120b..3cddb5d 100644 --- a/po/subdir.mk +++ b/po/subdir.mk @@ -4,7 +4,7 @@ include $(topsrcdir)/build-aux/Makefile.head.mk locale = $(notdir $(srcdir)) domains = $(patsubst %.po,%,$(filter %.po,$(files.src.src))) -$(outdir)/%.mo: $(srcdir)/%.po $(call at.path,../%.po) +$(outdir)/%.mo: $(srcdir)/%.po $(call at.path,$(srcdir)/../%.pot) msgfmt -o $@ $< $(DESTDIR)$(localedir)/$(locale)/LC_MESSAGES/%.mo: $(outdir)/%.mo diff --git a/src/lib/messages.sh b/src/lib/messages.sh index 37ee1b8..f28ce7c 100644 --- a/src/lib/messages.sh +++ b/src/lib/messages.sh @@ -124,7 +124,12 @@ bullet() { # # A heading MUST end with a colon (':'), this is how it knows that it # is a heading. Similarly, a flag MUST NOT end with a colon. -flag() { +# +# NB: The opening curly brace is on a separate line because otherwise +# xgettext gets confused when parsing this file. It's a dumb bug in +# GNU xgettext. +flag() +{ local args=("$@") declare -i flaglen=0 -- cgit v1.2.3-54-g00ecf From e3d7fbca888e07f02c5867dd1e50393247a066b7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 20:12:32 -0400 Subject: po: add pot headers --- Makefile | 6 +----- po/.gitignore | 4 ++-- po/Makefile | 10 ++++++++++ po/es/gitget.po | 15 +++++++++++++++ po/es/librelib.po | 15 +++++++++++++++ po/es/libretools.po | 15 +++++++++++++++ po/es/xbs.po | 15 +++++++++++++++ po/header.po.head.in | 14 ++++++++++++++ 8 files changed, 87 insertions(+), 7 deletions(-) create mode 100644 po/header.po.head.in diff --git a/Makefile b/Makefile index f6b78e9..5d7ece2 100644 --- a/Makefile +++ b/Makefile @@ -39,11 +39,8 @@ $(outdir)/shellcheck: private shellcheck.prune += -o -type f -name source.sh.gen $(outdir)/shellcheck: cd $(@D)/test && ./testenv $(TESTENVFLAGS) 'cd "$$TMPDIR/destdir" && find \( $(shellcheck.prune) \) -prune -o -not -type d -exec shellcheck $(shellcheck.flags) {} +' -_po_rule = \ -$(srcdir)/po/%(pkg).pot: $(addsuffix /dir.pot,$(pkg.%(pkg))); \ - cat $^ | msguniq -Fi --to-code=UTF-8 > '$@' $(eval $(foreach pkg,$(pkgs),\ - $(subst %(pkg),$(pkg),$(value _po_rule))$(at.nl))) + $(srcdir)/po/$(pkg).pot: $(addsuffix /dir.pot,$(pkg.$(pkg)))$(at.nl))) libretools.out.mans = libretools.out.bins = @@ -51,7 +48,6 @@ libretools.out.libexecs = libretools.out.libs = libretools.out.docs = libretools.out.confs = -libretools.out = $(foreach pkg,$(pkgs),po/$(pkg).pot) files.src.gen += .srcversion-libretools.mk .srcversion-devtools.mk nested.subdirs = $(foreach pkg,$(pkgs),$(pkg.$(pkg))) po diff --git a/po/.gitignore b/po/.gitignore index 514b3d0..406ef00 100644 --- a/po/.gitignore +++ b/po/.gitignore @@ -1,2 +1,2 @@ -*.pot -*/*.mo +*.mo +/header.po.head diff --git a/po/Makefile b/po/Makefile index 1e56edd..96d8490 100644 --- a/po/Makefile +++ b/po/Makefile @@ -6,6 +6,16 @@ locales := $(filter-out .,$(sort $(patsubst %/,%,$(dir $(files.src.src))))) files.src.gen += $(addsuffix .pot,$(domains)) nested.subdirs += $(locales) + +# Have the header include the version number +$(srcdir)/header.po.head: $(srcdir)/%: $(srcdir)/%.in + @echo 'EDIT < $< > $@'; $(libretools.edit) < '$<' > '$@' +$(srcdir)/header.po.head: $(var.)PACKAGE $(var.)VERSION +files.src.int += header.po.head + +# Rely on ../Makefile to fill in a list of our .pot dependencies +$(srcdir)/%.pot: $(srcdir)/header.po.head + cat $^ | msguniq -Fi > '$@' at.subdirs += .. include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/po/es/gitget.po b/po/es/gitget.po index d3478f7..97f06d8 100644 --- a/po/es/gitget.po +++ b/po/es/gitget.po @@ -1,3 +1,18 @@ +# Copyright (C) 2017 David P +# This file is distributed under the same license as the libretools package. +# +msgid "" +msgstr "Project-Id-Version: libretools 20170705\n" + "Report-Msgid-Bugs-To: Parabola Hackers \n" + "PO-Revision-Date: 2017-07-05 19:27-0400\n" + "Last-Translator: David P \n" + "Language-Team: Spanish\n" + "Language: es\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + #: src/gitget/gitget:35 msgid "Failed to change to directory %s" msgstr "Falló al cambiar el directorio %s" diff --git a/po/es/librelib.po b/po/es/librelib.po index 2a8c977..f71b087 100644 --- a/po/es/librelib.po +++ b/po/es/librelib.po @@ -1,3 +1,18 @@ +# Copyright (C) 2017 David P +# This file is distributed under the same license as the libretools package. +# +msgid "" +msgstr "Project-Id-Version: libretools 20170705\n" + "Report-Msgid-Bugs-To: Parabola Hackers \n" + "PO-Revision-Date: 2017-07-05 20:02-0400\n" + "Last-Translator: David P \n" + "Language-Team: Spanish\n" + "Language: es\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + #: src/lib/archroot.sh:62 msgid "Unable to delete subvolume %s" msgstr "Incapaz de eliminar subvolumen %s" diff --git a/po/es/libretools.po b/po/es/libretools.po index 6add814..794051a 100644 --- a/po/es/libretools.po +++ b/po/es/libretools.po @@ -1,3 +1,18 @@ +# Copyright (C) 2017 David P +# This file is distributed under the same license as the libretools package. +# +msgid "" +msgstr "Project-Id-Version: libretools 20170705\n" + "Report-Msgid-Bugs-To: Parabola Hackers \n" + "PO-Revision-Date: 2017-07-06 13:59-0400\n" + "Last-Translator: David P \n" + "Language-Team: Spanish\n" + "Language: es\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + #: src/abslibre-tools/createworkdir:36 msgid "Creating WORKDIR at %s..." msgstr "Creando WORKDIR en %s..." diff --git a/po/es/xbs.po b/po/es/xbs.po index 35bd7f1..880b5df 100644 --- a/po/es/xbs.po +++ b/po/es/xbs.po @@ -1,3 +1,18 @@ +# Copyright (C) 2017 David P +# This file is distributed under the same license as the libretools package. +# +msgid "" +msgstr "Project-Id-Version: libretools 20170705\n" + "Report-Msgid-Bugs-To: Parabola Hackers \n" + "PO-Revision-Date: 2017-07-05 20:22-0400\n" + "Last-Translator: David P \n" + "Language-Team: Spanish\n" + "Language: es\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + #: src/xbs-abs/archrelease:12 msgid "Option requires an argument -- '%s'" msgstr "Las opciones requieren un argumento -- '%s'" diff --git a/po/header.po.head.in b/po/header.po.head.in new file mode 100644 index 0000000..2346080 --- /dev/null +++ b/po/header.po.head.in @@ -0,0 +1,14 @@ +# Copyright (C) YEAR FULL NAME +# This file is distributed under the same license as the @PACKAGE@ package. +# +msgid "" +msgstr "Project-Id-Version: @PACKAGE@ @VERSION@\n" + "Report-Msgid-Bugs-To: Parabola Hackers \n" + "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" + "Last-Translator: FULL NAME \n" + "Language-Team: LANGUAGE \n" + "Language: LANGCODE\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" -- cgit v1.2.3-54-g00ecf From 6c17560b9177c3354751bb4716ee1b17ddb3f172 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 20:22:29 -0400 Subject: po: do checks on localizations before compiling them --- po/subdir.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/po/subdir.mk b/po/subdir.mk index 3cddb5d..b9a2575 100644 --- a/po/subdir.mk +++ b/po/subdir.mk @@ -5,7 +5,8 @@ locale = $(notdir $(srcdir)) domains = $(patsubst %.po,%,$(filter %.po,$(files.src.src))) $(outdir)/%.mo: $(srcdir)/%.po $(call at.path,$(srcdir)/../%.pot) - msgfmt -o $@ $< + msgcmp --use-untranslated $< $(word 2,$^) + msgfmt -c -o $@ $< $(DESTDIR)$(localedir)/$(locale)/LC_MESSAGES/%.mo: $(outdir)/%.mo install -T -Dm644 '$<' '$@' -- cgit v1.2.3-54-g00ecf From bec81703da55dbcd8ed30f424317d2970a5f11c1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 20:30:51 -0400 Subject: po/es: Run msgmerge to update for fixed librexgettext I ran `msgmerge -UFi xbs.po ../xbs.pot` for each message domain, but used git gui to only stage substansive changes; not any changes to line-wrapping. --- po/es/gitget.po | 5 ++++ po/es/librelib.po | 12 ++++++++-- po/es/libretools.po | 66 +++++++++++++++++++++++++++++++++++++---------------- po/es/xbs.po | 35 +++++++++++++++++++++++++--- 4 files changed, 93 insertions(+), 25 deletions(-) diff --git a/po/es/gitget.po b/po/es/gitget.po index 97f06d8..723fc90 100644 --- a/po/es/gitget.po +++ b/po/es/gitget.po @@ -99,6 +99,11 @@ msgstr "En lugar de comprobar que las URL configuradas coinciden, forzar la " msgid "URL" msgstr "URL" +#: src/gitget/gitget:178 +msgid "In addition to setting or checking `remotes.origin.url`, also set or " + "check `remotes.origin.pushUrl`" +msgstr "" + #: src/gitget/gitget:180 msgid "NAME" msgstr "NOMBRE" diff --git a/po/es/librelib.po b/po/es/librelib.po index f71b087..7205775 100644 --- a/po/es/librelib.po +++ b/po/es/librelib.po @@ -247,11 +247,19 @@ msgstr "Dishabilita el uso de las palabras clave predeterminadas" msgid "Show this text" msgstr "Muestra este texto" -#: src/lib/librexgettext:205 +#: src/lib/librexgettext:177 src/lib/librexgettext:224 +msgid "flag error: Missing expected flag meaning at argument %d" +msgstr "" + +#: src/lib/librexgettext:196 +msgid "flag error: Jumped from argument %d to %d" +msgstr "" + +#: src/lib/librexgettext:255 msgid "unrecognized option: %s" msgstr "opción no reconocida: %s" -#: src/lib/librexgettext:211 +#: src/lib/librexgettext:261 msgid "no input file given" msgstr "no se ha dado ningún archivo" diff --git a/po/es/libretools.po b/po/es/libretools.po index 794051a..91bff8a 100644 --- a/po/es/libretools.po +++ b/po/es/libretools.po @@ -702,6 +702,10 @@ msgstr "" msgid "CHROOT" msgstr "" +#: src/chroot-tools/librechroot:253 src/chroot-tools/libremakepkg:162 +msgid "Name of the chroot to use" +msgstr "" + #: src/chroot-tools/librechroot:254 src/chroot-tools/libremakepkg:163 msgid "COPY" msgstr "" @@ -714,6 +718,10 @@ msgstr "" msgid "Disable networking in the chroot" msgstr "" +#: src/chroot-tools/librechroot:256 +msgid "Copy this file to `$copydir/etc/pacman.conf`" +msgstr "" + #: src/chroot-tools/librechroot:256 src/chroot-tools/librechroot:257 #: src/librefetch/librefetch:84 msgid "FILE" @@ -727,7 +735,12 @@ msgstr "" msgid "CARCH" msgstr "" -#: src/chroot-tools/librechroot:260 +#: src/chroot-tools/librechroot:258 +msgid "Set the architecture of the copy; simply an alias for the `-C` and `-" + "M` flags, see above." +msgstr "" + +#: src/chroot-tools/librechroot:260 src/chroot-tools/libremakepkg:164 msgid "Bind mount a file or directory, read/write" msgstr "" @@ -736,6 +749,10 @@ msgstr "" msgid "PATH[:PATH]" msgstr "" +#: src/chroot-tools/librechroot:261 src/chroot-tools/libremakepkg:165 +msgid "Bind mount a file or directory, read-only" +msgstr "" + #: src/chroot-tools/librechroot:264 msgid " Create/copy/delete:" msgstr "" @@ -761,6 +778,10 @@ msgstr "" msgid "FILES..." msgstr "" +#: src/chroot-tools/librechroot:270 +msgid "Like `pacman -U FILES...`" +msgstr "" + #: src/chroot-tools/librechroot:271 msgid "Like `pacman -S NAMES...`" msgstr "" @@ -787,6 +808,10 @@ msgstr "" msgid "CMD..." msgstr "" +#: src/chroot-tools/librechroot:278 +msgid "Run CMD in the chroot copy" +msgstr "" + #: src/chroot-tools/librechroot:279 msgid "Enter an interactive shell in the chroot copy" msgstr "" @@ -795,63 +820,63 @@ msgstr "" msgid "Clean /repo in the chroot copy" msgstr "" -#: src/chroot-tools/librechroot:303 +#: src/chroot-tools/librechroot:306 msgid "Unsupported architecture: %s" msgstr "" -#: src/chroot-tools/librechroot:321 +#: src/chroot-tools/librechroot:324 msgid "Must specify a command" msgstr "" -#: src/chroot-tools/librechroot:327 +#: src/chroot-tools/librechroot:330 msgid "Unrecognized command: %s" msgstr "" -#: src/chroot-tools/librechroot:335 +#: src/chroot-tools/librechroot:338 msgid "Command `%s` does not take any arguments: %s" msgstr "" -#: src/chroot-tools/librechroot:342 +#: src/chroot-tools/librechroot:345 msgid "Command `%s` requires at least one file" msgstr "" -#: src/chroot-tools/librechroot:354 +#: src/chroot-tools/librechroot:357 msgid "%s: file(s) not found: %s" msgstr "" -#: src/chroot-tools/librechroot:361 +#: src/chroot-tools/librechroot:364 msgid "Command `%s` requires at least one package name" msgstr "" -#: src/chroot-tools/librechroot:368 +#: src/chroot-tools/librechroot:371 msgid "Command `%s` requires at least one argument" msgstr "" -#: src/chroot-tools/librechroot:392 +#: src/chroot-tools/librechroot:394 msgid "This program must be run as root." msgstr "" -#: src/chroot-tools/librechroot:400 +#: src/chroot-tools/librechroot:402 msgid "Input is not a TTY" msgstr "" -#: src/chroot-tools/librechroot:403 +#: src/chroot-tools/librechroot:405 msgid "Due to a bug in systemd-nspawn, redirecting stdin is not supported." msgstr "" -#: src/chroot-tools/librechroot:411 src/chroot-tools/libremakepkg:266 +#: src/chroot-tools/librechroot:413 src/chroot-tools/libremakepkg:266 msgid "Waiting for existing lock on chroot copy to be released: [%s]" msgstr "" -#: src/chroot-tools/librechroot:415 +#: src/chroot-tools/librechroot:417 msgid "Chroot copy is mounted with nosuid or noexec options: [%s]" msgstr "" -#: src/chroot-tools/librechroot:420 +#: src/chroot-tools/librechroot:422 msgid "Creating 'root' copy for chroot [%s]" msgstr "" -#: src/chroot-tools/librechroot:426 +#: src/chroot-tools/librechroot:428 msgid "Syncing copy [%s] with root copy" msgstr "" @@ -923,10 +948,6 @@ msgstr "" msgid "Name of, or absolute path to, the chroot copy to use" msgstr "" -#: src/chroot-tools/libremakepkg:165 -msgid "Bind mount a file or directory, read-only" -msgstr "" - #: src/chroot-tools/libremakepkg:167 msgid "Don't disable networking during build() and package(). PLEASE don't " "use this unless you have a special reason, its use is a violation of " @@ -1317,6 +1338,11 @@ msgstr "" msgid "Force download mode (don't create)" msgstr "" +#: src/librefetch/librefetch:84 +msgid "Use an alternate build script (instead of 'PKGBUILD'). If an " + "SRCBUILD exists in the same directory, it is used instead" +msgstr "" + #: src/librefetch/librefetch:87 msgid "Alternate modes:" msgstr "" diff --git a/po/es/xbs.po b/po/es/xbs.po index 880b5df..729c470 100644 --- a/po/es/xbs.po +++ b/po/es/xbs.po @@ -109,9 +109,13 @@ msgstr "Opciones:" msgid "BUILDSYSTEM" msgstr "BUILDSYSTEM" -#: src/xbs/xbs:51 -msgid "-h" -msgstr "-h" +#: src/xbs/xbs:49 +msgid "Use BUILDSYSTEM instead of the one configured in xbs.conf" +msgstr "" + +#: src/xbs/xbs:51 src/xbs/xbs:76 +msgid "Show this message" +msgstr "" #: src/xbs/xbs:53 msgid "Whether a command is intended for use on a developer's box or on the " @@ -135,6 +139,10 @@ msgstr "¿Hay cambios sin commit en `.`?" msgid "(dev) download" msgstr "(dev) descarga" +#: src/xbs/xbs:61 +msgid "Download or update the tree" +msgstr "" + #: src/xbs/xbs:62 msgid "(dev) release-client REPO ARCH" msgstr "(dev) release-client REPO ARCQUITECTURA" @@ -147,22 +155,43 @@ msgstr "Publica `.` (para las cajas de los desarrolladores)" msgid "(srv) release-server REPO ARCH" msgstr "(srv) release-client REPO ARCQUITECTURA" +#: src/xbs/xbs:65 +msgid "Release `.` (for server boxes)" +msgstr "" + #: src/xbs/xbs:66 msgid "(srv) unrelease PKGBASE REPO ARCH" msgstr "(srv) unrelease PKGBASE REPO ARCQUITECTURA" +#: src/xbs/xbs:67 +msgid "Unrelease a pkgbase" +msgstr "" + #: src/xbs/xbs:68 msgid "(srv) move FROMREPO TOREPO PKGBASE" msgstr "(srv) mover DESDEREPO AREPO PKGBASE" +#: src/xbs/xbs:69 +msgid "Move a pkgbase from one repo to another" +msgstr "" + #: src/xbs/xbs:70 msgid "(srv) releasepath PKGBASE REPO ARCH" msgstr "(srv) rutadepublicación PKGBASE REPO ARQUITECTURA" +#: src/xbs/xbs:71 +msgid "Print the path to the staged version of pkgbase, or exit with non-" + "zero if not released" +msgstr "" + #: src/xbs/xbs:73 msgid "(any) name" msgstr "(any) nombre" +#: src/xbs/xbs:74 +msgid "Print a human-friendly version of the BUILDSYSTEM name" +msgstr "" + #: src/xbs/xbs:75 msgid "(any) help" msgstr "(any) ayuda" -- cgit v1.2.3-54-g00ecf From 0b8606e0cd0e1aedfe222d4d6603c4986aacb7b5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Jul 2017 20:58:03 -0400 Subject: librerelease: Fix rmdir failing This changed because I added `set -e`. There's no test for this (yet) because it would take too long for me to mock the server-size. I'll do it eventually. Also, this fixes HOOKPOSTRELEASE running in $WORKDIR/staging, which is the wrong place for it to run. --- src/abslibre-tools/librerelease | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 2da919f..de3cc24 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -106,7 +106,7 @@ sign_packages() { } # Clean everything if not in dry-run mode -clean_files() { +clean_files() ( local file_list=$1 local rmcmd=(rm -fv) @@ -115,10 +115,11 @@ clean_files() { fi msg "Removing files from local staging directory" - cd "${WORKDIR}/staging" && xargs -0r -a "$file_list" "${rmcmd[@]}" - cd "${WORKDIR}/staging" && find . -mindepth 1 -type d -empty \ - -exec rmdir -p {} + 2>/dev/null -} + cd "${WORKDIR}/staging" + xargs -0r -a "$file_list" "${rmcmd[@]}" + find . -depth -mindepth 1 -type d \ + -exec rmdir --ignore-fail-on-non-empty -- '{}' + +) ################################################################################ -- cgit v1.2.3-54-g00ecf