Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2016-01-24 Thread Axel Beckert
Hi,

Marco d'Itri wrote:
> Again, with the correct patch for zsh.

While I can't use the patch directly, the patch helps to make a proper
fix without using the alternatives system respectively removing the
alternatives without causing similar issues for usrmerge again. (I
else would have used the much cleaner debian/zsh.links instead.)

I have a half working package as of now, but I will need a few more
days for a proper package. Currently still open:

* Dummy wrapper for zsh5 and zsh5-static as done with zsh4* wrappers.
* Verify that resp. check if man pages symlinks zsh vs zsh5 are no
  more needed.
* Testing.

And -- as state before -- I definitely would like to first upload both
things (manual handling of the slave alternatives and removal of the
alternatives in general) first in experimental for some wider testing
before uploading any of that to unstable.

Regards, Axel
-- 
 ,''`.  |  Axel Beckert , http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-|  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



Bug#768079: [Pkg-zsh-devel] Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2016-01-22 Thread Axel Beckert
Hi Sven,

Sven Joachim wrote:
> Personally I think zsh should stop using update-alternatives altogether
> now that zsh-beta is history, but this is for the package maintainers to
> decide.

Indeed, thanks for the reminder. I guess this bug report is a good
reason to implement that now.

I'll probably do an upload of a new release candidate to experimental
soon (like this weekend) and will try to fix this issue with that,
too.

I definitely don't want to upload a fix for this bug to unstable
directly as I assume that there will be unexpected side-effects of
such a change.

Regards, Axel
-- 
 ,''`.  |  Axel Beckert , http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-|  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2016-01-22 Thread Sven Joachim
On 2016-01-22 07:19 +0100, Marco d'Itri wrote:

> On Jan 06, Marco d'Itri  wrote:
>
>> Again, with the correct patch for zsh.
> Sven, I have not heard back from you in a while.

Oh, I didn't know I was expected to reply.

> Do you have any questions about this patch?
> Do you need help? I do not mind doing a NMU if you want.

Personally I think zsh should stop using update-alternatives altogether
now that zsh-beta is history, but this is for the package maintainers to
decide.

Cheers,
   Sven



Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2016-01-21 Thread Marco d'Itri
On Jan 06, Marco d'Itri  wrote:

> Again, with the correct patch for zsh.
Sven, I have not heard back from you in a while. Do you have any 
questions about this patch?
Do you need help? I do not mind doing a NMU if you want.

-- 
ciao,
Marco


signature.asc
Description: PGP signature


Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2016-01-06 Thread Marco d'Itri
Again, with the correct patch for zsh.

