Subject: Bug#994716: lintian: erroneous unpack-message-for-orig

From: Aurelien Jarno <[email-masked]>
Date: Sun, 19 Sep 2021 21:31:42 +0200

Package: lintian
Version: 2.106.1
Severity: normal

Since recently, I get the following lintian error message on the glibc
package:

E: glibc source: unpack-message-for-orig glibc_2.32.orig.tar.xz ar failed for glibc-2.32/htl/libpthread.a
E: glibc source: unpack-message-for-orig glibc_2.32.orig.tar.xz ar failed for glibc-2.32/htl/libpthread_pic.a
E: glibc source: unpack-message-for-orig glibc_2.32.orig.tar.xz ar failed for glibc-2.32/htl/libpthread_syms.a

Those file are not archive, but a linker script. For example
libpthread.a contains:

| GROUP(-lpthread_syms)
| GROUP(-lpthread2 -lrt)

Lintian should handle this case.

-- System Information:
Debian Release: 11.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

---

From: Bill Allombert <[email-masked]>
Date: Fri, 1 Apr 2022 19:03:25 +0200

> Lintian should handle this case.

Hello Lintian maintainers,

There are several bugs here
1) not all files ending by '.a' are 'ar' archive files, and this is not
an error.

2) 'unpack-message-for-orig' is used to report error when
unpacking the orig.tar.gz tarball. This is unrelated to what happen here
(an error of "ar" while inspecting binary package), so this tag is
inappropriate.

The combination is a large set of false positive with inappropriate
error messages, just check

https://lintian.debian.org/tags/unpack-message-for-orig?version=2.114.161

Thanks for maintaining Lintian!
-- 
Bill. <[email-masked]>

Imagine a large red swirl here.

---

From: Bill Allombert <[email-masked]>
Date: Sun, 17 Jul 2022 14:45:17 +0200

Package: lintian
Followup-For: Bug #994716

More generally, lintian should not assume that .a files are archive, that .o are
object files, etc. This leads to too much false positive.

Cheers,

---

From: Santiago Vila <[email-masked]>
Date: Wed, 28 Dec 2022 13:37:21 +0100

Hello. I was going to report this but I see it's already reported.

Here is another false positive:

lintian believes that the file testdir/t.a in original-awk
source is an ar archive and produces this output:

E: original-awk source: unpack-message-for-orig original-awk_2022-01-22.orig.tar.gz . ar failed for awk-20220122/testdir/t.a

The contents of the file, however, is the following:

	{if (amount[$2] "" == "") item[++num] = $2;
	 amount[$2] += $1
	}
END	{for (i=1; i<=num; i++)
		print item[i], amount[item[i]]
	}

and the "file" command correctly identifies it not as an ar archive:

$ file testdir/*.a
testdir/t.a: ASCII text

Therefore I propose that lintian only tries to unpack *.a files when
the "file" command identifies it as an "ar" archive:

$ file /lib/x86_64-linux-gnu/libc.a
/lib/x86_64-linux-gnu/libc.a: current ar archive

Thanks.