Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#976246: dpkg-source: Reference detection of native vs non-native source package type

123 views
Skip to first unread message

Anatoli Babenia

unread,
Dec 1, 2020, 11:30:04 PM12/1/20
to
Package: dpkg-dev
Version: 1.19.7
Severity: normal
File: /usr/bin/dpkg-source

Dear Maintainer,

It would help greatly if `dpkg-source` reported native or non-native
package type.

-dpkg-source: info: using source format '1.0'
+dpkg-source: info: using non-native source format '1.0'

There is no information about native vs non-native format in this wiki page
https://wiki.debian.org/Packaging/SourcePackage

Mentors FAQ explains it in a lot of detail, but still hard to understand.
https://wiki.debian.org/DebianMentorsFaq#What_is_the_difference_between_a_native_Debian_
package_and_a_non-native_package.3F

`dpkg-source` code does explain the logic either. Detection of source format
relies on checking command line flags, and it does not make sense to me.

my $v = Dpkg::Version->new($self->{fields}->{'Version'});
if ($sourcestyle =~ m/[kpursKPUR]/) {
error(g_('non-native package version does not contain a revision'))
if $v->is_native();
} else {
# FIXME: This will become fatal in the near future.
warning(g_('native package version may not have a revision'))
unless $v->is_native();
}

https://salsa.debian.org/dpkg-team/dpkg/-/blob/09c9e02046f18f02bf3c3c2533bc557abfdc828c/scripts/Dpkg/Source/Package/V1.pm#L355

It would be nice to see a reference algorithm that detects different package
types. It would help people like me to troubleshoot issues with Debian
packaging faster.

https://github.com/openSUSE/obs-build/issues/633

I was not aware of the differences between native and non-native
packages before. Wish I could spend less time discovering this.

Guillem Jover

unread,
Sep 1, 2021, 10:40:03 PM9/1/21
to
Hi!

On Wed, 2020-12-02 at 07:16:52 +0300, Anatoli Babenia wrote:
> Package: dpkg-dev
> Version: 1.19.7
> Severity: normal
> File: /usr/bin/dpkg-source

> It would help greatly if `dpkg-source` reported native or non-native
> package type.
>
> -dpkg-source: info: using source format '1.0'
> +dpkg-source: info: using non-native source format '1.0'

While I think something like this would be nice, unfortunately I'm afraid
this cannot be done right now, because there are still package at least
in Debian that have a mismatched version format compared to their source
format. See:

<https://lintian.debian.org/tags/malformed-debian-changelog-version>

For most of which I've filed bug reports, see:

<https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=dpkg-mismatch-source-vs-version-format;users=debia...@lists.debian.org>

Unfortunately there are a couple of maintainers that refuse to fix these
problems, so we cannot currently have coherent semantics. :(

> There is no information about native vs non-native format in this wiki page
> https://wiki.debian.org/Packaging/SourcePackage
>
> Mentors FAQ explains it in a lot of detail, but still hard to understand.
> https://wiki.debian.org/DebianMentorsFaq#What_is_the_difference_between_a_native_Debian_
> package_and_a_non-native_package.3F

The dpkg-source man page contains documentation about the various
formats:

<https://manpages.debian.org/dpkg-source>

> `dpkg-source` code does explain the logic either. Detection of source format
> relies on checking command line flags, and it does not make sense to me.
>
> my $v = Dpkg::Version->new($self->{fields}->{'Version'});
> if ($sourcestyle =~ m/[kpursKPUR]/) {
> error(g_('non-native package version does not contain a revision'))
> if $v->is_native();
> } else {
> # FIXME: This will become fatal in the near future.
> warning(g_('native package version may not have a revision'))
> unless $v->is_native();
> }
>
> https://salsa.debian.org/dpkg-team/dpkg/-/blob/09c9e02046f18f02bf3c3c2533bc557abfdc828c/scripts/Dpkg/Source/Package/V1.pm#L355
>
> It would be nice to see a reference algorithm that detects different package
> types. It would help people like me to troubleshoot issues with Debian
> packaging faster.

It would be nice, and I've been trying to get there, but see above.

Thanks,
Guillem

Anatoli Babenia

unread,
Sep 2, 2021, 1:30:03 AM9/2/21
to
Hello.

> > It would help greatly if `dpkg-source` reported native or non-native
> > package type.
> >
> > -dpkg-source: info: using source format '1.0'
> > +dpkg-source: info: using non-native source format '1.0'
>
> While I think something like this would be nice, unfortunately I'm afraid
> this cannot be done right now, because there are still package at least
> in Debian that have a mismatched version format compared to their source
> format.

In that case `dpkg-source` could throw a warning about ambiguity.

> > It would be nice to see a reference algorithm that detects different package
> > types. It would help people like me to troubleshoot issues with Debian
> > packaging faster.
>
> It would be nice, and I've been trying to get there, but see above.

I still don't see why `dpkg-source` should not produce helpful messages
while there are some other packages that fail validation.
0 new messages