diff options
author | David P <megver83@parabola.nu> | 2017-07-29 21:59:30 -0400 |
---|---|---|
committer | David P <megver83@parabola.nu> | 2017-07-29 21:59:30 -0400 |
commit | 5e9742f03e4199c006b0f9d0d8069a2fb41d9258 (patch) | |
tree | c5e7c30625b30b50a2a2385ef934c1d7e57eb2fa | |
parent | 63f4ac3c0a6ea7e060720b63964cf158157fc785 (diff) | |
parent | 0b8606e0cd0e1aedfe222d4d6603c4986aacb7b5 (diff) |
34 files changed, 559 insertions, 77 deletions
@@ -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 = \ -po/%(pkg).pot: $(addsuffix /everything.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,9 +48,8 @@ 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))) +nested.subdirs = $(foreach pkg,$(pkgs),$(pkg.$(pkg))) po include $(topsrcdir)/build-aux/Makefile.tail.mk 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 <http://www.gnu.org/licenses/>. 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..8902a26 100644 --- a/build-aux/Makefile.each.tail/20-libretools.mk +++ b/build-aux/Makefile.each.tail/20-libretools.mk @@ -22,11 +22,11 @@ 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)) \ - $(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))) \ @@ -52,16 +52,14 @@ $(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 ###################################################### $(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..832649d 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` @@ -62,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)...:` @@ -26,7 +26,6 @@ datadir = $(datarootdir) #sysconfdir = $(prefix)/etc sysconfdir = /etc -docdir = $(datarootdir)/doc mandir = $(datarootdir)/man devtoolsdir = $(call abspath,$(topsrcdir)/../devtools-par) diff --git a/po/.gitignore b/po/.gitignore index e3a8c5d..406ef00 100644 --- a/po/.gitignore +++ b/po/.gitignore @@ -1 +1,2 @@ -*.pot +*.mo +/header.po.head @@ -2,19 +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): + running `make`. You'll need a checkout of both "devtools-par" and + "libretools" to run `make` if building from git. $ 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 @@ -29,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: <http://www.lingoes.net/en/translator/langcode.htm> diff --git a/po/Makefile b/po/Makefile new file mode 100644 index 0000000..96d8490 --- /dev/null +++ b/po/Makefile @@ -0,0 +1,21 @@ +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) + +# 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/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/es/gitget.po b/po/es/gitget.po index f248569..723fc90 100644 --- a/po/es/gitget.po +++ b/po/es/gitget.po @@ -1,3 +1,18 @@ +# Copyright (C) 2017 David P <megver83@parabola.nu> +# 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 <dev@lists.parabola.nu>\n" + "PO-Revision-Date: 2017-07-05 19:27-0400\n" + "Last-Translator: David P <megver83@parabola.nu>\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" @@ -84,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" @@ -112,7 +132,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 '<REPO>', and checks out the git " diff --git a/po/es/librelib.po b/po/es/librelib.po index ff4c460..7205775 100644 --- a/po/es/librelib.po +++ b/po/es/librelib.po @@ -1,3 +1,18 @@ +# Copyright (C) 2017 David P <megver83@parabola.nu> +# 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 <dev@lists.parabola.nu>\n" + "PO-Revision-Date: 2017-07-05 20:02-0400\n" + "Last-Translator: David P <megver83@parabola.nu>\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" @@ -27,7 +42,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 @@ -232,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 55bedb2..67fe6de 100644 --- a/po/es/libretools.po +++ b/po/es/libretools.po @@ -1,3 +1,18 @@ +# Copyright (C) 2017 David P <megver83@parabola.nu> +# 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 <dev@lists.parabola.nu>\n" + "PO-Revision-Date: 2017-07-06 13:59-0400\n" + "Last-Translator: David P <megver83@parabola.nu>\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..." @@ -15,7 +30,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 @@ -704,6 +719,10 @@ msgstr "Crear una copia, eliminar una copia o sincronizar una copia puede ser b msgid "CHROOT" msgstr "CHROOT" +#: 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 "COPIA" @@ -716,6 +735,10 @@ msgstr "Nombre, o ruta absoluta, de la copia a utilizar" msgid "Disable networking in the chroot" msgstr "Deshabilitar la conexión de redes en el chroot" +#: 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" @@ -729,7 +752,12 @@ msgstr "Copia este archivo a `$copydir/etc/makepkg.conf`" msgid "CARCH" msgstr "CARCH" -#: 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 "Enlazar un archivo o directorio, lectura/escritura" @@ -738,6 +766,10 @@ msgstr "Enlazar un archivo o directorio, lectura/escritura" msgid "PATH[:PATH]" msgstr "RUTA[:RUTA]" +#: 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 " Crear/copiar/eliminar" @@ -764,6 +796,10 @@ msgstr " Lidiando con paquetes:" msgid "FILES..." msgstr "ARCHIVOS..." +#: src/chroot-tools/librechroot:270 +msgid "Like `pacman -U FILES...`" +msgstr "" + #: src/chroot-tools/librechroot:271 msgid "Like `pacman -S NAMES...`" msgstr "Como `pacman -S NOMBRES...`" @@ -792,6 +828,10 @@ msgstr " Otro:" msgid "CMD..." msgstr "CMD..." +#: 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 "Entrar a un shell interactivo en la copia de chroot" @@ -800,63 +840,63 @@ msgstr "Entrar a un shell interactivo en la copia de chroot" msgid "Clean /repo in the chroot copy" msgstr "Limpiar /repo en la copia del chroot" -#: src/chroot-tools/librechroot:303 +#: src/chroot-tools/librechroot:306 msgid "Unsupported architecture: %s" msgstr "Arquitectura no admitida: %s" -#: src/chroot-tools/librechroot:321 +#: src/chroot-tools/librechroot:324 msgid "Must specify a command" msgstr "Debe especificar un comando" -#: src/chroot-tools/librechroot:327 +#: src/chroot-tools/librechroot:330 msgid "Unrecognized command: %s" msgstr "Comando no reconocido: %s" -#: src/chroot-tools/librechroot:335 +#: src/chroot-tools/librechroot:338 msgid "Command `%s` does not take any arguments: %s" msgstr "El comando `%s` no toma ningún argumento: %s" -#: src/chroot-tools/librechroot:342 +#: src/chroot-tools/librechroot:345 msgid "Command `%s` requires at least one file" msgstr "El comando `%s` requiere al menos un archivo" -#: src/chroot-tools/librechroot:354 +#: src/chroot-tools/librechroot:357 msgid "%s: file(s) not found: %s" msgstr "%s: archivo(s) no encontrado(s): %s" -#: src/chroot-tools/librechroot:361 +#: src/chroot-tools/librechroot:364 msgid "Command `%s` requires at least one package name" msgstr "El comando `%s` requiere al menos un nombre de un paquete" -#: src/chroot-tools/librechroot:368 +#: src/chroot-tools/librechroot:371 msgid "Command `%s` requires at least one argument" msgstr "El comando `%s` requiere al menos un argumento" -#: src/chroot-tools/librechroot:392 +#: src/chroot-tools/librechroot:394 msgid "This program must be run as root." msgstr "Este programa debe ser ejecutado como root." -#: src/chroot-tools/librechroot:400 +#: src/chroot-tools/librechroot:402 msgid "Input is not a TTY" msgstr "La entrada no es un TTY" -#: src/chroot-tools/librechroot:403 +#: src/chroot-tools/librechroot:405 msgid "Due to a bug in systemd-nspawn, redirecting stdin is not supported." msgstr "Debido a un error en systemd-nspawn, el redireccionamiento de stdin no está soportado." -#: 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 "Esperando que el bloqueo existente en la copia de chroot sea liberado: [%s]" -#: src/chroot-tools/librechroot:415 +#: src/chroot-tools/librechroot:417 msgid "Chroot copy is mounted with nosuid or noexec options: [%s]" msgstr "La copia del chroot se monta con opciones nosuid o noexec: [%s]" -#: src/chroot-tools/librechroot:420 +#: src/chroot-tools/librechroot:422 msgid "Creating 'root' copy for chroot [%s]" msgstr "Creando copia 'root' para el chroot [%s]" -#: src/chroot-tools/librechroot:426 +#: src/chroot-tools/librechroot:428 msgid "Syncing copy [%s] with root copy" msgstr "Sincronizando copia [%s] con la copia root" @@ -929,10 +969,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 " @@ -1323,6 +1359,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 35bd7f1..729c470 100644 --- a/po/es/xbs.po +++ b/po/es/xbs.po @@ -1,3 +1,18 @@ +# Copyright (C) 2017 David P <megver83@parabola.nu> +# 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 <dev@lists.parabola.nu>\n" + "PO-Revision-Date: 2017-07-05 20:22-0400\n" + "Last-Translator: David P <megver83@parabola.nu>\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'" @@ -94,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 " @@ -120,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" @@ -132,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" 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 <dev@lists.parabola.nu>\n" + "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" + "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" + "Language-Team: LANGUAGE <MAILING_LIST@ADDRESS>\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" diff --git a/po/subdir.mk b/po/subdir.mk new file mode 100644 index 0000000..b9a2575 --- /dev/null +++ b/po/subdir.mk @@ -0,0 +1,18 @@ +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,$(srcdir)/../%.pot) + msgcmp --use-untranslated $< $(word 2,$^) + msgfmt -c -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 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 -- '{}' + +) ################################################################################ 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 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 } 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 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 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 --- /dev/null +++ b/test/librexgettext.d/it_handles_zero_flags.pot 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 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 |