Bug#1008735: base-files: /etc/os-release should contain VERSION variables for testing and unstable

2022-11-07 Thread Santiago Vila

El 6/11/22 a las 2:01, Witold Baryluk escribió:

I am somehow confused by the current solution in base-files 12.3.


Please note that what I did in 12.3 does not try to solve everything, 
only what it was feasible to do in base-files. I do not claim that the 
situation may not improve, only that such improvement, if any, should 
come from some place other than base-files.



bookworm:
[...]
sid:
[...]



How one can distinguish between testing / bookworm and sid now? Do I need
to parse files in /etc/apt/sources.list.d/ now, maybe using `apt-cache
policy base-files` ?


Yes, looking at your apt sources would be a good idea. Note that the 
unability to determine the distribution just by looking at files 
provided by base-files has been the case for a lot of time, in fact it 
is documented in the base-files FAQ:


/usr/share/doc/base-files/FAQ

However, just because the real distribution may be inferred by looking 
at your apt sources does not necessarily mean that you have to do that 
by hand. In theory, it would be possible to modify lsb_release command 
so that it looks at your apt sources for you.


But that's not something that may be done in base-files anymore.

Thanks.



Bug#1008735: base-files: /etc/os-release should contain VERSION variables for testing and unstable

2022-11-05 Thread Witold Baryluk
Package: base-files
Version: 12.3
Followup-For: Bug #1008735
X-Debbugs-Cc: witold.bary...@gmail.com

I am somehow confused by the current solution in base-files 12.3.

bookworm:

$ lsb_release -s -i -d -r -c
No LSB modules are available.
Debian
Debian GNU/Linux bookworm/sid
n/a
bookworm
$

sid:

$ lsb_release -s -i -d -r -c 
No LSB modules are available.
Debian
Debian GNU/Linux bookworm/sid
n/a
bookworm
$



How one can distinguish between testing / bookworm and sid now? Do I need
to parse files in /etc/apt/sources.list.d/ now, maybe using `apt-cache
policy base-files` ?

There are practical situations where bookworm and sid are out of sync for
months, and this is important to distinguish in many places.

