--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: /usr/share/debootstrap/functions: use tar -h in extract_dpkg_deb_data
- From: Yves-Alexis Perez <corsac@debian.org>
- Date: Thu, 03 Dec 2015 08:16:21 +0100
- Message-id: <144912698170.32670.11465646854767435165.reportbug@scapa>
Package: debootstrap
Version: 1.0.75
Severity: normal
File: /usr/share/debootstrap/functions
Hi,
dpkg behavior is to preserve as hard as it can the current layout of the
filesystem wrt. symlink to directories: it will try not to replace a
symlink by a folder or even the opposite.
In debootstrap early stages, dpkg is not used (because not yet installed
in the target), but a custom implementatin using dpkg-deb|tar or ar is
used. Unfortunately, this implementation doesn't follow dpkg behavior,
and will happily replace a symlink by a dir.
I'm using debootstrap in a custom way where I need to create some
symlinks beforehand (for example some multiarches dirs like lib -> lib64
in / and /usr), it works fine with dpkg, but not with debootstrap early
extract.
Would it be possible to replace the tar call in extract_dpkg_deb_data
with tar -hxf so it will follow symlinks instead of replacing them?
Regards,
--
Yves-Alexis
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (450, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages debootstrap depends on:
ii wget 1.17-1
Versions of packages debootstrap recommends:
ii debian-archive-keyring 2014.3
ii gnupg 1.4.19-6
debootstrap suggests no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
- To: Yves-Alexis Perez <corsac@debian.org>
- Cc: 806936-done@bugs.debian.org
- Subject: Re: Bug#806936: /usr/share/debootstrap/functions: use tar -h in extract_dpkg_deb_data
- From: Ansgar Burchardt <ansgar@debian.org>
- Date: Wed, 19 Oct 2016 23:58:19 +0200
- Message-id: <87lgxkdmro.fsf@deep-thought.43-1.org>
- In-reply-to: <144912698170.32670.11465646854767435165.reportbug@scapa> (Yves-Alexis Perez's message of "Thu, 03 Dec 2015 08:16:21 +0100")
- References: <144912698170.32670.11465646854767435165.reportbug@scapa>
Version: 1.0.83
Yves-Alexis Perez writes:
> dpkg behavior is to preserve as hard as it can the current layout of the
> filesystem wrt. symlink to directories: it will try not to replace a
> symlink by a folder or even the opposite.
>
> In debootstrap early stages, dpkg is not used (because not yet installed
> in the target), but a custom implementatin using dpkg-deb|tar or ar is
> used. Unfortunately, this implementation doesn't follow dpkg behavior,
> and will happily replace a symlink by a dir.
>
> I'm using debootstrap in a custom way where I need to create some
> symlinks beforehand (for example some multiarches dirs like lib -> lib64
> in / and /usr), it works fine with dpkg, but not with debootstrap early
> extract.
>
> Would it be possible to replace the tar call in extract_dpkg_deb_data
> with tar -hxf so it will follow symlinks instead of replacing them?
Recent versions of debootstrap use `tar -k` which does keep symlinks (so
that for example symlinks from /* to /usr/* are kept for merged-/usr).
Note that this will only work for newer releases as `-k` fails in case
of file conflicts[1].
Ansgar
[1] <https://bugs.debian.org/838388>
--- End Message ---