Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 460770 - Change of PORTAGE_COMPRESS causes symlinks to manpages linger after unmerge
Summary: Change of PORTAGE_COMPRESS causes symlinks to manpages linger after unmerge
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-08 13:51 UTC by Roman Žilka
Modified: 2022-10-17 23:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Žilka 2013-03-08 13:51:24 UTC
I recently did an 'emerge -e world' accompanied by a change of PORTAGE_BZIP2_COMMAND and PORTAGE_BUNZIP2_COMMAND to "" from the default bzip2. This change made the (some?) symlinks to *.bz2 manpages left unmerged as the world rebuild process kept unmerging old packages that installed symlinks to .bz2 manpages. It may affect other files than manpages as well; it should probably be regarded as a conceptual issue in Portage.

Tested on an amd64 and an x86 system.

Reproducible: Always

Steps to Reproduce:
1. Do not set PORTAGE_B(UN)ZIP2_COMMAND in make.conf
2. ROOT="/tmp/temp" emerge -O perl
3. Set PORTAGE_B(UN)ZIP2_COMMAND="" in make.conf
4. ROOT="/tmp/temp" emerge -C perl
5. Find the dead symlinks in /tmp/temp/usr/share/man/man1



Portage 2.1.11.52 (hardened/linux/amd64, gcc-4.6.3, glibc-2.15-r3, 3.7.5 x86_64)
=================================================================
System uname: Linux-3.7.5-x86_64-Intel-R-_Core-TM-_i5-2520M_CPU_@_2.50GHz-with-gentoo-2.1
KiB Mem:     4022828 total,   1986608 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Thu, 07 Mar 2013 21:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
DISTDIR="/tmp/distfiles"
FCFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo parallel-fetch parallel-install protect-owned sandbox sfperms strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch usersync"
FFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
GENTOO_MIRRORS="http://gentoo.mirror.dkm.cz/pub/gentoo/ http://gentoo.supp.name/ http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.web4u.cz/ http://mirror.netcologne.de/gentoo/"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/tmp/packages"
PORTAGE_COMPRESS=""
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--sparse --itemize-changes --human-readable --stats --compress --compress-level=9"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/boot/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.cz.gentoo.org/gentoo-portage"
USE="X a52 aac acpi aes-ni alsa amd64 avx avx256 bash-completion berkdb bluetooth bzip2 cddb cjk cli cracklib crypt cxx dri encode ffmpeg flac fontconfig ftp gdbm geoip gif gnutls gps gzip hardened hddtemp iconv icu idn imap javascript jpeg jpeg2k justify libass lm_sensors lzma lzo matroska mbox mime mms mmx modules mp3 mp4 mpeg mplayer mudflap multilib musicbrainz ncurses nls nocd nptl ogg opengl pam pax_kernel pcre pda pdf png postscript quicktime raw readline recode session smp sockets sound spell sse sse2 sse2_4way sse3 sse4_1 ssl ssse3 svg syslog threads truetype udev unicode urandom usb v4l vdpau videos vim-syntax vorbis wifi x264 xcomposite xosd xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en cs sk ja" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="i965 intel vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, USE_PYTHON
Comment 1 Roman Žilka 2013-03-08 15:01:14 UTC
It may also be worthwhile to reconsider the default bzip2 compression for everything. I suppose it comes from the days when disk space was not so cheap, so it was seen as a bonus. Now that disk space is the cheapest thing on the planet (for most users, anyway), it might be better to save the CPU the hassle of having to fork, exec and uncompress.

If anyone considers this a sound idea, please, open the bug for it yourself.
Comment 2 Zac Medico gentoo-dev 2013-03-08 15:49:52 UTC
In case you didn't know, there's no valid reason to set PORTAGE_BZIP2_COMMAND or PORTAGE_BUNZIP2_COMMAND to empty strings. If you want to disable compression then you should instead set PORTAGE_COMPRESS to "".

