Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 567478 - sys-apps/portage-2.2.26: Returns exit code 0 when sync aborted
Summary: sys-apps/portage-2.2.26: Returns exit code 0 when sync aborted
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 240187 601054 611328
  Show dependency tree
 
Reported: 2015-12-03 16:34 UTC by Paul Varner (RETIRED)
Modified: 2017-05-20 17:56 UTC (History)
2 users (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 Paul Varner (RETIRED) gentoo-dev 2015-12-03 16:34:30 UTC
I sync my systems in the middle of the night via a cron script.  Part of the script is to check if the sync failed for some reason so that I can be notified in the email.  After getting suspicious due to no packages wanting to be updated, I investigated and found this:

# emerge --sync
>>> Syncing repository 'gentoo' into '/usr/portage'...
!!! /usr/portage appears to be under revision control (contains .git).
!!! Aborting rsync sync (override with "sync-rsync-vcs-ignore = true" in repos.conf).

# echo $?
0


Reproducible: Always

Steps to Reproduce:
1. emerge --sync
2. echo $?
3.
Actual Results:  
emerge --sync returns a exit code of 0

Expected Results:  
emerge --sync returns a non-zero exit code

emerge --info sys-apps/portage
Portage 2.2.26 (python 3.4.3-final-0, default/linux/amd64/13.0/no-multilib, gcc-4.9.3, glibc-2.22-r1, 3.10.63-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.10.63-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_X5650_@_2.67GHz-with-gentoo-2.2
KiB Mem:     4054004 total,   1523300 free
KiB Swap:    2097148 total,   2097148 free
Timestamp of repository gentoo: Sun, 29 Nov 2015 09:45:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10-r3::gentoo, 3.4.3-r2::gentoo, 3.5.0-r1::gentoo
dev-util/cmake:           3.4.0-r1::gentoo
dev-util/pkgconfig:       0.29::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18.3::gentoo
sys-apps/sandbox:         2.9::gentoo
sys-devel/autoconf:       2.69-r1::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.namerica.gentoo.org/gentoo-portage
    priority: -1000

local
    location: /usr/local/portage/local
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/gnupg/qualified.txt /var/bind /var/www/localhost/htdocs/roundcube/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n --dynamic-deps=n --changed-deps=y --autounmask=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://gentoo.osuosl.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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"
USE="amd64 apache2 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv mmx mmxext modules ncurses nls nptl openmp pam readline seccomp session sse sse2 ssl tcpd unicode 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" 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" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" 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" INPUT_DEVICES="evdev keyboard mouse" 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-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="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"
USE_PYTHON="2.7"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sys-apps/portage-2.2.26::gentoo was built with the following:
USE="(ipc) -build -doc -epydoc (-selinux) -xattr" LINGUAS="-ru" PYTHON_TARGETS="python2_7 python3_4 (-pypy) -python3_3 -python3_5"
Comment 1 Zac Medico gentoo-dev 2016-11-30 17:24:41 UTC
The action_sync function always returns 0 because of the options={'return-messages': False} setting here:

https://gitweb.gentoo.org/proj/portage.git/tree/pym/_emerge/actions.py?h=portage-2.3.2#n2003
Comment 2 Zac Medico gentoo-dev 2017-01-09 19:04:13 UTC
It also exits 0 when unknown repo(s) are specified:

!!! Unknown repo(s): foo
Comment 3 Alexandru Elisei 2017-01-20 15:28:22 UTC
Bug fixed by commit https://gitweb.gentoo.org/proj/portage.git/commit/?id=f143e58dd3fd80ab67121e7a62e8cf47151d3907.

Can someone please close the bug?
Comment 4 Zac Medico gentoo-dev 2017-01-20 16:57:21 UTC
(In reply to Zac Medico from comment #2)
> It also exits 0 when unknown repo(s) are specified:
> 
> !!! Unknown repo(s): foo

It still returns 0 in this case.

(In reply to Zac Medico from comment #1)
> The action_sync function always returns 0 because of the
> options={'return-messages': False} setting here:
> 
> https://gitweb.gentoo.org/proj/portage.git/tree/pym/_emerge/actions.
> py?h=portage-2.3.2#n2003

This code still needs to be fixed. It's the same area where bug 606588 occurs.
Comment 5 Zac Medico gentoo-dev 2017-02-25 01:26:55 UTC
This is fixed in the master branch:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=79103f99799c9365389290e812213c46e006c019
Comment 6 Zac Medico gentoo-dev 2017-05-20 17:56:51 UTC
Fixed in portage-2.3.5.