From 41568ef56b6a7f81b7a3204fdb672bc8b9e0921a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 14 Oct 2018 00:02:27 +0100 Subject: changelog: start 8.1~ Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index bb11119..86181b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (8.1~) unstable; urgency=medium + + * + + -- + dgit (8.0) unstable; urgency=medium dgit - Behavioural change with compatibility implications: -- cgit v1.2.3 From 94649ffeabdeb68d3dd84121bbb28bc51c6909d9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 7 Nov 2018 22:27:03 +0000 Subject: po4a: New pairwise-pocheck script This currently just detects if a translator has dropped the B or I or some such from POD constructs like B<...> and I<...>. Suggested-by: Colin Watson Signed-off-by: Ian Jackson --- po4a/pairwise-pocheck | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100755 po4a/pairwise-pocheck diff --git a/po4a/pairwise-pocheck b/po4a/pairwise-pocheck new file mode 100755 index 0000000..6a71f64 --- /dev/null +++ b/po4a/pairwise-pocheck @@ -0,0 +1,107 @@ +#!/usr/bin/tclsh +# +# We check each tranlated message against its original, +# making certain consistency checks. + +# In theory this would be easy: we could read the .po file +# directly. But the format of the .po file is not documented. +# Looking at the source code for the po parser in GNU gettext, +# the syntax is complicated with a wide variety of escapes. +# +# So I would prefer to reuse the gettext parser. That means getting +# the output from gettext in some other format. Most of the gettext +# utilities output in annoying formats. The least annoying seems +# to be to use msgfmt to generate a tcl file (!) + +# usage: +# cd po4a +# ./pairwise-potcheck [LANG] + +proc badusage {} { + puts stderr "usage: ./pairwise-pocheck [LANG]" + exit 1 +} + +set lang * + +set bad 0 + +proc bad {emsg} { + global po for_emsg bad + puts stderr "$po: $emsg $for_emsg" + incr bad +} + +proc check_equal {desc script} { + upvar 1 m m + foreach is {id str} { + set m [uplevel 1 [list set msg$is]] + set m$is $m + set r$is [uplevel 1 $script] + } + if {![string compare $rid $rstr]} { return 0 } + bad "mismatch $rid != $rstr $desc" +} + +# called directly by msgfmt output +namespace eval ::msgcat { + proc mcset {lang msgid msgstr} { + check_msg $msgid $msgstr + } +} + +proc check_msg {msgid msgstr} { + global for_emsg + set for_emsg "msgid=[list $msgid] msgstr=[list $msgstr]" + check_equal "un-escaped non-pod < count (missing B or I?)" { + regexp -all {(?!\b[IBCLEFSXZ])\<} $m + } +} + +proc check {} { + # msgfmt --tcl wants to use a pretty much fixed filename: + # you get to specify part of it but it has to look like a + # locale. But we can specify ya directory to use, so + # one directory per po it is! + global po + set vexdir ".$po.pwpc.tmp" + set vexleaf xx.msg + set vexfile $vexdir/$vexleaf + file mkdir $vexdir + file delete $vexfile + exec msgfmt -d$vexdir -lxx --tcl $po + + # and then we execute it! + source $vexfile +} + +proc parseargs {} { + global argv lang + switch -glob [llength $argv].$argv { + 0. { } + 1.-* { badusage } + 1.* { set lang [lindex $argv 0] } + * { badusage } + } +} + +proc iterate {} { + global po lang + + foreach po [lsort [glob -nocomplain *.$lang.po]] { + check + puts "pairwise-pocheck $po ok." + } +} + +proc report {} { + global bad + if {$bad} { + puts stderr "pairwise-pocheck: $bad errors" + exit 1 + } +} + +parseargs +iterate +report -- cgit v1.2.3 From 67b3cfa92470948c95a0fb9a949eeaa48a47d42a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 7 Nov 2018 22:28:09 +0000 Subject: po4a: Fix gitignore to actually ignore right .po4a.LANG.cfg Signed-off-by: Ian Jackson --- po4a/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po4a/.gitignore b/po4a/.gitignore index e640b7e..b80fca6 100644 --- a/po4a/.gitignore +++ b/po4a/.gitignore @@ -1,5 +1,5 @@ translated preview.* -.*.po4a.cfg +.po4a.*.cfg .*.translated *.tmp -- cgit v1.2.3 From df90a0804dbbbc8be02fcf86cdda6a47e9a16c64 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 7 Nov 2018 22:33:06 +0000 Subject: po4a: pairwise-pocheck: Provide make targets to invoke it explicitly Signed-off-by: Ian Jackson --- po4a/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/po4a/Makefile b/po4a/Makefile index c759ce8..3354812 100644 --- a/po4a/Makefile +++ b/po4a/Makefile @@ -75,6 +75,11 @@ # tree. # # make targets: install +# +# Check: +# +# make targets: check +# pairwise-pocheck.check default: pofiles @@ -84,6 +89,8 @@ PO4A ?= po4a all update: translated +check: po4a.cfg.check pairwise-pocheck.check + pofiles: po4a.cfg $(PO4A) --no-translations $< @@ -97,6 +104,9 @@ po4a.cfg.check: list-documents ./$< >$@.tmp diff po4a.cfg $@.tmp +pairwise-pocheck.check: + ./pairwise-pocheck + t = ../.po4a.translated-only p = ../po4a @@ -114,6 +124,9 @@ translated-only: po4a.cfg .PRECIOUS: .po4a.%.cfg +pairwise-pocheck.%.check: + ./pairwise-pocheck $* + preview.%: .po4a.%.cfg $S $(PO4A) $< $S ./install-documents >/dev/null .$*.translated $@ -- cgit v1.2.3 From 0c244082ddb4b2443ccfbc1c438ead4fda1c33ca Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 7 Nov 2018 22:33:22 +0000 Subject: po4a: pairwise-pocheck: Force it to be run sometimes * when building a binary package * when preparing a translation preview Signed-off-by: Ian Jackson --- debian/control | 2 +- po4a/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 62a4a11..eef4dca 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: devel Priority: optional Maintainer: Ian Jackson Standards-Version: 3.9.4.0 -Build-Depends: debhelper (>= 9), gettext, po4a +Build-Depends: debhelper (>= 9), gettext, po4a, tcl Testsuite: autopkgtest Vcs-Git: git://git.chiark.greenend.org.uk/~ianmdlvl/dgit.git Vcs-Browser: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git/dgit.git/ diff --git a/po4a/Makefile b/po4a/Makefile index 3354812..d3663e5 100644 --- a/po4a/Makefile +++ b/po4a/Makefile @@ -110,7 +110,7 @@ pairwise-pocheck.check: t = ../.po4a.translated-only p = ../po4a -translated-only: po4a.cfg +translated-only: po4a.cfg pairwise-pocheck.check rm -rf $t && mkdir $t cd $t && ln -s $p/*.po $p/*.pot $p/po4a.cfg . cd $t && $(PO4A) po4a.cfg @@ -127,7 +127,7 @@ translated-only: po4a.cfg pairwise-pocheck.%.check: ./pairwise-pocheck $* -preview.%: .po4a.%.cfg +preview.%: .po4a.%.cfg pairwise-pocheck.%.check $S $(PO4A) $< $S ./install-documents >/dev/null .$*.translated $@ @ echo '# runes to preview the various final tranlated manpages:' -- cgit v1.2.3 From e19e412afc4968168748aa5f8abc025a8ad7187a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 7 Nov 2018 22:34:12 +0000 Subject: po4a: Add -LUTF-8 to the config Apparently this is not the default. Suggested-by: Colin Watson Signed-off-by: Ian Jackson --- po4a/list-documents | 2 +- po4a/po4a.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/po4a/list-documents b/po4a/list-documents index 4d625e0..9924379 100755 --- a/po4a/list-documents +++ b/po4a/list-documents @@ -13,7 +13,7 @@ cat < Date: Wed, 7 Nov 2018 22:55:32 +0000 Subject: test suite: Run everything with LC_CTYPE=C.UTF-8 Things are not likely to work otherwise. (If someone wants to try to run dgit in another ctype then I think things will mostly work...) Signed-off-by: Ian Jackson --- tests/lib | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/lib b/tests/lib index a050522..fa553af 100644 --- a/tests/lib +++ b/tests/lib @@ -36,6 +36,8 @@ export DGIT_TEST_DEBUG export GIT_COMMITTER_DATE='1530000000 +0100' export GIT_AUTHOR_DATE='1530000000 +0100' +export LC_CTYPE=C.UTF-8 + root=`pwd` troot=$root/tests testname="${DGIT_TEST_TESTNAME-${0##*/}}" -- cgit v1.2.3 From 3bdf8f285a8c50a827a6c32e63f23043a69f2cbb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 7 Nov 2018 22:56:44 +0000 Subject: test suite: manpages-format: pass --warnings Suggested-by: Colin Watson Signed-off-by: Ian Jackson --- tests/tests/manpages-format | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tests/manpages-format b/tests/tests/manpages-format index 7ba2f9d..e58da51 100755 --- a/tests/tests/manpages-format +++ b/tests/tests/manpages-format @@ -14,10 +14,10 @@ export MANWIDTH=80 run_man () { if [ "x${DGIT_MANPAGES_SOURCE_DIR}" = x ]; then - cmd='man "$@" $section $page' + cmd='man --warnings "$@" $section $page' else make $roff >&2 - cmd='man "$@" -l $roff' + cmd='man --warnings "$@" -l $roff' fi eval "$cmd 2>&1 >/dev/null |tee $errs" } -- cgit v1.2.3 From 0fc3359d6fa6d667e974955e2e93179831c87ade Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 7 Nov 2018 23:07:30 +0000 Subject: NOTES.podchecker: Document why I'm not using podchecker Signed-off-by: Ian Jackson --- NOTES.podchecker | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 NOTES.podchecker diff --git a/NOTES.podchecker b/NOTES.podchecker new file mode 100644 index 0000000..57fc320 --- /dev/null +++ b/NOTES.podchecker @@ -0,0 +1,27 @@ +todo: maybe we wanted to run podchecker but it complains about a lot +of things for which we don't have good alternatives. Eg: + + +*** WARNING: (section) in 'dgit-maint-debrebase(7)' deprecated at line 17 in file ../git-debrebase.1.pod + + But this is not actually described as deprecated and how else to + write a manpage cross-reference ? Maybe this warning applies + only to perl's own manpages. + +*** WARNING: 2 unescaped <> in paragraph at line 30 in file ../git-debrebase.1.pod + + I have a habit of writing things like + git-debrebase [-- ] + which is obviously unescaped < but the E<> syntax would be awful + +*** WARNING: No items in =over (at line 31) / =back list at line 42 in file ../dgit-user.7.pod +*** WARNING: No argument for =item at line 553 in file ../git-debrebase.1.pod + + pod doesn't offer a better answer, and these render well + +*** ERROR: unresolved internal link 'dgit-maint-*(7)' at line 22 in file ../dgit-user.7.pod + + This is obviously needed. + +At the time of writing it does not seem to detect anything which +generates bad rendering. So for now I will not run it. -- cgit v1.2.3 From 9e8a8c1d5abdbdbbe8f7edffd9b3de6ba5edbb4d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 8 Nov 2018 00:19:39 +0000 Subject: po4a: pairwise-pocheck: Better handling for missing tcl Mention in the README, and add a specific error check. Signed-off-by: Ian Jackson --- po/README | 1 + po4a/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/po/README b/po/README index 365f2ff..dcf0e86 100644 --- a/po/README +++ b/po/README @@ -125,6 +125,7 @@ In po4a/ translated and compiled manpages which can be previewed with `man -l', and prints a list of appropriate `man -l' commands. + (Requires `tcl' to be installed.) Committing and contributing your translation diff --git a/po4a/Makefile b/po4a/Makefile index d3663e5..e88aded 100644 --- a/po4a/Makefile +++ b/po4a/Makefile @@ -125,6 +125,7 @@ translated-only: po4a.cfg pairwise-pocheck.check .PRECIOUS: .po4a.%.cfg pairwise-pocheck.%.check: + @tclsh /dev/null || printf ':;:; Please run apt-get install tcl\n' ./pairwise-pocheck $* preview.%: .po4a.%.cfg pairwise-pocheck.%.check -- cgit v1.2.3 From 2b1e66e1a083c6304c83d7582248e0972122ec4d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 8 Nov 2018 00:35:03 +0000 Subject: git-debrebase: usage message: Mention only convert-from-* There is convert-from-dgit-view which was not mentioned, and we're going to make another one in a moment. We don't want to list the whole lot here. Signed-off-by: Ian Jackson --- git-debrebase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-debrebase b/git-debrebase index 5e8a8bb..fee793c 100755 --- a/git-debrebase +++ b/git-debrebase @@ -47,7 +47,7 @@ usages: git-debrebase [] prepush [--prose=...] git-debrebase [] quick|conclude git-debrebase [] new-upstream [
] - git-debrebase [] convert-from-gbp [] + git-debrebase [] convert-from-* ... ... See git-debrebase(1), git-debrebase(5), dgit-maint-debrebase(7) (in dgit). END -- cgit v1.2.3 From 8521ee9155c24772c1cc0c3c8b6fa00d7d742e2d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 8 Nov 2018 00:38:22 +0000 Subject: git-debrebase: Document scope of convert-from-gbp In fact this works with any kind of patches-unapplied (or patchless) package. Signed-off-by: Ian Jackson --- git-debrebase.1.pod | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/git-debrebase.1.pod b/git-debrebase.1.pod index 04a57ee..a964180 100644 --- a/git-debrebase.1.pod +++ b/git-debrebase.1.pod @@ -256,16 +256,33 @@ using dgit quilt-fixup instead should succeed. =item git-debrebase convert-from-gbp [] -Cnnverts a gbp patches-unapplied branch -(not a gbp pq patch queue branch) -into a git-debrebase interchange branch. +Cnnverts any of the following into a git-debrebase interchange branch: -This is done by generating a new anchor merge, -converting the quilt patches as a delta queue, +=over + +=item + +a gbp patches-unapplied branch (but not a gbp pq patch-queue branch) + +=item + +a patches-unapplied git packaging branch containing debian/patches, +as used with quilt + +=item + +a git branch for a package which has no Debian delta - +ie where upstream files are have not been modified in Debian, +so there are no patches + +=back + +The conversion is done by generating a new anchor merge, +converting any quilt patches as a delta queue, and dropping the patches from the tree. The upstream commit-ish should correspond to -the gbp upstream branch, if there is one. +the upstream branch or tag, if there is one. It is a snag if it is not an ancestor of HEAD, or if the history between the upstream and HEAD contains commits which make changes to upstream files. @@ -284,14 +301,14 @@ and if it finds it will make a pseduomerge so that your new git-debrebase view is appropriately fast forward. The result is a well-formed git-debrebase interchange branch. -The result is also fast-forward from the gbp branch. +The result is also fast-forward from the original branch. It is a snag if the new branch looks like it will have diverged, just as for a laundering/unstitching call to git-debrebase; See L, below. Note that it is dangerous not to know whether you are -dealing with a gbp patches-unapplied branch containing quilt patches, +dealing with a (gbp) patches-unapplied branch containing quilt patches, or a git-debrebase interchange branch. At worst, using the wrong tool for the branch format might result in -- cgit v1.2.3 From e1026645bc6576b9b0f4c20e59b5f785c125aff2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 8 Nov 2018 00:39:37 +0000 Subject: git-debrebase: Provide convert-from-unapplied aa alias for -gbp Closes: #905433. Signed-off-by: Ian Jackson --- git-debrebase | 1 + git-debrebase.1.pod | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/git-debrebase b/git-debrebase index fee793c..829ab82 100755 --- a/git-debrebase +++ b/git-debrebase @@ -2537,6 +2537,7 @@ sub complete_convert_from ($$$$) { update_head_checkout $old_head, $new_head, $mrest; } +sub cmd_convert_from_unapplied () { cmd_convert_from_gbp(); } sub cmd_convert_from_gbp () { badusage __ "want only 1 optional argument, the upstream git commitish" unless @ARGV<=1; diff --git a/git-debrebase.1.pod b/git-debrebase.1.pod index a964180..00b664b 100644 --- a/git-debrebase.1.pod +++ b/git-debrebase.1.pod @@ -254,6 +254,8 @@ If the problem is simply that the existing patches were not made by git-debrebase, using dgit quilt-fixup instead should succeed. +=item git-debrebase convert-from-unapplied [] + =item git-debrebase convert-from-gbp [] Cnnverts any of the following into a git-debrebase interchange branch: @@ -277,6 +279,8 @@ so there are no patches =back +(These two commands operate identically and are simply aliases.) + The conversion is done by generating a new anchor merge, converting any quilt patches as a delta queue, and dropping the patches from the tree. -- cgit v1.2.3 From 737e066cf48706a00da9d65d0ee026fef0771a8b Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 27 Oct 2018 13:40:26 -0700 Subject: dgit-maint-debrebase(7): account for case discussed in #903377 Signed-off-by: Sean Whitton --- dgit-maint-debrebase.7.pod | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dgit-maint-debrebase.7.pod b/dgit-maint-debrebase.7.pod index e5abe17..e3d557a 100644 --- a/dgit-maint-debrebase.7.pod +++ b/dgit-maint-debrebase.7.pod @@ -269,6 +269,11 @@ patches applied. Use =back +If you were not previously using dgit to upload your package (i.e. you +were not using the workflow described in dgit-maint-gbp(7)), and you +happen to have run B in this clone of the repository, +you will need to pass I<--fdiverged> to this command. + =item (C) There is a delta queue, and patches are applied. Use @@ -442,6 +447,12 @@ cowbuilder>. Upload with B or B. Remember to pass I<--new> if the package is new in the target suite. +In some cases where you used B since +the last upload, it is not possible for dgit to make your history +fast-forwarding from the history on B. In such cases you +will require I<--overwrite>. Try pushing without this option first, +and then dgit will suggest using it if it is needed. + Right before uploading, if you did not just already do so, you might want to have git-debrebase(1) shuffle your branch such that the Debian delta queue appears right at the tip of the branch you will push: -- cgit v1.2.3 From b7f48e640bca6c2542c206c9bb7cdab182ba0a2c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 8 Nov 2018 00:47:09 +0000 Subject: dgit-maint-debrebase(7): Minor corrections to #903377 wording Do not suggest trying without --overwrite first, since if you were going to pass it anyway you may as well do so right away. And mention that git-debrebase will normally prompt you to say dgit --overwrite. Closes: #903377 Signed-off-by: Ian Jackson --- dgit-maint-debrebase.7.pod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dgit-maint-debrebase.7.pod b/dgit-maint-debrebase.7.pod index e3d557a..f167928 100644 --- a/dgit-maint-debrebase.7.pod +++ b/dgit-maint-debrebase.7.pod @@ -450,8 +450,8 @@ I<--new> if the package is new in the target suite. In some cases where you used B since the last upload, it is not possible for dgit to make your history fast-forwarding from the history on B. In such cases you -will require I<--overwrite>. Try pushing without this option first, -and then dgit will suggest using it if it is needed. +will have to pass I<--overwrite> to dgit. git-debrebase will normally +tell you if this is will be needed. Right before uploading, if you did not just already do so, you might want to have git-debrebase(1) shuffle your branch such that the Debian -- cgit v1.2.3 From bfb113c41cdc9bc875cec6f1c24f930e664e853e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 8 Nov 2018 02:08:56 +0000 Subject: changelog: fianlise 8.1 Signed-off-by: Ian Jackson --- debian/changelog | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 86181b7..838025b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,23 @@ -dgit (8.1~) unstable; urgency=medium +dgit (8.1) unstable; urgency=medium - * + git-debrebase; + * convert-from-unapplied: Provide aa an alias for convert-from-gbp + and document its scope properly, etc. Closes:#905433. + * dgit-maint-debrebase(7): discuss -fdiverged with convert-from-*, + and (prompted) dgit --overwrite. Closes:#903377. [Sean Whitton] - -- + i18n support: + * Check pod translations for a common class of syntax error. + (using new machinery for pairwise checking of pod translations.) + * po4a: Add -LUTF-8 to the config. + * po4a/.gitignore: actually ignore right .po4a.LANG.cfg. + + test suite: + * Run everything with LC_CTYPE=C.UTF-8. + * manpages-format: pass --warnings. + * NOTES.podchecker: Document why we're not using podchecker. + + -- Ian Jackson Thu, 08 Nov 2018 02:09:05 +0000 dgit (8.0) unstable; urgency=medium -- cgit v1.2.3