emerge =app-editors/vim-7.2 fails at the install stage (i.e. compile is OK), on the line "Updating documentation tags in /usr/share/vim/vim72". Same thing happens with 7.0.235 and 7.1.123. vim 7.0.17 appears to be installed, but unable to remove. Reproducible: Always Steps to Reproduce: 1.emerge -auv app-editors/vim 2. 3. Actual Results: Install hangs. CPU cycling at 100%: >>> Install vim-7.2 into /var/tmp/portage/app-editors/vim-7.2/image/ category app-editors >>> Completed installing vim-7.2 into /var/tmp/portage/app-editors/vim-7.2/image/ strip: i686-pc-linux-gnu-strip --strip-unneeded -R .comment usr/bin/vim >>> Installing app-editors/vim-7.2 * checking 4 files for package collisions --- /usr/ --- /usr/bin/ >>> /usr/bin/vim >>> /usr/bin/rvim -> vim >>> /usr/bin/rview -> vim >>> /usr/bin/vimdiff -> vim >>> Safely unmerging already-installed instance... No package files given... Grabbing a set. --- replaced sym /usr/bin/vimdiff --- replaced obj /usr/bin/vim --- !found sym /usr/bin/view --- replaced sym /usr/bin/rvim --- replaced sym /usr/bin/rview --- !found sym /usr/bin/ex --- replaced dir /usr/bin --- replaced dir /usr * Updating documentation tags in /usr/share/vim/vim72 Expected Results: Successful install 7.0.17 appears installed. gvim-7.2 is also installed and working mediacentre ~ # eix app-editors/vim [U] app-editors/vim Available versions: 7.0.235 7.1.123 7.2 ~7.2.021 {acl bash-completion cscope gpm minimal nls perl python ruby vim-pager vim-with-x} Installed versions: 7.0.17(17:34:43 28/04/07)(gpm nls perl python -acl -bash-completion -cscope -minimal -mzscheme -ruby -vim-pager -vim-with-x) Homepage: http://www.vim.org/ Description: Vim, an improved vi-style text editor [I] app-editors/vim-core Available versions: 7.0.235 7.1.123 7.2 ~7.2.021 {acl bash-completion livecd nls} Installed versions: 7.2(03:47:59 30/01/09)(nls -acl -bash-completion -livecd) Homepage: http://www.vim.org/ Description: vim and gvim shared files Found 2 matches. Results of emerge --info mediacentre ~ # emerge --info Portage 2.1.6.4 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.20-gentoo-r8 i686) ================================================================= System uname: Linux-2.6.20-gentoo-r8-i686-AMD_Athlon-tm-with-glibc2.0 Timestamp of tree: Thu, 29 Jan 2009 11:45:01 +0000 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.4 [enabled] app-shells/bash: 3.2_p39 dev-java/java-config: 2.1.6-r1 dev-lang/python: 2.5.2-r7 dev-python/pycrypto: 2.0.1-r6 dev-util/ccache: 2.4-r7 dev-util/cmake: 2.4.6-r1 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distcc distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://www.gigaload.org/gentoo.org/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/" LANG="en_GB.utf8" LDFLAGS="-Wl,-O1" LINGUAS="en_GB" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="3dfx 3dnowex X acpi alsa bash-completion berkdb bluetooth bonobo branding bzip2 cairo cdr cli cracklib crypt cups dbus directfb divx4linux doc dri dvd dvdr dvdread eds emboss encode esd evo fam fame fbcon firefox font-server fortran gcj gdbm gif gphoto2 gpm gstreamer gtk hal iconv isdnlog java jpeg libnotify lzo mad matrox midi mikmod mmx mmx2 mng mozilla mp3 mpeg mplayer mudflap mysql ncurses nls nptl nptlonly ntfs ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3 qt3support qt4 quicktime quotes readline reflection reiserfs rtc scanner sdl session spell spl sql sse ssl startup-notification svg sysfs tcpd threads tiff truetype unicode usb userlocales vim-syntax vorbis win32codecs wmf x86 xanim xml xorg xulrunner xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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="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 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" CAMERAS="sony_dscf55" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" USERLAND="GNU" VIDEO_CARDS="vesa fbdev nvidia" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS During the hang, pstree shows: bash───su───bash───emerge───ebuild.sh───ebuild.sh───ebuild.sh
Switched on PORTAGE_DEBUG. This is where it is getting stuck: ++ result_idx=205380 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=205381 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=205382 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=205383 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=205384 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=205385 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=205386 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=205387 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=205388 ++ [[ -n 7.0.109 ]] etc. I am unable to update my system as so many ebuild depend on vim. Any help out there?
These messages appear to come from versionator.eclass
emerge --debug shows this just prior to the infinite loop: --- replaced dir /etc/vim --- replaced dir /etc + ebuild_phase_with_hooks pkg_postrm + local x phase_name=pkg_postrm + for x in '{pre_,,post_}${phase_name}' + ebuild_phase pre_pkg_postrm ++ type -t pre_pkg_postrm + '[' '' == function ']' + for x in '{pre_,,post_}${phase_name}' + ebuild_phase pkg_postrm ++ type -t pkg_postrm + '[' function == function ']' + qa_call pkg_postrm ++ shopt + local 'shopts=cdable_vars off cdspell off checkhash off checkwinsize off cmdhist on dotglob off execfail off expand_aliases on extdebug on extglob off extquote on failglob off force_fignore on gnu_errfmt off histappend off histreedit off histverify off hostcomplete on huponexit off interactive_comments on lithist off login_shell off mailwarn off no_empty_cmd_completion off nocaseglob off nocasematch off nullglob off progcomp on promptvars on restricted_shell off shift_verbose off sourcepath on xpg_echo off' 'OLDIFS= ' + local retval + pkg_postrm + vim_pkg_postrm + update_vim_helptags + local vimfiles vim d s + vimfiles=//usr/share/vim/vimfiles + [[ vim-core != vim-core ]] + [[ -z '' ]] + for d in '"${ROOT}"/usr/share/vim/vim[0-9]*' + [[ -d //usr/share/vim/vim72/doc ]] + find //usr/share/vim/vim72/doc -name '*.txt' -type l + read s ++ readlink //usr/share/vim/vim72/doc/imaps.txt + [[ //usr/share/vim/vimfiles/doc/imaps.txt = //usr/share/vim/vimfiles/* ]] + rm -f //usr/share/vim/vim72/doc/imaps.txt + read s ++ readlink //usr/share/vim/vim72/doc/gentoo-syntax.txt + [[ //usr/share/vim/vimfiles/doc/gentoo-syntax.txt = //usr/share/vim/vimfiles/* ]] + rm -f //usr/share/vim/vim72/doc/gentoo-syntax.txt + read s ++ readlink //usr/share/vim/vim72/doc/latex-suite-quickstart.txt + [[ //usr/share/vim/vimfiles/doc/latex-suite-quickstart.txt = //usr/share/vim/vimfiles/* ]] + rm -f //usr/share/vim/vim72/doc/latex-suite-quickstart.txt + read s ++ readlink //usr/share/vim/vim72/doc/latex-suite.txt + [[ //usr/share/vim/vimfiles/doc/latex-suite.txt = //usr/share/vim/vimfiles/* ]] + rm -f //usr/share/vim/vim72/doc/latex-suite.txt + read s ++ readlink //usr/share/vim/vim72/doc/latexhelp.txt + [[ //usr/share/vim/vimfiles/doc/latexhelp.txt = //usr/share/vim/vimfiles/* ]] + rm -f //usr/share/vim/vim72/doc/latexhelp.txt + read s + [[ -f //usr/share/vim/vim72/doc/tags ]] ++ find //usr/share/vim/vim72 ++ wc -l ++ tr -d ' ' + [[ 1482 = 3 ]] + [[ -d //usr/share/vim/vimfiles/doc ]] + ln -s //usr/share/vim/vimfiles/doc/gentoo-syntax.txt //usr/share/vim/vimfiles/doc/imaps.txt //usr/share/vim/vimfiles/doc/latex-suite-quickstart.txt //usr/share/vim/vimfiles/doc/latex-suite.txt //usr/share/vim/vimfiles/doc/latexhelp.txt //usr/share/vim/vim72/doc + [[ -n '' ]] + update_vim_symlinks + local f syms + version_is_at_least 7.0.109 + local want_s=7.0.109 have_s=7.0.17 r + version_compare 7.0.109 7.0.17 + local ver_a=7.0.109 ver_b=7.0.17 parts_a parts_b cur_idx_a=0 cur_idx_b=0 + parts_a=($(get_all_version_components "${ver_a}" )) ++ get_all_version_components 7.0.109 ++ local ver_str=7.0.109 result result_idx=0 ++ result=() ++ [[ '' == \7\.\0\.\1\0\9 ]] ++ export VERSIONATOR_CACHE_VER_STR=7.0.109 ++ VERSIONATOR_CACHE_VER_STR=7.0.109 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=1 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=2 ++ [[ -n 7.0.109 ]] ++ case "${ver_str:0:1}" in ++ result[$result_idx]=7 ++ ver_str=7.0.109 ++ result_idx=3
CCing base-system since this does look to me like a versionator.eclass issue. Though I can't imagine what causes it; the eclass is pretty straightforward. Can you please try the following in your shell and report back your result: test="7.0.106" echo "${test##+([[:digit:]])}"
Somehow extglob is not being set and this causes versionator to get stuck in this part of the case statemnt: # number: parse whilst we have a number [[:digit:]]) result[$result_idx]="${ver_str%%[^[:digit:]]*}" ver_str="${ver_str##+([[:digit:]])}" result_idx=$(($result_idx + 1)) ;; Could you please post the "environment" file which should reside in /var/tmp/portage/app-editors/vim-$VERSION/temp/
[4699:~]$ test="7.0.106" [4700:~]$ echo "${test##+([[:digit:]])}" .0.106 [4701:~]$ bash --version GNU bash, version 3.2.39(1)-release (i686-pc-linux-gnu) Copyright (C) 2007 Free Software Foundation, Inc. [4702:~]$ Any hints as to how to nuke vim-7.0.17 would be appreciated, as I am completely stuck upgrading anything that has a vim dependency at the moment...
Created attachment 183768 [details] Portage environment file for vim-7.2 Environment file for Peter
As pointed out by zlin on IRC, the problem seems to be that __versionator_shopt_toggle doesn't get called from get_all_version_components. At all. The debug output has no mention of that function even though the environment contains the call to it. This is the output from my box: [...] ++ get_all_version_components 7.0.109 ++ __versionator_shopt_toggle on ++ VERSIONATOR_RECURSION=2 ++ case "$1" in ++ [[ 2 -lt 1 ]] ++ VERSIONATOR_RECURSION=3 ++ return 0 ++ local ver_str=7.0.109 result result_idx=0 [...] The same bit from Paul's box: [...] ++ get_all_version_components 7.0.109 ++ local ver_str=7.0.109 result result_idx=0 [...] Anyone have any ideas to what could cause that bit to get ignored?
Paul's environment even sources well for me: ( source attachment.cgi\?id\=183768; get_all_version_components 7.0.109 ) 7 . 0 . 109 bash --version GNU bash, version 3.2.39(1)-release (x86_64-pc-linux-gnu) (on an otherwise ~amd64 system) Paul, have you tried rebuilding bash?
Starting rebuild of bash now...
Problem still exists after emerge -av --deep bash
As a normal user the test works, but as root it won't! $ ver_str=7.0.109 $ echo "${ver_str##+([[:digit:]])}" .0.109 $ test="7.0.106" $ echo "${test##+([[:digit:]])}" .0.106 # ver_str=7.0.109 # echo "${ver_str##+([[:digit:]])}" 7.0.109 # test="7.0.106" # echo "${test##+([[:digit:]])}" 7.0.106 I fixed versionator.eclass (##-operator using [[::digit:]] doesn't work for root), but that did help. I suspect the removal of the old version being run with the old environment? Sourced from /var/db/pkg/app-editors/vim-core-7.0.17/environment.bz2, where the old eclass is stored. Is there any way to override any of it?
(In reply to comment #12) > As a normal user the test works, but as root it won't! That's probably just extglob not being set by default in root's environment. The relevant one-liner to test would be: ( shopt -s extglob; test="7.0.106"; echo "${test##+([[:digit:]])}" ) But as I said, that probably just works. I believe you found the problem below. > I fixed versionator.eclass (##-operator using [[::digit:]] doesn't work for > root), but that did help. Please emerge --sync to revert that change. We don't want any unexpected behavior from that eclass. This has been hard enough to debug as-is. > I suspect the removal of the old version being run with the old environment? > Sourced from /var/db/pkg/app-editors/vim-core-7.0.17/environment.bz2, where the > old eclass is stored. > Is there any way to override any of it? I believe you're correct. Simply deleting environment.bz2 from the db should theoretically make portage source the ebuild in the db using the updated eclass from the portage tree.
Peter - Is the suggestion to do delete /var/db/pkg/app-editors/vim-7.0.17/environment.bz2 ?
(In reply to comment #14) > Peter - Is the suggestion to do delete > /var/db/pkg/app-editors/vim-7.0.17/environment.bz2 ? For each package that fails in this manner, yes.
Fantastic, that's fixed it for me. Thanks guys.
Great to hear!
did we determine that the issue was ? or are we simply working around it ?
(In reply to comment #18) > did we determine that the issue was ? or are we simply working around it ? The issue was that he had a version of vim that was merged before this commit: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/versionator.eclass?r1=1.11&r2=1.12 While at the time of this merging, he had a version of portage that was new enough to save environment to environment.bz2. Portage was changed to override shopt -s extglob if set in global scope, so using the environment.bz2 failed because versionator.eclass was trying to use extglobbing when it was not set. IOW, this happened because portage made a change that was incompatible with code in the tree. The code in the tree was changed beforehand, but because portage was saving environment in the package db, it will still encounter this code but handle it unsatisfactorily. So this change should really have been a EAPI-bump, perhaps even of the kind that Glep 55 is supposed to solve, because the change was happening in global scope in versionator.eclass. So, we know what the problem is, but it can't be fixed retroactively. SO we are working around it.
versionator.eclass was always broken. portage changed behavior to detect and fix that. no, it didnt need an EAPI bump (not that EAPI existed then anyways). i was making sure it wasnt actually a bug in bash that we were ignoring.
> I believe you're correct. Simply deleting environment.bz2 from the db should theoretically make portage source the ebuild in the db using the updated eclass from the portage tree. I can verify this fixed my problem with vim-core, vim and gvim.