-- 
ciao,
Marco
diff --git a/debian/changelog b/debian/changelog
index 5813292..dce895c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+zsh (5.2-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Create the /usr/bin/zsh compatibility link in postinst instead that as
+an update-alternatives slave link, to support merged /usr systems.
+(Closes: #768079)
+
+ -- Marco d'Itri   Wed, 06 Jan 2016 05:39:48 +0100
+
 zsh (5.2-3) unstable; urgency=medium
 
   [ Axel Beckert ]
diff --git a/debian/zsh.postinst b/debian/zsh.postinst
index 2ba2202..22fc2ed 100644
--- a/debian/zsh.postinst
+++ b/debian/zsh.postinst
@@ -21,13 +21,16 @@ esac
 update-alternatives --remove zsh /usr/bin/zsh
 update-alternatives --remove ksh /usr/bin/zsh
 update-alternatives --remove ksh /bin/zsh4
-update-alternatives --install /bin/zsh zsh /bin/zsh5 51 \
-		--slave /usr/bin/zsh zsh-usrbin /bin/zsh5
+update-alternatives --install /bin/zsh zsh /bin/zsh5 51
 update-alternatives --install /bin/rzsh rzsh /bin/zsh5 51 \
 		--slave /usr/share/man/man1/rzsh.1.gz rzsh.1.gz /usr/share/man/man1/zsh.1.gz
 update-alternatives --remove zsh /bin/zsh4
 update-alternatives --remove rzsh /bin/zsh4
 
+if [ ! -e /usr/bin/zsh -a ! -L /usr/bin/zsh ]; then
+  ln -s /bin/zsh /usr/bin/zsh
+fi
+
 #DEBHELPER#
 
 exit 0
diff --git a/debian/zsh.prerm b/debian/zsh.prerm
index d49ec46..0044860 100644
--- a/debian/zsh.prerm
+++ b/debian/zsh.prerm
@@ -6,6 +6,10 @@ case "$1" in
 (remove|deconfigure)
 	update-alternatives --remove zsh /bin/zsh5
 	update-alternatives --remove rzsh /bin/zsh5
+	# remove the compatibility link if it is broken
+	if [ -L /usr/bin/zsh -a ! -e /usr/bin/zsh ]; then
+		rm /usr/bin/zsh
+	fi
 ;;
 (upgrade)
 ;;


signature.asc
Description: PGP signature


Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2016-01-06 Thread Marco d'Itri
On Dec 26, Felipe Sateler  wrote:

> So, I dug up a bit, and the /usr/bin/zsh slave's purpose was to
> preserve the /usr/bin path when zsh was moved from /usr to /. Since
> this is a slave link that will be updated whenever the master link is
> updated (so /bin/zsh and /usr/bin/zsh should always point to the same
> place) and nobody else is using this name[1], I propose that the
> alternative is simply dropped, and have a symlink from /usr/bin/zsh
> point to /bin/zsh. Then that link can be omitted when /bin is a
> symlink to /usr/bin.
> 
> Please find attached an (untested) patch that does that.
Your patch does not work because it would unconditionally remove 
/usr/bin/zsh even if it were still needed because another package 
providing /bin/zsh is still installed.
It also checks in preinst that /usr/bin/ksh is not a broken link, 
because I suppose that this could happen and then without this check 
the script would fail.

Please let me know if this patch is acceptable, I have similar ones for 
mksh and ksh.

-- 
ciao,
Marco
diff --git a/debian/changelog b/debian/changelog
index cc7d18f..9ef7135 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+ksh (93u+20120801-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Create the /usr/bin/ksh compatibility link in postinst instead that as
+an update-alternatives slave link, to support merged /usr systems.
+(Closes: FIXME)
+
+ -- Marco d'Itri   Wed, 06 Jan 2016 04:56:37 +0100
+
 ksh (93u+20120801-2) unstable; urgency=medium
 
   * Adopted package (Closes: #691199)
diff --git a/debian/postinst b/debian/postinst
index 822ec9e..477a5c5 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -22,10 +22,13 @@ esac
 # The alternative is the mksh package.
 # For a discussion on interactions between ksh and mksh, see #764401.
 update-alternatives --install /bin/ksh ksh /bin/ksh93 20 \
---slave /usr/bin/ksh usr.bin.ksh /bin/ksh93 \
 --slave /usr/share/man/man1/ksh.1.gz ksh.1.gz \
 /usr/share/man/man1/ksh93.1.gz
 
+if [ ! -e /usr/bin/ksh -a ! -L /usr/bin/ksh ]; then
+  ln -s /bin/ksh /usr/bin/ksh
+fi
+
 # For a discussion of what we put in /etc/shells see #790118.
 add-shell /bin/ksh93
 add-shell /bin/rksh93
diff --git a/debian/prerm b/debian/prerm
index 1626b99..4626036 100644
--- a/debian/prerm
+++ b/debian/prerm
@@ -6,6 +6,10 @@ case "$1" in
 remove|deconfigure)
 update-alternatives --remove ksh /bin/ksh93
 	update-binfmts --package ksh --remove ksh /bin/ksh93
+	# remove the compatibility link if it is broken
+	if [ -L /usr/bin/ksh -a ! -e /usr/bin/ksh ]; then
+	  rm /usr/bin/ksh
+	fi
 ;;
 
 upgrade|failed-upgrade)


signature.asc
Description: PGP signature


Bug#768079: Bug#807185: [Pkg-zsh-devel] Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2016-01-05 Thread Bastien Roucaries
Ou

Le 4 janvier 2016 19:57:57 GMT+01:00, m...@linux.it a écrit :
>On Jan 04, Felipe Sateler  wrote:
>
>> Checking wether a slave link is the same as the master link because
>of
>> usrmerge sounds a bit too specific to me to add to a low-level tool
>> like update-alternatives. It's like asking `ln -s file file` to do
>> nothing instead of returning an error.
>I agree that we do not need an u-a change, since this bug only affects 
>two packages.
>
>The maintainer scripts solution which was proposed earlier is
>definitely 
>buggy, but soon I will work on it.

Please get review for me and Guillem.

Thanks

-- 
Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.



Bug#768079: Bug#807185: [Pkg-zsh-devel] Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2016-01-04 Thread Marco d'Itri
On Jan 04, Felipe Sateler  wrote:

> Checking wether a slave link is the same as the master link because of
> usrmerge sounds a bit too specific to me to add to a low-level tool
> like update-alternatives. It's like asking `ln -s file file` to do
> nothing instead of returning an error.
I agree that we do not need an u-a change, since this bug only affects 
two packages.

The maintainer scripts solution which was proposed earlier is definitely 
buggy, but soon I will work on it.

-- 
ciao,
Marco


signature.asc
Description: PGP signature


Bug#768079: [Pkg-zsh-devel] Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2016-01-04 Thread Felipe Sateler
On 27 December 2015 at 13:11, Axel Beckert  wrote:
> Hi,
>
> Sven Joachim wrote:
>> On a system with everything in /usr[1,2], i.e. /bin is a symlink to
>> /usr/bin, zsh fails to configure:
>>
>> ,
>> | Setting up zsh (5.0.7-3) ...
>> | update-alternatives: using /bin/zsh5 to provide /bin/zsh (zsh) in auto mode
>> | update-alternatives: error: unable to install `/usr/bin/zsh.dpkg-tmp' as 
>> `/usr/bin/zsh': No such file or directory
>> | dpkg: error processing package zsh (--configure):
>> |  subprocess installed post-installation script returned error exit status 2
>> | Errors were encountered while processing:
>> |  zsh
>> `
>>
>> I guess update-alternatives does not like the fact that the /bin/zsh
>> alternative and its slave /usr/bin/zsh are at the same place.
>
> Reading this comment and https://bugs.debian.org/807185, I wonder if
> this is not something, that update-alternatives should generally fix
> in its --slave handling instead of each affected package individually.

Checking wether a slave link is the same as the master link because of
usrmerge sounds a bit too specific to me to add to a low-level tool
like update-alternatives. It's like asking `ln -s file file` to do
nothing instead of returning an error.

If there is a bug here in u-a, it is that the error message is not very helpful.


-- 

Saludos,
Felipe Sateler



Bug#768079: [Pkg-zsh-devel] Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2015-12-27 Thread Axel Beckert
Hi,

Sven Joachim wrote:
> On a system with everything in /usr[1,2], i.e. /bin is a symlink to
> /usr/bin, zsh fails to configure:
> 
> ,
> | Setting up zsh (5.0.7-3) ...
> | update-alternatives: using /bin/zsh5 to provide /bin/zsh (zsh) in auto mode
> | update-alternatives: error: unable to install `/usr/bin/zsh.dpkg-tmp' as 
> `/usr/bin/zsh': No such file or directory
> | dpkg: error processing package zsh (--configure):
> |  subprocess installed post-installation script returned error exit status 2
> | Errors were encountered while processing:
> |  zsh
> `
> 
> I guess update-alternatives does not like the fact that the /bin/zsh
> alternative and its slave /usr/bin/zsh are at the same place.

Reading this comment and https://bugs.debian.org/807185, I wonder if
this is not something, that update-alternatives should generally fix
in its --slave handling instead of each affected package individually.

Cc'ing the Dpkg Developers.

Regards, Axel
-- 
 ,''`.  |  Axel Beckert , http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-|  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2015-12-25 Thread Felipe Sateler
Control: tags -1 patch

On Tue, 04 Nov 2014 21:27:11 +0100 Sven Joachim  wrote:
> On a system with everything in /usr[1,2], i.e. /bin is a symlink to
> /usr/bin, zsh fails to configure:
>
> ,
> | Setting up zsh (5.0.7-3) ...
> | update-alternatives: using /bin/zsh5 to provide /bin/zsh (zsh) in auto mode
> | update-alternatives: error: unable to install `/usr/bin/zsh.dpkg-tmp' as 
> `/usr/bin/zsh': No such file or directory
> | dpkg: error processing package zsh (--configure):
> |  subprocess installed post-installation script returned error exit status 2
> | Errors were encountered while processing:
> |  zsh
> `
>
> I guess update-alternatives does not like the fact that the /bin/zsh
> alternative and its slave /usr/bin/zsh are at the same place.

So, I dug up a bit, and the /usr/bin/zsh slave's purpose was to
preserve the /usr/bin path when zsh was moved from /usr to /. Since
this is a slave link that will be updated whenever the master link is
updated (so /bin/zsh and /usr/bin/zsh should always point to the same
place) and nobody else is using this name[1], I propose that the
alternative is simply dropped, and have a symlink from /usr/bin/zsh
point to /bin/zsh. Then that link can be omitted when /bin is a
symlink to /usr/bin.

Please find attached an (untested) patch that does that.


[1] https://codesearch.debian.net/results/zsh-usrbin/page_0 shows zsh
and a test case.

-- 

Saludos,
Felipe Sateler
diff --git a/debian/zsh.postinst b/debian/zsh.postinst
index 2ba2202..2b4cf39 100644
--- a/debian/zsh.postinst
+++ b/debian/zsh.postinst
@@ -21,13 +21,16 @@ esac
 update-alternatives --remove zsh /usr/bin/zsh
 update-alternatives --remove ksh /usr/bin/zsh
 update-alternatives --remove ksh /bin/zsh4
-update-alternatives --install /bin/zsh zsh /bin/zsh5 51 \
-   --slave /usr/bin/zsh zsh-usrbin /bin/zsh5
+update-alternatives --install /bin/zsh zsh /bin/zsh5 51
 update-alternatives --install /bin/rzsh rzsh /bin/zsh5 51 \
--slave /usr/share/man/man1/rzsh.1.gz rzsh.1.gz 
/usr/share/man/man1/zsh.1.gz
 update-alternatives --remove zsh /bin/zsh4
 update-alternatives --remove rzsh /bin/zsh4
 
+if [ ! -e /usr/bin/zsh ] ; then
+ln -s /bin/zsh /usr/bin/zsh
+fi
+
 #DEBHELPER#
 
 exit 0
diff --git a/debian/zsh.postrm b/debian/zsh.postrm
index a8921f6..60fe519 100644
--- a/debian/zsh.postrm
+++ b/debian/zsh.postrm
@@ -6,6 +6,9 @@ case "$1" in
(remove)
remove-shell /bin/zsh
remove-shell /usr/bin/zsh
+   if [ -L /usr/bin/zsh ] ; then
+   rm /usr/bin/zsh
+   fi
;;
 esac
 


Bug#768079: zsh: fails to configure if /bin is a symlink to /usr/bin

2014-11-04 Thread Sven Joachim
Package: zsh
Version: 5.0.7-3
Severity: normal
User: m...@linux.it
Usertags: usrmerge

On a system with everything in /usr[1,2], i.e. /bin is a symlink to
/usr/bin, zsh fails to configure:

,
| Setting up zsh (5.0.7-3) ...
| update-alternatives: using /bin/zsh5 to provide /bin/zsh (zsh) in auto mode
| update-alternatives: error: unable to install `/usr/bin/zsh.dpkg-tmp' as 
`/usr/bin/zsh': No such file or directory
| dpkg: error processing package zsh (--configure):
|  subprocess installed post-installation script returned error exit status 2
| Errors were encountered while processing:
|  zsh
`

I guess update-alternatives does not like the fact that the /bin/zsh
alternative and its slave /usr/bin/zsh are at the same place.


1. https://lists.debian.org/debian-devel/2014/11/msg00013.html
2. 
http://anonscm.debian.org/cgit/users/md/usrmerge.git/tree/debian/README.Debian



-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 3.17.2-nouveau (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages zsh depends on:
ii  libc6   2.19-12
ii  libcap2 1:2.24-6
ii  libtinfo5   5.9+20140913-1
ii  zsh-common  5.0.7-3

Versions of packages zsh recommends:
ii  libncursesw5  5.9+20140913-1
ii  libpcre3  1:8.35-3.1

Versions of packages zsh suggests:
ii  zsh-doc  5.0.7-3

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org