Patch of intltool-update to fix a bug when intltool-update is called with a srcdir env var different from "."

Bug #514295 reported by Florent Viard
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
intltool
Fix Released
High
Данило Шеган

Bug Description

When we have builddir != srcdir, intltool-update -m exit with an error like:
following files missing from POTFILES.in and POTFILES.skip
me/user/dev/...

where the path is supposed to be /home/user/dev/...

Here is a patch against the source code of the release 0.40.6 to fix that.

I'm sorry for the diff format, but I'm unable to fetch the latest bzr version of the sources because of the deficiencies of bazaar regarding the usage of a proxy...

Related branches

Revision history for this message
Florent Viard (fviard) wrote :
Revision history for this message
Jon TURNEY (jon-turney) wrote :

Just ran across this bug which causes make check to fail when building xkeyboard-config with builddir != srcdir

Making check in po
make[1]: Entering directory `/opt/wip/jhbuild/build/xkeyboard-config/po'
rm -f missing notexist
srcdir=/opt/wip/jhbuild/git/xkeyboard-config/po /usr/bin/intltool-update -m
The following files contain translations and are currently not in use. Please
consider adding these to the POTFILES.in file, located in the po/ directory.

t/wip/jhbuild/git/xkeyboard-config/po/../rules/base.extras.xml.in
t/wip/jhbuild/git/xkeyboard-config/po/../rules/base.xml.in
t/wip/jhbuild/git/xkeyboard-config/po/../rules/evdev.extras.xml.in
t/wip/jhbuild/git/xkeyboard-config/po/../rules/evdev.xml.in

Note that the first 3 character of the srcdir pathname ('/op') get removed, even though they aren't '../', which I guess is what the code wants to do.. The above patch fixes the problem for me.

Revision history for this message
Florent Viard (fviard) wrote :

Happy that my patch helped you! But the intltool development looks dead currently. I tried to ping the maintainers by mail but no answer...

Changed in intltool:
status: New → Confirmed
Changed in intltool:
importance: Undecided → High
status: Confirmed → Triaged
Revision history for this message
Данило Шеган (danilo) wrote :

It's not that the development is dead, it's that this bug seemed to be of low priority. If it's blocking regular builds and 'make check' for poeple, then it's a higher priority bug.

Revision history for this message
Данило Шеган (danilo) wrote :

As far as the patch goes: since we are removing 3 chars, we should probably check for those 3 chars instead of checking for only two. And as far as the code structure goes, we should do a single if check and store the unpacked value in a variable.

Revision history for this message
Данило Шеган (danilo) wrote :

Ok, can you please test the attached branch (or patch) and see if that works: it's a slightly modified and generalized patch to fix all occurences of this. I've only tested it in epiphany checkout I have around here, but we'd need more input before it can land.

What I care more about is testing that it actually works well even when builddir == srcdir and if someone confirms that po/missing file generation keeps working properly. If it works properly for what's it designed to do, I'll land it.

Changed in intltool:
assignee: nobody → Данило Шеган (danilo)
status: Triaged → In Progress
Revision history for this message
Florent Viard (fviard) wrote :

I tested your alternative patch and it keeps working properly!
(For your information, I did the patch to be able to cross-compile shared-mime-info that triggered this problem).

Revision history for this message
Jon TURNEY (jon-turney) wrote :

To test the checking for translatable files not listed in POTFILES.in/POTFILES.skip I added an extra file 'blah.c' containing just 'GetString (_("something"));'

This checking is broken in r702. I think this is because the buf_allfiles array is passed by value to the new AddFileToListIfMissing() function, so that has no effect on it.

With the attached patch to fix that, translatable file checking seems to work correctly with or without srcdir being set.

Revision history for this message
Florent Viard (fviard) wrote :

Tryed Jon's patch and it works properly.

Revision history for this message
Данило Шеган (danilo) wrote :

Jon, good catch. I've applied your changes to the branch and after a bit more testing will merge the change.

Revision history for this message
Данило Шеган (danilo) wrote :

Landed in r704 of lp:intltool

Changed in intltool:
status: In Progress → Fix Committed
Changed in intltool:
milestone: none → 0.41.1
Changed in intltool:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.