(In reply to comment #1)
> It may also be worthwhile to reconsider the default bzip2 compression for
> everything.

See bug 169260 for that.
Comment 3 Zac Medico gentoo-dev 2013-03-08 16:22:58 UTC
(In reply to comment #0)
> I recently did an 'emerge -e world' accompanied by a change of
> PORTAGE_BZIP2_COMMAND and PORTAGE_BUNZIP2_COMMAND to "" from the default
> bzip2. This change made the (some?) symlinks to *.bz2 manpages left unmerged
> as the world rebuild process kept unmerging old packages that installed
> symlinks to .bz2 manpages. It may affect other files than manpages as well;
> it should probably be regarded as a conceptual issue in Portage.
> 
> Tested on an amd64 and an x86 system.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Do not set PORTAGE_B(UN)ZIP2_COMMAND in make.conf
> 2. ROOT="/tmp/temp" emerge -O perl
> 3. Set PORTAGE_B(UN)ZIP2_COMMAND="" in make.conf
> 4. ROOT="/tmp/temp" emerge -C perl
> 5. Find the dead symlinks in /tmp/temp/usr/share/man/man1

It's not immediately obvious to me why setting PORTAGE_BZIP2_COMMAND and PORTAGE_BUNZIP2_COMMAND to "" would have any effect, since portage silently substitutes the value from /usr/share/portage/config/make.globals when when you have an empty setting.

Furthermore, I tried to reproduce your issue and was not able to, but I observed a bunch of elog messages like these which were apparently generated by alternatives.eclass:

 * Removing dead symlink /tmp/testroot/usr/bin/ptar
 * Removing dead symlink /tmp/testroot/usr/share/man/man1/ptar.1.bz2
 * Removing dead symlink /tmp/testroot/usr/bin/ptardiff
 * Removing dead symlink /tmp/testroot/usr/share/man/man1/ptardiff.1.bz2
 * Removing dead symlink /tmp/testroot/usr/bin/ptargrep
 * Removing dead symlink /tmp/testroot/usr/share/man/man1/ptargrep.1.bz2

Based on this, I suspect that the issue that you are reporting may be a bug in alternatives.eclass. My version of alternatives.eclass appears to be the latest, and was last modified 2011/08/22:

# $Header: /var/cvsroot/gentoo-x86/eclass/alternatives.eclass,v 1.17 2011/08/22 04:46:31 vapier Exp $

If you can reproduce the problem with PORT_LOGDIR set, then maybe it will give us a clue what is going wrong with the eclass.
Comment 4 Roman Žilka 2013-03-08 16:57:29 UTC
The dead symlink warnings are OK, I believe. That's not a bug. At least not the bug.

I have PORTAGE_COMPRESS="" at all times. My, I swear I saw the bug happen just with the switch of PORTAGE_B(UN)ZIP2_COMMAND. OK, here's the correct way to make the real bug happen:

1. Do not set PORTAGE_B(UN)ZIP2_COMMAND and PORTAGE_COMPRESS in make.conf
2. ROOT="/tmp/temp" emerge -O perl
3. Set PORTAGE_B(UN)ZIP2_COMMAND="" and PORTAGE_COMPRESS="" in make.conf (PORTAGE_COMPRESS itself being enough, if you're right, like you probably are, but I haven't tested that)
4. ROOT="/tmp/temp" emerge -vC perl; the output (of the postrm phase) includes:
 * Removing dead symlink /tmp/temp/usr/bin/ptar
 * Unable to establish /tmp/temp/usr/share/man/man1/ptar.1 symlink
 * Removing dead symlink /tmp/temp/usr/bin/ptardiff
 * Unable to establish /tmp/temp/usr/share/man/man1/ptardiff.1 symlink
 * Removing dead symlink /tmp/temp/usr/bin/shasum
 * Unable to establish /tmp/temp/usr/share/man/man1/shasum.1 symlink
 * Removing dead symlink /tmp/temp/usr/bin/cpan
 * Unable to establish /tmp/temp/usr/share/man/man1/cpan.1 symlink
 (...)
5. Find the dead - unremoved - symlinks to .bz2 versions in /tmp/temp/usr/share/man/man1.

FWIW, I have the same alternatives.eclass as you do.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-17 23:49:54 UTC
I've changed compression a few times and not had this issue, fwiw.