#1004982 lazarus-src-2.2: Unable to remove the package under ru_RU.UTF-8 locale

Package:
lazarus-src-2.2
Source:
lazarus
Submitter:
Alexander Kernozhitsky
Date:
2022-05-26 18:09:03 UTC
Severity:
important
Tags:
#1004982#5
Date:
2022-02-04 20:39:30 UTC
From:
To:
Hello,

I was trying to remove lazarus-src-2.2 and got the following error message in
postrm script:

dpkg-divert: ошибка: имя файла «в» указано не с полным путём

Translating from Russian, it (approximately) means that

dpkg-divert: error: file name "в" is a relative path

The issue is in postrm script. There is a line in it which parses the output of
dpkg-divert command:

DIVERTIONS_LIST=`dpkg-divert --list "${LAZARUS_PREFIX}/${REMOVED_VERSIONS}" |
cut -d ' ' -f 3`

In Russian, the lines in dpkg-divert output look like this:

отклонение /usr/lib/lazarus/2.2.0/components/customdrawn/customdrawn.lpk в
/usr/lib/lazarus/2.2.0/components/customdrawn/customdrawn.lpk.orig из-за
lazarus-src-2.2

while in English they look like

diversion of /usr/lib/lazarus/2.2.0/components/customdrawn/customdrawn.lpk to
/usr/lib/lazarus/2.2.0/components/customdrawn/customdrawn.lpk.orig by lazarus-
src-2.2

Note that "diversion of" is translated as "отклонение", with different amount
of spaces. So, postrm script uses wrong field as a filename.

#1004982#10
Date:
2022-03-13 17:28:00 UTC
From:
To:
Hi Alexander,

Thank you reporting this issue.
The script should enforce LANG=C when running such a command. I'll try to
prepare a patch for that.

Can you please check that hte following commands work correctly?
DIVERTIONS_LIST=`LANG=C dpkg-divert --list "/usr/lib/lazarus/2.2.0/*" | cut -d ' ' -f 3`
echo ${DIVERTIONS_LIST}

If this is OK, please let me know so I can upload a fix.

#1004982#15
Date:
2022-05-26 18:06:36 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
lazarus, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1004982@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Abou Al Montacir <abou.almontacir@sfr.fr> (supplier of updated lazarus package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 13 Mar 2022 18:41:04 +0100
Source: lazarus
Architecture: source
Version: 2.2.0+dfsg1-6
Distribution: unstable
Urgency: medium
Maintainer: Pascal Packaging Team <pkg-pascal-devel@lists.alioth.debian.org>
Changed-By: Abou Al Montacir <abou.almontacir@sfr.fr>
Closes: 1004982
Changes:
 lazarus (2.2.0+dfsg1-6) unstable; urgency=medium
 .
   * Avoid surprises on localized systems when retrieving diverted files list.
     (Closes: Bug#1004982)
Checksums-Sha1:
 1bea1c6cf943874e767ae2afe3a4e1ad8f414f13 2883 lazarus_2.2.0+dfsg1-6.dsc
 1ab647e0505a9f878b3636738b2fdd7099d3a3ef 68768 lazarus_2.2.0+dfsg1-6.debian.tar.xz
 9e60d648c901a228382d5d5d8ef06ab6d72260dc 19442 lazarus_2.2.0+dfsg1-6_amd64.buildinfo
Checksums-Sha256:
 d2095f845a3c946bd1fa1b5383ee32ecfa3d8b05bcf7c5c76f3a54ec1131ffaf 2883 lazarus_2.2.0+dfsg1-6.dsc
 39c3ffceb65052f92e7611cdb038d3da78edce56109d12da27803d159c5b33ee 68768 lazarus_2.2.0+dfsg1-6.debian.tar.xz
 d5f68689685a9b784893af92f3c853cf7c2c5a5e0182032e7094dcb22c045bf3 19442 lazarus_2.2.0+dfsg1-6_amd64.buildinfo
Files:
 0c1031c2b2a928075f80f944ed266818 2883 devel optional lazarus_2.2.0+dfsg1-6.dsc
 77fa4c658416af276401fd06637a5214 68768 devel optional lazarus_2.2.0+dfsg1-6.debian.tar.xz
 5777f46e6747a3a05e1fecb5517d96b7 19442 devel optional lazarus_2.2.0+dfsg1-6_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iI0EAREKADUWIQS69sZENhB4UNQicQazJVxtVYeNjAUCYo+/zhccYWJvdS5hbG1v
bnRhY2lyQHNmci5mcgAKCRCzJVxtVYeNjFarAP9v3RwjI/qlLwwXboM/TFUAcMgA
xwRcaEv0ObLMPi4kjgD+NfW3RP/Ct2wgiMG3mndUCWTCZun0mptxq1FZiB9b0gQ=
=cyXr
-----END PGP SIGNATURE-----