Regards,
Witold

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-rc3 (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages base-files depends on:
ii  gawk [awk]  1:5.1.0-1
ii  mawk [awk]  1.3.4.20200120-3.1

base-files recommends no packages.

base-files suggests no packages.

-- no debconf information



Bug#1008735: base-files: /etc/os-release should contain VERSION variables for testing and unstable

2022-10-13 Thread Sedat Dilek
On Thu, Oct 13, 2022 at 4:03 PM Masahiro Yamada  wrote:
>
> Hi Sedat,
>
> Sorry for my late replay.
>
>
> On Mon, Oct 3, 2022 at 6:56 PM Sedat Dilek  wrote:
> >
> > [ CC linux-kbuild folks (see [0] ]
>
>
>
> Can you give me more context of this email?
>
>
>
>
> > Hi,
> >
> > I am using Debian/unstable AMD64 and doing Linux-kernel upstream
> > development and testing.
> >
> > People using bindeb-pkg (mkdebian) from Linux-kernel sources
> > (scripts/packages) to build and test their selfmade Debian kernels get
> > a now a "n/a" for distribution.
>
>
>
> Right, if I try the latest sid,
> "lsb_release -cs" returns "n/a".
> It returned "sid" before IIRC.
>
>
> What was changed in Debian?
> Any change in the lsb_release program?
>

Hi Masahiro San,

The Debian maintainer(s) changed the co-working of these packages:

root# dpkg -l | egrep 'base-files|lsb-release' | awk '/^ii/ {print $1
" " $2 " " $3}' | column -t
ii  base-files   12.3
ii  lsb-release  12.0-1
ii  lsb-release-minimal  12.0-1

My findings:
First, /usr/bin/lsb_release-11.4 (python) VS.
/usr/bin/lsb_release-12.0 (shell) - both files attached.
Second, version 12.0 checks now explicitly for values in /etc/os-release.
As a side note: All these changes were not mentioned in lsb-release
debian/changelog.

The easiest way to fix this is to add...

VERSION_ID=sid (or unstable)

...to /etc/os-release file.

Just for the sake of technical correctness:
"sid" or "unstable" is not a numerical value - it's a string.

In version 12.3 of base-files "VERSION_CODENAME=bookworm" was added on
users' request.

Last checks:

Original (base-files version 12.0):

[ /etc/os-release ]
PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/;
SUPPORT_URL="https://www.debian.org/support;
BUG_REPORT_URL="https://bugs.debian.org/;

root# lsb_release --all
No LSB modules are available.
Distributor ID: Debian
Description:Debian GNU/Linux bookworm/sid
Release:n/a
Codename:   bookworm

Modified:

[ /etc/os-release ]
PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
VERSION_CODENAME=bookworm
VERSION_ID=sid
ID=debian
HOME_URL="https://www.debian.org/;
SUPPORT_URL="https://www.debian.org/support;
BUG_REPORT_URL="https://bugs.debian.org/;

root# lsb_release --all
No LSB modules are available.
Distributor ID: Debian
Description:Debian GNU/Linux bookworm/sid
Release:sid
Codename:   bookworm

More comments see https://bugs.debian.org/1008735.

-Sedat-

>
>
>
>
>
> >
> > Background (see [1]):
> >
> > [ scripts/package/mkdebian ]
> >
> > # Try to determine distribution
> > if [ -n "$KDEB_CHANGELOG_DIST" ]; then
> > distribution=$KDEB_CHANGELOG_DIST
> > # In some cases lsb_release returns the codename as n/a, which breaks
> > dpkg-parsechangelog
> > elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n
> > "$distribution" ] && [ "$distribution" != "n/a" ]; then
> > : # nothing to do in this case
> > else
> > distribution="unstable"
> > echo >&2 "Using default distribution of 'unstable' in the changelog"
> > echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST 
> > explicitly"
> > fi
> >
> > Personally, I set hardcoded in my kernel build-script as a workaround:
> >
> > distribution="bookworm"
> >
> > Gioele suggested me to enrich /etc/os-release with:
> >
> > VERSION_ID=unstable <--- XXX: I prefer sid because of PRETTY_NAME and
> > it's shorter
> > VERSION_CODENAME=bookworm
> >
> > In the end the file looks like:
> >
> > PRETTY_NAME="Debian GNU/Linux bookworm/sid"
> > NAME="Debian GNU/Linux"
> > ID=debian
> > VERSION_ID=sid
> > VERSION_CODENAME=bookworm
> > HOME_URL="https://www.debian.org/;
> > SUPPORT_URL="https://www.debian.org/support;
> > BUG_REPORT_URL="https://bugs.debian.org/;
> >
> > ...and this seems to work:
> >
> > # lsb_release -cs
> > No LSB modules are available.
> > bookworm
> >
> > Please, provide a solution not to break workflows that were successful
> > for years.
> >
> > Thanks.
> >
> > Best regards,
> > -Sedat-
> >
> > [0] 
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/MAINTAINERS#n11005
> > [1] 
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/package/mkdebian#n123
>
>
>
> --
> Best Regards
> Masahiro Yamada


lsb_release-11.4
Description: Unix manual page


lsb_release-12.0
Description: Binary data


Bug#1008735: base-files: /etc/os-release should contain VERSION variables for testing and unstable

2022-10-13 Thread Masahiro Yamada
Hi Sedat,

Sorry for my late replay.


On Mon, Oct 3, 2022 at 6:56 PM Sedat Dilek  wrote:
>
> [ CC linux-kbuild folks (see [0] ]



Can you give me more context of this email?




> Hi,
>
> I am using Debian/unstable AMD64 and doing Linux-kernel upstream
> development and testing.
>
> People using bindeb-pkg (mkdebian) from Linux-kernel sources
> (scripts/packages) to build and test their selfmade Debian kernels get
> a now a "n/a" for distribution.



Right, if I try the latest sid,
"lsb_release -cs" returns "n/a".
It returned "sid" before IIRC.


What was changed in Debian?
Any change in the lsb_release program?







>
> Background (see [1]):
>
> [ scripts/package/mkdebian ]
>
> # Try to determine distribution
> if [ -n "$KDEB_CHANGELOG_DIST" ]; then
> distribution=$KDEB_CHANGELOG_DIST
> # In some cases lsb_release returns the codename as n/a, which breaks
> dpkg-parsechangelog
> elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n
> "$distribution" ] && [ "$distribution" != "n/a" ]; then
> : # nothing to do in this case
> else
> distribution="unstable"
> echo >&2 "Using default distribution of 'unstable' in the changelog"
> echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly"
> fi
>
> Personally, I set hardcoded in my kernel build-script as a workaround:
>
> distribution="bookworm"
>
> Gioele suggested me to enrich /etc/os-release with:
>
> VERSION_ID=unstable <--- XXX: I prefer sid because of PRETTY_NAME and
> it's shorter
> VERSION_CODENAME=bookworm
>
> In the end the file looks like:
>
> PRETTY_NAME="Debian GNU/Linux bookworm/sid"
> NAME="Debian GNU/Linux"
> ID=debian
> VERSION_ID=sid
> VERSION_CODENAME=bookworm
> HOME_URL="https://www.debian.org/;
> SUPPORT_URL="https://www.debian.org/support;
> BUG_REPORT_URL="https://bugs.debian.org/;
>
> ...and this seems to work:
>
> # lsb_release -cs
> No LSB modules are available.
> bookworm
>
> Please, provide a solution not to break workflows that were successful
> for years.
>
> Thanks.
>
> Best regards,
> -Sedat-
>
> [0] 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/MAINTAINERS#n11005
> [1] 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/package/mkdebian#n123



