dh_translations’ support for cmake is not flexible enough

Bug #1181187 reported by Olivier Tilloy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pkgbinarymangler (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

Looking at /usr/bin/dh_translations, in function check_buildsystem(), the block that deals with cmake expects the following string to be found in CMakeLists.txt to extract the translation domain:

    set (GETTEXT_PACKAGE "domain")

(replace 'domain' with the actual translation domain)

Specifically, it expects a whitespace between "set" and the following opening parenthesis, so if I omit it the domain is not extracted. It would be nice to make this whitespace optional (to allow for more consistency in CMakeLists.txt where no whitespace is used between function name and following opening parenthesis).

It also expects the domain to be surrounded by double-quotes, but this is not strictly necessary in the cmake syntax, strings may be defined without enclosing them in double quotes. So it would also be nice to make those double-quotes optional.

I.e., allow for something like this:

    set(GETTEXT_PACKAGE domain)

And a slightly related wishlist item: when using cmake, it’s not uncommon to delegate specific logic to a CMakeLists.txt in a subfolder. Typically, I would be tempted to set GETTEXT_PACKAGE in po/CMakeLists.txt, not in the top-level CMakeLists.txt.
It would be nice if dh_translations looked for that string in both places.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: dh-translations 117
ProcVersionSignature: Ubuntu 3.8.0-21.32-generic 3.8.8
Uname: Linux 3.8.0-21-generic x86_64
NonfreeKernelModules: nvidia wl
ApportVersion: 2.9.2-0ubuntu8
Architecture: amd64
CheckboxSubmission: 2c7995ffdf051a6d0adf7ab2c7be5ba9
CheckboxSystem: 7e42599bda39ea7ff8b528272b6ef52b
Date: Fri May 17 12:51:36 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-03-26 (51 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Alpha amd64+mac (20130326)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: pkgbinarymangler
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Olivier Tilloy (osomon) wrote :
Martin Pitt (pitti)
Changed in pkgbinarymangler (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

I replicated both problems in test cases, and fixed this in bzr. Thanks!

Changed in pkgbinarymangler (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pkgbinarymangler - 118

---------------
pkgbinarymangler (118) saucy; urgency=low

  * dh_translations: If ./CMakeLists.txt does not have the domain, check in
    po/CMakeLists.txt, too. (first half of LP: #1181187)
  * dh_translations: Accept more variations (whitespace, quotes or not) of
    setting GETTEXT_PACKAGE in cmake files. (second half of LP: #1181187)
  * Bump Standards-Version to 3.9.4, no changes necessary.
 -- Martin Pitt <email address hidden> Fri, 17 May 2013 15:00:23 +0200

Changed in pkgbinarymangler (Ubuntu):
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.