I use to run emerge sync on my servers in a simple nightly cron script: it launchs emerge sync and sends me an email in case it gets an exit status other than 0 (could happen because it can't connect any mirrors, for example). Today it happened that I manually launched emerge sync on a server and I got a message saying my profile has been deprecated. Then I tryed to echo $? but the result was surprisingly 0! So if I didn't manually run emerge sync I would never know my manual intervention was required to change profile. Wouldn't be better to have a not-0 exit status on any kind of "strage warning" emerge sync outputs? Here is the output I got: [...cutted...] deleting CVSROOT/commitinfo deleting CVSROOT/checkoutlist deleting directory CVSROOT deleting .keep Number of files: 99161 Number of files transferred: 1473 Total file size: 76908623 bytes Total transferred file size: 2595837 bytes Literal data: 2595837 bytes Matched data: 0 bytes File list size: 2232311 Total bytes written: 29641 Total bytes read: 4894978 wrote 29641 bytes read 4894978 bytes 99487.25 bytes/sec total size is 76908623 speedup is 15.62 >>> Updating Portage cache... ...done! !!! Your current profile is deprecated and not supported anymore. !!! Please upgrade to the following profile if possible: default-linux/x86/2004.0 To upgrade do the following steps: # emerge -n '>=sys-apps/portage-2.0.51' # cd /etc/ # rm make.profile # ln -s ../usr/portage/profiles/default-linux/x86/2004.0 make.profile Performing Global Updates: /usr/portage/profiles/updates/4Q-2004 (Could take a couple of minutes if you have a lot of binary packages.) .='update pass' *='binary update' @='/var/db move' s='/var/db SLOT move' S='binary SLOT move' p='update /etc/portage/package.*' ........................... Reproducible: Always Steps to Reproduce: emerge sync having a deprecated profile Actual Results: 0 exit status Expected Results: 1 (or something > 0) exit status
Created attachment 43502 [details, diff] patch for adding sys.exit(1) on deprecated profile this should do it (i hope)
The problem is that then you won't be able to update portage first (which pretty much is a requirement for cascading profiles).
yes but for the future this would be nice :-)
Not possible ( even now ) because you need to emerge a new version of portage. Even setting your profile to the obsolete ones ( that don't have cascading ) you will still hit this. Emerge cannot and should not exit here.
(In reply to comment #4) > Not possible ( even now ) because you need to emerge a new version of portage. > Even setting your profile to the obsolete ones ( that don't have cascading ) > you will still hit this. Emerge cannot and should not exit here. Maybe you got me wrong: I didn't want "emerge sync" to immediately sys.exit(1) whenever it finds a deprecated profile. I want "emerge sync" to do all its job until the end, exactly like it does in its actual version. I just would like "emerge sync" to finish with a sys.exit(1) (when if finished ALL of its job) if during its execution it found a deprecated profile. What I aim to is to warn the administrator (by email) if the profile is deprecated and needs to be updated: as it is now, I need to grep all of the output of "emerge sync" looking for "current profile is deprecated". If "emerge sync" would finish its job with exit status 1, I would just check the exit status and my "emailing script" would be some way more "elegant" and safe too: what would happen if in future (due to a portage upgrade) the "current profile is deprecated" warning would change in "please upgrade your profile"? My script would wok no more!
(In reply to comment #5) > (In reply to comment #4) > Maybe you got me wrong: I didn't want "emerge sync" to immediately sys.exit(1) > whenever it finds a deprecated profile. I want "emerge sync" to do all its job > until the end, exactly like it does in its actual version. I just would like > "emerge sync" to finish with a sys.exit(1) (when if finished ALL of its job) if > during its execution it found a deprecated profile. Won't happen. This totally nukes the usefulness of exit codes for any users who are on a deprecated profile intentionally; folks will be just as pissed if their automated scripts suddenly start indicating failure due to this suggestion. > What I aim to is to warn the administrator (by email) if the profile is > deprecated and needs to be updated: as it is now, I need to grep all of the > output of "emerge sync" looking for "current profile is deprecated". If "emerge if ! emerge --sync; then do somethign with the exit_code else if emerge --help 1> /dev/null 2>&1 | grep -i 'deprecated profile'; then do something with the match; fi Meanwhile... bugs resolution being invalid/wontfix doesn't strictly mean the idea/request is dead- just means in how we mark/track things, we are labelling it thus. We still see the email when comments are made, so no need to be flipping resolution there (at least for a feature request).
Actually it's sufficient to just check if /etc/make.profile/deprecated exists.