Bug#1009844: debhelper: Build failed with dh_installalternatives: error: Alternative ...

2022-04-19 Thread Sven Joachim
Control: affects -1 src:xterm
Control: severity -1 serious

On 2022-04-19 13:59 +0100, Colin Watson wrote:

> Control: affects -1 src:openssh
>
> On Tue, Apr 19, 2022 at 12:05:22PM +0900, Hiroyuki YAMAMORI wrote:
>> When rebuilding rsh-redone, the following message is output and the build 
>> fails.
>>
>> dh_installalternatives: error: Alternative "/usr/bin/rsh-redone-rsh" for 
>> "rsh" in debian/rsh-redone-client.alternatives does not exist in 
>> debian/rsh-redone-client or is a directory
>> make: *** [debian/rules:16: binary] Error 25
>> dpkg-buildpackage: error: debian/rules binary subprocess returned exit 
>> status 2
>>
>>
>> Solved with the following patch.
>>
>> --- a/usr/bin/dh_installalternatives
>> +++ b/usr/bin/dh_installalternatives
>> @@ -99,7 +99,7 @@ sub _parse_alternative_and_generate_main
>> if (index($link_name, '/') > -1) {
>> error(qq{Invalid link name "${link_name}" in 
>> "${alternatives_file}": Must not contain slash});
>> }
>> -   if ( ! -l "${tmpdir}/${impl_path}" or -d _) {
>> +   if ( ! -e "${tmpdir}/${impl_path}" or -d _ or ! -r _) {
>> error(qq{Alternative "${impl_path}" for "${link_name}" in 
>> ${alternatives_file} does not exist in ${tmpdir} or is a directory});
>> }
>> if ($link_name eq $impl_path) {
>
> This also causes openssh to fail to build (see e.g.
> https://salsa.debian.org/flurb/openssh/-/jobs/2683517).  Something like
> this patch looks reasonable to me, and at any rate the previous code
> doesn't make sense; it seems to require the potential *target* of the
> alternative to be a symlink.

I get the same error in xterm, so I have raised the severity as at
least three packages now fail to build.

Cheers,
   Sven



Bug#1009844: debhelper: Build failed with dh_installalternatives: error: Alternative ...

2022-04-19 Thread Colin Watson
Control: affects -1 src:openssh

On Tue, Apr 19, 2022 at 12:05:22PM +0900, Hiroyuki YAMAMORI wrote:
> When rebuilding rsh-redone, the following message is output and the build 
> fails.
> 
> dh_installalternatives: error: Alternative "/usr/bin/rsh-redone-rsh" for 
> "rsh" in debian/rsh-redone-client.alternatives does not exist in 
> debian/rsh-redone-client or is a directory
> make: *** [debian/rules:16: binary] Error 25
> dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 
> 2
> 
> 
> Solved with the following patch.
> 
> --- a/usr/bin/dh_installalternatives
> +++ b/usr/bin/dh_installalternatives
> @@ -99,7 +99,7 @@ sub _parse_alternative_and_generate_main
> if (index($link_name, '/') > -1) {
> error(qq{Invalid link name "${link_name}" in 
> "${alternatives_file}": Must not contain slash});
> }
> -   if ( ! -l "${tmpdir}/${impl_path}" or -d _) {
> +   if ( ! -e "${tmpdir}/${impl_path}" or -d _ or ! -r _) {
> error(qq{Alternative "${impl_path}" for "${link_name}" in 
> ${alternatives_file} does not exist in ${tmpdir} or is a directory});
> }
> if ($link_name eq $impl_path) {

This also causes openssh to fail to build (see e.g.
https://salsa.debian.org/flurb/openssh/-/jobs/2683517).  Something like
this patch looks reasonable to me, and at any rate the previous code
doesn't make sense; it seems to require the potential *target* of the
alternative to be a symlink.

-- 
Colin Watson (he/him)  [cjwat...@debian.org]



Bug#1009844: debhelper: Build failed with dh_installalternatives: error: Alternative ...

2022-04-18 Thread Hiroyuki YAMAMORI
Package: debhelper
Version: 13.7
Severity: important
Tags: patch

Dear Maintainer,

When rebuilding rsh-redone, the following message is output and the build fails.

dh_installalternatives: error: Alternative "/usr/bin/rsh-redone-rsh" for "rsh" 
in debian/rsh-redone-client.alternatives does not exist in 
debian/rsh-redone-client or is a directory
make: *** [debian/rules:16: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2


Solved with the following patch.

--- a/usr/bin/dh_installalternatives
+++ b/usr/bin/dh_installalternatives
@@ -99,7 +99,7 @@ sub _parse_alternative_and_generate_main
if (index($link_name, '/') > -1) {
error(qq{Invalid link name "${link_name}" in 
"${alternatives_file}": Must not contain slash});
}
-   if ( ! -l "${tmpdir}/${impl_path}" or -d _) {
+   if ( ! -e "${tmpdir}/${impl_path}" or -d _ or ! -r _) {
error(qq{Alternative "${impl_path}" for "${link_name}" in 
${alternatives_file} does not exist in ${tmpdir} or is a directory});
}
if ($link_name eq $impl_path) {


Thank you,
Hiroyuki YAMAMORI


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 5.10.0-13-686-pae (SMP w/3 CPU threads)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages debhelper depends on:
ii  autotools-dev20220109.1
ii  dh-autoreconf20
ii  dh-strip-nondeterminism  1.13.0-1
ii  dpkg 1.21.7
ii  dpkg-dev 1.21.7
ii  dwz  0.14-1
ii  file 1:5.41-3
ii  libdebhelper-perl13.7
ii  libdpkg-perl 1.21.7
ii  man-db   2.10.2-1
ii  perl 5.34.0-4
ii  po-debconf   1.0.21+nmu1

debhelper recommends no packages.

Versions of packages debhelper suggests:
pn  dh-make  

-- no debconf information