Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 520378 - sys-apps/portage-2.2.12 prints incorrect fetch log location: tail -f /var/log/emerge-fetch.log
Summary: sys-apps/portage-2.2.12 prints incorrect fetch log location: tail -f /var/log...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 785484
  Show dependency tree
 
Reported: 2014-08-21 04:04 UTC by Douglas J Hunley
Modified: 2021-07-05 01:37 UTC (History)
1 user (show)

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 Douglas J Hunley 2014-08-21 04:04:44 UTC
It would appear that the default location for the emerge-fetch.log is hard-coded in portage in at least one location and doesn't reflect your EMERGE_LOG_DIR setting

Reproducible: Always

Steps to Reproduce:
Define EMERGE_LOG_DIR in /etc/portage/make.conf:
doug@hunley-mbp ~ $ grep EMERGE_LOG_DIR /etc/portage/make.conf
EMERGE_LOG_DIR=/var/log/portage

Run a @world update, see that the emerge-fetch.log respects EMERGE_LOG_DIR:
doug@hunley-mbp ~ $ ls -ld /var/log/portage/emerge-fetch.log 
-rw-rw---- 1 portage portage 99603 Aug 21 00:00 /var/log/portage/emerge-fetch.log
doug@hunley-mbp ~ $

Watch the emerge output and see that it tells you the wrong location for the fetch log:
>>> Emerging (15 of 212) kde-base/kdelibs-4.14.0::gentoo
 * Fetching files in the background. To view fetch progress, run
 * `tail -f /var/log/emerge-fetch.log` in another terminal.

It appears that the /default/ location is hard-coded somewhere
Actual Results:  
Define EMERGE_LOG_DIR in /etc/portage/make.conf:
doug@hunley-mbp ~ $ grep EMERGE_LOG_DIR /etc/portage/make.conf
EMERGE_LOG_DIR=/var/log/portage

Run a @world update, see that the emerge-fetch.log respects EMERGE_LOG_DIR:
doug@hunley-mbp ~ $ ls -ld /var/log/portage/emerge-fetch.log 
-rw-rw---- 1 portage portage 99603 Aug 21 00:00 /var/log/portage/emerge-fetch.log
doug@hunley-mbp ~ $

Watch the emerge output and see that it tells you the wrong location for the fetch log:
>>> Emerging (15 of 212) kde-base/kdelibs-4.14.0::gentoo
 * Fetching files in the background. To view fetch progress, run
 * `tail -f /var/log/emerge-fetch.log` in another terminal.

It appears that the /default/ location is hard-coded somewhere

Expected Results:  
>>> Emerging (15 of 212) kde-base/kdelibs-4.14.0::gentoo
 * Fetching files in the background. To view fetch progress, run
 * `tail -f /var/log/portage/emerge-fetch.log` in another terminal.


doug@hunley-mbp ~ $ emerge --info
Portage 2.2.12 (python 3.3.5-final-0, default/linux/amd64/13.0/desktop/kde/systemd, gcc-4.8.3, glibc-2.19-r1, 3.16.1-gentoo x86_64)
=================================================================
System uname: Linux-3.16.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-3720QM_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:     8181252 total,    629912 free
KiB Swap:    4194300 total,   3703456 free
Timestamp of tree: Thu, 21 Aug 2014 02:15:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p47
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
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="-Os -pipe -march=native -Wabi"
DISTDIR="/var/cache/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg cgroup clean-logs config-protect-if-modified distlocks downgrade-backup ebuild-locks fail-clean fixlafiles multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms split-elog strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common -Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,noexecstack"
MAKEOPTS="--jobs=16 --load-average=8 --quiet"
PKGDIR="/var/packages"
PORTAGE_COMPRESS=""
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--delete-after"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage"
PORTDIR_OVERLAY=""
USE="X a52 aac acl acpi alsa amd64 bash-completion berkdb branding bzip2 cairo cdda cdr cjk cli cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm gtk iconv icu ipv6 jpeg kde kipi lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qt3support qt4 readline sdl semantic-desktop session spell sse sse2 ssl startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vdpau vim-syntax vorbis wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="hda-intel" 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 author" 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 ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="nouveau" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, SYNC, USE_PYTHON

doug@hunley-mbp ~ $
Comment 1 Zac Medico gentoo-dev 2014-08-23 07:42:55 UTC
It's hardcoded in pym/_emerge/Binpkg.py and pym/_emerge/EbuildBuild.py. The validated EMERGE_LOG_DIR setting is stored in the _emerge.emergelog._emerge_log_dir variable.
Comment 2 James Stevenson 2021-05-22 13:22:58 UTC
The hardcoding issue appears to be resolved. EMERGE_LOG_DIR is parsed in lib/_emerge/actions.py if it exists and set to a variable, emergelog._emerge_log_dir. The output referring to logs use that variable now.

That said, the EMERGE_LOG_DIR setting is not completely integrated with the code. I've found at least one issue where the solution to another bug was not respecting it and continued writing out to the default log file https://bugs.gentoo.org/285614.
Comment 3 Larry the Git Cow gentoo-dev 2021-05-23 19:57:22 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=f8ab6cb0acf5074f56bcb5b3b58aa7e3e2f0711e

commit f8ab6cb0acf5074f56bcb5b3b58aa7e3e2f0711e
Author:     James Stevenson <james.al.stevenson@gmail.com>
AuthorDate: 2021-05-23 17:25:36 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-05-23 19:54:51 +0000

    emerge --fetch and regenworld: Respect EMERGE_LOG_DIR setting
    
    Closes: https://github.com/gentoo/portage/pull/720
    Bug: https://bugs.gentoo.org/520378
    Signed-off-by: James Stevenson <james.al.stevenson@gmail.com>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/regenworld         |  7 ++++++-
 lib/_emerge/actions.py | 27 +++++++++++++++++++++------
 2 files changed, 27 insertions(+), 7 deletions(-)
Comment 4 Larry the Git Cow gentoo-dev 2021-05-24 09:05:19 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cba21902d9a8d1ac07d2ff5b0d932e71fc1fac67

commit cba21902d9a8d1ac07d2ff5b0d932e71fc1fac67
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-05-24 07:47:11 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-05-24 09:05:08 +0000

    sys-apps/portage: Bump to version 3.0.19
    
     #520378: allow emerge --fetchonly to log to emerge-fetch.log
     #698244: portage(5) document user patch / eapply_user
     #781854: Suggest PORTAGE_LOG_FILTER_FILE_CMD cat fallback
     #782724: sort emerge --unmerge order for determinism
     #783957: lazily evaluate cnf_* variables in tests
     #784566: make emerge insensitive to relative order of optional
                      and positional arguments
     #787545: emerge CTRL C may be ignored when running pkg_pretend
     #787563: ebuild-ipc could handle KeyboardInterrupt
     #788967: emerge --jobs= triggers TypeError
    
    Bug: https://bugs.gentoo.org/785484
    Bug: https://bugs.gentoo.org/788967
    Bug: https://bugs.gentoo.org/787563
    Bug: https://bugs.gentoo.org/787545
    Bug: https://bugs.gentoo.org/784566
    Bug: https://bugs.gentoo.org/783957
    Bug: https://bugs.gentoo.org/782724
    Bug: https://bugs.gentoo.org/781854
    Bug: https://bugs.gentoo.org/698244
    Bug: https://bugs.gentoo.org/520378
    Package-Manager: Portage-3.0.18, Repoman-3.0.3
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.19.ebuild | 266 +++++++++++++++++++++++++++++++++
 2 files changed, 267 insertions(+)