-- 
Best Regards
Masahiro Yamada



Bug#1008735: base-files: /etc/os-release should contain VERSION variables for testing and unstable

2022-10-03 Thread Santiago Vila

El 3/10/22 a las 11:55, Sedat Dilek escribió:

VERSION_ID=sid
VERSION_CODENAME=bookworm


This is "schizophrenic", so to speak, and I don't think it is a good idea.

I've simply added VERSION_CODENAME=bookworm.

The only caveat is that testing and unstable are sides of the same coin,
but this is already explained in /usr/share/doc/base-files/FAQ.

As a result, if you take the VERSION_CODENAME string and include it in a 
kernel version string somewhere, the meaning of such string is that the 
kernel image was created in either a bookworm or a sid distribution.


I think this is good enough for most purposes. If you need more 
fine-tuning, somebody should investigate what kind of magic lsb_release 
did in the past and reenable part of it.


Thanks.



Bug#1008735: base-files: /etc/os-release should contain VERSION variables for testing and unstable

2022-10-03 Thread Sedat Dilek
[ CC linux-kbuild folks (see [0] ]

Hi,

I am using Debian/unstable AMD64 and doing Linux-kernel upstream
development and testing.

People using bindeb-pkg (mkdebian) from Linux-kernel sources
(scripts/packages) to build and test their selfmade Debian kernels get
a now a "n/a" for distribution.

Background (see [1]):

[ scripts/package/mkdebian ]

# Try to determine distribution
if [ -n "$KDEB_CHANGELOG_DIST" ]; then
distribution=$KDEB_CHANGELOG_DIST
# In some cases lsb_release returns the codename as n/a, which breaks
dpkg-parsechangelog
elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n
"$distribution" ] && [ "$distribution" != "n/a" ]; then
: # nothing to do in this case
else
distribution="unstable"
echo >&2 "Using default distribution of 'unstable' in the changelog"
echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly"
fi

Personally, I set hardcoded in my kernel build-script as a workaround:

distribution="bookworm"

Gioele suggested me to enrich /etc/os-release with:

VERSION_ID=unstable <--- XXX: I prefer sid because of PRETTY_NAME and
it's shorter
VERSION_CODENAME=bookworm

In the end the file looks like:

PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
ID=debian
VERSION_ID=sid
VERSION_CODENAME=bookworm
HOME_URL="https://www.debian.org/;
SUPPORT_URL="https://www.debian.org/support;
BUG_REPORT_URL="https://bugs.debian.org/;

...and this seems to work:

# lsb_release -cs
No LSB modules are available.
bookworm

Please, provide a solution not to break workflows that were successful
for years.

Thanks.

Best regards,
-Sedat-

[0] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/MAINTAINERS#n11005
[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/package/mkdebian#n123



Bug#1008735: base-files: /etc/os-release should contain VERSION variables for testing and unstable

2022-10-01 Thread Witold Baryluk
Package: base-files
Version: 12.2
Followup-For: Bug #1008735
X-Debbugs-Cc: witold.bary...@gmail.com

I also noticed the issue today.

For the context I use it for compiling mesa by outside script:

https://gist.github.com/baryluk/1041204eff4cc4fad6f1508afe67b562/5771c245a55760b7f25b05dc0b397789b27ac0b7#file-mesa-build-sh-L421-L454

as depending on a version of Debian / Ubuntu, I must manually specify
some LLVM related packages with specific version explicitly, and which
compilers to invoke exactly.

And while for testing and unstable, it requires sporadic update to the
script, it is still only relable and easy way to do this using
lsb_release info.

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.0.0-rc5 (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages base-files depends on:
ii  gawk [awk]  1:5.1.0-1
ii  mawk [awk]  1.3.4.20200120-3.1

base-files recommends no packages.

base-files suggests no packages.

-- no debconf information