Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 635828 - Notice "Updating ebuild cache" when running sync with --quiet
Summary: Notice "Updating ebuild cache" when running sync with --quiet
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:
: 638902 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-10-29 19:13 UTC by Dirkjan Ochtman (RETIRED)
Modified: 2017-11-27 08:01 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 Dirkjan Ochtman (RETIRED) gentoo-dev 2017-10-29 19:13:15 UTC
I have a crontab running `emerge -q --sync`. Since a few weeks, this results in an email containing this line:

q: Updating ebuild cache in /usr/portage ...

It seems like this should be silenced when running with -q/--quiet.
Comment 1 Zac Medico gentoo-dev 2017-10-29 21:03:40 UTC
Does /etc/portage/postsync.d/q-reinitialize container ${PORTAGE_QUIET:+-q} like it does here:

https://gitweb.gentoo.org/repo/gentoo.git/tree/app-portage/portage-utils/files/q-reinitialize

If you run this command:

   /usr/bin/q -r -q

Is it quiet?
Comment 2 Dirkjan Ochtman (RETIRED) gentoo-dev 2017-10-30 09:05:51 UTC
I have a /etc/portage/repo.postsync.d/q-reinit, which contains this line:

q ${PORTAGE_QUIET:+-q} --reinitialize="${repository_path}"

When I run /usr/bin/q -r -q, it does not print anything to stdout or stderr.
Comment 3 Zac Medico gentoo-dev 2017-10-30 18:57:55 UTC
Apparently, having the environment variable PORTAGE_QUIET=1 exported causes it to *not* be quiet regardless of the -q flag:

# PORTAGE_QUIET=1 /usr/bin/q -r -q
q: Updating ebuild cache in /usr/portage ...
Comment 4 Dirkjan Ochtman (RETIRED) gentoo-dev 2017-10-30 19:13:37 UTC
Wow, that seems wrong!
Comment 5 Fabian Groffen gentoo-dev 2017-10-31 07:21:43 UTC
yeah, the warn macro in libq/libq.h doesn't seem to do "if (!quiet)", and "Updating ebuild cache in" is a warning message (as is its result timing).
Comment 6 Dirkjan Ochtman (RETIRED) gentoo-dev 2017-10-31 08:50:50 UTC
I don't really understand why it's a warning -- it doesn't seem actionable at all?
Comment 7 Dirkjan Ochtman (RETIRED) gentoo-dev 2017-11-12 13:13:49 UTC
It seems like this hunk b1558916d2ca76d7cd4c81248d5b220aaa46a728 from doesn't really fit in with the stated goal (do not suppress fatal error messages).

@@ -985,9 +985,8 @@ initialize_flat(const char *overlay, int cache_type, bool force)
 				return cache_file;
 	}
 
-	if (!quiet)
-		warn("Updating ebuild %scache in %s ... ",
-			cache_type == CACHE_EBUILD ? "" : "meta", overlay);
+	warn("Updating ebuild %scache in %s ... ",
+		cache_type == CACHE_EBUILD ? "" : "meta", overlay);
 
 	count = frac = secs = 0;
 
vapier, mind if I revert that change?
Comment 8 Zac Medico gentoo-dev 2017-11-26 21:08:04 UTC
*** Bug 638902 has been marked as a duplicate of this bug. ***
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-11-27 07:45:58 UTC
(In reply to Dirkjan Ochtman from comment #7)
> It seems like this hunk b1558916d2ca76d7cd4c81248d5b220aaa46a728 from
> doesn't really fit in with the stated goal (do not suppress fatal error
> messages).
> 
> @@ -985,9 +985,8 @@ initialize_flat(const char *overlay, int cache_type,
> bool force)
>  				return cache_file;
>  	}
>  
> -	if (!quiet)
> -		warn("Updating ebuild %scache in %s ... ",
> -			cache_type == CACHE_EBUILD ? "" : "meta", overlay);
> +	warn("Updating ebuild %scache in %s ... ",
> +		cache_type == CACHE_EBUILD ? "" : "meta", overlay);
>  
>  	count = frac = secs = 0;
>  
> vapier, mind if I revert that change?

You need to watch the rest of the commit, because where warn prints to changed, and is sometimes /dev/null.
https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b1558916d2ca76d7cd4c81248d5b220aaa46a728
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-11-27 07:54:33 UTC
Found the bug in portage-utils, I'll push a patch to the tree, not going to spin my own 0.65 release.
Comment 11 Larry the Git Cow gentoo-dev 2017-11-27 08:01:01 UTC
The bug has been closed via the following commit(s):

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

commit 111ea5abbac500854cd22c00dd09a9557bf001b0
Author:     Robin H. Johnson <robbat2@gentoo.org>
AuthorDate: 2017-11-27 07:59:42 +0000
Commit:     Robin H. Johnson <robbat2@gentoo.org>
CommitDate: 2017-11-27 07:59:46 +0000

    app-portage/portage-utils: fix quietness.
    
    Make PORTAGE_QUIET=1 actually be quiet properly.
    
    Thanks to Zac for the suggestion of checking how PORTAGE_QUIET was being
    handled.
    
    Thanks: Zac Medico <zmedico@gentoo.org>
    Closes: https://bugs.gentoo.org/635828
    Package-Manager: Portage-2.3.16, Repoman-2.3.6

 app-portage/portage-utils/Manifest                 |  6 +--
 .../files/portage-utils-0.64-fix-quiet.patch       | 51 ++++++++++++++++++++++
 .../portage-utils/portage-utils-0.64-r1.ebuild     | 40 +++++++++++++++++
 3 files changed, 94 insertions(+), 3 deletions(-)