Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662644 - sys-apps/portage: glsa-check unexpected behavior when running in post update
Summary: sys-apps/portage: glsa-check unexpected behavior when running in post update
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
Depends on:
Reported: 2018-08-02 14:21 UTC by OzTiram
Modified: 2019-08-19 05:46 UTC (History)
1 user (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description OzTiram 2018-08-02 14:21:37 UTC
For a while now I was running glsa-check -t all as a post update.
I was assuming that `glsa-check -t all` was going to report successfully if my machine has updated packages.


I turns out that running `glsa-check` -t all` does not yield the same result when running manually and when running as a post script.

Here is my case:

Running in my shell:
# glsa-check -t all 2>&1
This system is affected by the following GLSAs:

In a post update script which looks like this:

# cat /etc/portage/repo.postsync.d/glsa

# The URI to which the repository was synced.
# The path to the repository.

# Portage assumes that a hook succeeded if it exits with 0 code. If no
# explicit exit is done, the exit code is the exit code of last spawned
# command. Since our script is a bit more complex, we want to control
# the exit code explicitly.

if [[ x"${repository_name}" == x"gentoo" ]]; then
	/usr/bin/glsa-check -t all 2>&1

exit 0

called from the shell directly

# /etc/portage/repo.postsync.d/glsa gentoo
This system is affected by the following GLSAs:


So, now I expected the same result after `emerge --sync`:

# emerge --sync
>>> Syncing repository 'gentoo' into '/usr/portage'...
 * Using keys from /usr/share/openpgp-keys/gentoo-release.asc
 * Refreshing keys from keyserver ...                                                                                                                                                  [ ok ]
>>> Starting rsync with rsync://[2a00:1828:a00d:ffff::6]/gentoo-portage...
>>> Checking server timestamp ...
Welcome to /

Server Address :, 2a00:1828:a00d:ffff::6
Contact Name   :
Hardware       : 16 x Intel(R) Xeon(R) CPU E5530 @ 2.40GHz, 24160MB RAM
Sponsor        : Manitu GmbH, St. Wendel, Germany

Please note: common gentoo-netiquette says you should not sync more
than once a day.  Users who abuse the rotation
may be added to a temporary ban list.

MOTD autogenerated by update-rsync-motd on Tue Jan  2 08:34:00 UTC 2018

receiving incremental file list

... snipped ...

Total bytes sent: 32.41K
Total bytes received: 4.11M

sent 32.41K bytes  received 4.11M bytes  919.90K bytes/sec
total size is 215.77M  speedup is 52.12
 * Manifest timestamp: 2018-08-02 13:38:39 UTC
 * Valid OpenPGP signature found:
 * - primary key: DCD05B71EAB94199527F44ACDB6B8C1F96D8BF6D
 * - subkey: E1D6ABB63BFCFB4BA02FDF1CEC590EEAC9189250
 * - timestamp: 2018-08-02 13:38:39 UTC
 * Verifying /usr/portage ...                                                                                                                                                          [ ok ]
=== Sync completed for gentoo
This system is not affected by any of the listed GLSAs

Action: sync for repo: gentoo, returned code = 0

Confused and baffled, I am now resorting to not using glsa-check like this.

So now I have to type:

emerge --sync && glsa-check -t all

Which does a better job, even though it is not supposed too...
Comment 1 Zac Medico gentoo-dev 2019-08-19 05:46:10 UTC
glsa-check is included with >=sys-apps/portage-2.3.72 (bug 463952).