* [gentoo-portage-dev] !!! You have no world file.
@ 2015-10-16 13:43 Joakim Tjernlund
2015-10-16 19:38 ` Rob Wortman
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Joakim Tjernlund @ 2015-10-16 13:43 UTC (permalink / raw
To: gentoo-portage-dev@lists.gentoo.org
emerge -a --depclean
!!! You have no world file.
!!! Proceeding is likely to break your installation.
>>> Waiting 10 seconds before starting...
>>> (Control-C to abort)...
>>> Depclean in: 10 9 8 7 6 5 4 3 2 1
Would be nice this warning could be removed, I have an empty world file
and everything in a private overlay using sets to pull in wanted packages
Jocke
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] !!! You have no world file. 2015-10-16 13:43 [gentoo-portage-dev] !!! You have no world file Joakim Tjernlund @ 2015-10-16 19:38 ` Rob Wortman 2015-10-16 20:25 ` Zac Medico 2015-10-20 16:53 ` [gentoo-portage-dev] [PATCH] calc_depclean: adjust early warning messages Zac Medico 2 siblings, 0 replies; 9+ messages in thread From: Rob Wortman @ 2015-10-16 19:38 UTC (permalink / raw To: gentoo-portage-dev; +Cc: gentoo-portage-dev@gentoo.org On 2015-10-16 at 13:43:52 +0000, joakim.tjernlund@transmode.se wrote: > emerge -a --depclean > !!! You have no world file. > > Would be nice this warning could be removed, I have an empty world file > and everything in a private overlay using sets to pull in wanted packages Sure, I do the same thing. And I also have an empty world file. But I also have a world-sets file with the sets I want maintained as @world. With no world packages and no world sets, depclean should remove everything installed that isn't part of @system. -- There are problems in today's world that cannot be solved by the level of thinking that created them. -- Albert Einstein ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] !!! You have no world file. 2015-10-16 13:43 [gentoo-portage-dev] !!! You have no world file Joakim Tjernlund 2015-10-16 19:38 ` Rob Wortman @ 2015-10-16 20:25 ` Zac Medico 2015-10-20 8:52 ` Alexander Berntsen 2015-10-20 16:53 ` [gentoo-portage-dev] [PATCH] calc_depclean: adjust early warning messages Zac Medico 2 siblings, 1 reply; 9+ messages in thread From: Zac Medico @ 2015-10-16 20:25 UTC (permalink / raw To: gentoo-portage-dev On 10/16/2015 06:43 AM, Joakim Tjernlund wrote: > emerge -a --depclean > !!! You have no world file. > !!! Proceeding is likely to break your installation. >>>> Waiting 10 seconds before starting... >>>> (Control-C to abort)... >>>> Depclean in: 10 9 8 7 6 5 4 3 2 1 > > Would be nice this warning could be removed, I have an empty world file > and everything in a private overlay using sets to pull in wanted packages > > Jocke > I think we can drop this warning. It's not like people's world files just disappear unexpectedly, so the warning seems unnecessary to me. When in doubt, people should use --pretend or --ask anyway, and emerge --depclean already suggests this (except with --quiet). -- Thanks, Zac ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] !!! You have no world file. 2015-10-16 20:25 ` Zac Medico @ 2015-10-20 8:52 ` Alexander Berntsen 2015-10-20 11:20 ` Joakim Tjernlund 0 siblings, 1 reply; 9+ messages in thread From: Alexander Berntsen @ 2015-10-20 8:52 UTC (permalink / raw To: gentoo-portage-dev -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 16/10/15 22:25, Zac Medico wrote: > I think we can drop this warning. It's not like people's world > files just disappear unexpectedly, so the warning seems unnecessary > to me. When in doubt, people should use --pretend or --ask anyway, > and emerge --depclean already suggests this (except with --quiet). I'm not so sure. It's a kind reminder. Seems useful if you're SSH-ing into a system you rarely use. What about the "You have no system list" warning -- should that go too then? IMO, this is removing a simple solution to a GOTCHA for no real benefit. As is, it might be a bit too noisy/intrusive though. - -- Alexander bernalex@gentoo.org https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJWJgDTAAoJENQqWdRUGk8B+DIP/jWMRruabd/gdzoVVP3GHzas I4bIy9EpFsXZgcVlJ6nGImyYVrYLSI7USqt/D3yDPA0/K6i9ivYZt5I1qdg9TEkf XWlK4MfJ+ahkVLLxYKqTZhchVQfYUska/3Gq7p3ZsGpwlPTqWAxpebrh2JG/cpud VeOBqkFu8Nu4cxsRCquF7lMtefyrqwte83kcGxRNGfARbMA0geQemLGaeO2rlLK4 jt/0hr9Ok/t1bzxUgpoXig/OBt6cqjIue8b/V96aYB44IO06kfeFQzpEKtNqGz7M vPIxd1QuNZOuoOqQD+YpgdCiFwfHQNMFQKmtn/pt/ptqimLK9J4DaKucp+2KLjeW o6nNYjX/V4F2dGkTbKlQ9iBhQKdCic2mYn9IEsNbfNTUDG9Wo+PDO0czoEdQ37nO oYE3LXXkg+C/Ak0FDzwSqZ0zmwiQRSeq+U16G1W77oMvQILdhCRL/1dI41v7D9Ax ArJUTKdu5Y3Z8H6+GoyCHoQe3YG3wc+vmq/2KwQTyJq1rLJhY2TzKJeOV7S3yMSv vqRDUO3CR35YwEM2FudXC+Nr51sCVvNAGzd5y8pEbX6REmNu8A6qNkxXgSPVnY/A sJZtqUKpI1/tsohhKh10Ek6qNAeS9obZSmNxVgLStZlSSJsjus2QVOMrx4lbXUHL I5mQqTlxo4BFk8y/XLXk =nCuC -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] !!! You have no world file. 2015-10-20 8:52 ` Alexander Berntsen @ 2015-10-20 11:20 ` Joakim Tjernlund 2015-10-20 11:23 ` Alexander Berntsen 0 siblings, 1 reply; 9+ messages in thread From: Joakim Tjernlund @ 2015-10-20 11:20 UTC (permalink / raw To: gentoo-portage-dev@lists.gentoo.org On Tue, 2015-10-20 at 10:52 +0200, Alexander Berntsen wrote: > On 16/10/15 22:25, Zac Medico wrote: > > I think we can drop this warning. It's not like people's world > > files just disappear unexpectedly, so the warning seems unnecessary > > to me. When in doubt, people should use --pretend or --ask anyway, > > and emerge --depclean already suggests this (except with --quiet). > I'm not so sure. It's a kind reminder. Seems useful if you're SSH-ing It is not a kind reminder, it is a really scary message. > into a system you rarely use. What about the "You have no system list" > warning -- should that go too then? depends, I figured @system was mandatory so that one should stay. > > IMO, this is removing a simple solution to a GOTCHA for no real benefit. People like me should not have to see this every time one do --depclean or just users on a customized gentoo gets really scared and starts calling IT claiming there is something wrong with their gentoo. > > As is, it might be a bit too noisy/intrusive though. Yes, keep under debug flag instead? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] !!! You have no world file. 2015-10-20 11:20 ` Joakim Tjernlund @ 2015-10-20 11:23 ` Alexander Berntsen 0 siblings, 0 replies; 9+ messages in thread From: Alexander Berntsen @ 2015-10-20 11:23 UTC (permalink / raw To: gentoo-portage-dev -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 20/10/15 13:20, Joakim Tjernlund wrote: > It is not a kind reminder, it is a really scary message. Sorry, I merely meant the "You have no world file." bit. The rest of it is an overkill deluxe. We should just output the "no world file" part as an NB. - -- Alexander bernalex@gentoo.org https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJWJiQbAAoJENQqWdRUGk8BIEwQAOkTQ6ULP52UXC50d4Dah/aM nAYJ0SIiu/9RFGJlPRejesX7CweC165K+6onlJQauheHEngedkMzlLODn4bnLVmi buCWQ9wYgrrCpMe9U9wWRmw+LT+5Qgw/ucYf97adcY0XDvaioTUsIWytNo4wkZ0t biHv8MHFqU/3hJzbETy7ddMvJhf5OaYRRowDjvkv7uvX10nOANNhPgP9Ny0FHV// kCE+zSjd1zieOVgjVOSAkYdwosuGVYeg5LB9uvwT8pczDTJW3mch06Z2c0mV5wzz 6UBKgW/YVdhHCsJXbvbcD7Bn+avN8HM0MUkRapzGkC7+8AWNerNF/RB3kPnHcA9O qnVho4Orhzwh2K00INR/bbXNg3C+lXv3R9UnWqsqDtL9k1hLxRhlJwmtw/mS+kmn Dxaue6/QSPEQ1KCoclGy+fxtTK4jvBFTobZimm3OSifjMSeKGsJyYFjFvPPaN/BO RYd+vGYZGsvFV9fV3VYPY2eulQyAkuOi7TJRIPznnn1PZc0z5gFRozmqdsGSXkeH p1j+i82ivAmlTmzPBHQ4dbnvTHnfEIZ0nwW8qkD3noMdc8zKPgZrnbKXT3L8Ae+V CWc+GdV0tZl3dxrJA7r2AmmMAxlC5cE5lBJd1kVfjnRjOSaf/V8kwQ1uwYt+Sk9f 7J0SlcHJOsOV1HhE+5x1 =gF7Y -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 9+ messages in thread
* [gentoo-portage-dev] [PATCH] calc_depclean: adjust early warning messages 2015-10-16 13:43 [gentoo-portage-dev] !!! You have no world file Joakim Tjernlund 2015-10-16 19:38 ` Rob Wortman 2015-10-16 20:25 ` Zac Medico @ 2015-10-20 16:53 ` Zac Medico 2015-10-20 20:19 ` [gentoo-portage-dev] [PATCH v2] " Zac Medico 2 siblings, 1 reply; 9+ messages in thread From: Zac Medico @ 2015-10-20 16:53 UTC (permalink / raw To: gentoo-portage-dev; +Cc: Zac Medico Suppress "no system list" warning if @profile is non-empty, in order to support @profile as an alternative to @system. Suppress "no world file" warnings unless @world is completely empty, since having an empty world file can be a valid state. Abort if a PackageSetNotFound error is encountered, or if @world is completely empty. --- pym/_emerge/actions.py | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 01aef51..a397fc2 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -699,30 +699,49 @@ def calc_depclean(settings, trees, ldpath_mtimes, protected_set = InternalPackageSet() protected_set_name = '____depclean_protected_set____' required_sets[protected_set_name] = protected_set - system_set = psets["system"] + set_warning = False + set_error = False set_atoms = {} for k in ("profile", "system", "selected"): try: set_atoms[k] = root_config.setconfig.getSetAtoms(k) - except portage.exception.PackageSetNotFound: + except portage.exception.PackageSetNotFound as e: # A nested set could not be resolved, so ignore nested sets. set_atoms[k] = root_config.sets[k].getAtoms() + writemsg_level(_("!!! The set '%s' " + "contains a non-existent set named '%s'.\n") % + (k, e), level=logging.ERROR, noiselevel=-1) + set_error = True + + # Support @profile as an alternative to @system. + if not (set_atoms["system"] or set_atoms["profile"]): + writemsg_level(_("!!! You have no system list.\n"), + level=logging.WARNING, noiselevel=-1) + set_warning = True - if (not set_atoms["system"] or - not (set_atoms["selected"] or set_atoms["profile"])): - - if not set_atoms["system"]: - writemsg_level("!!! You have no system list.\n", + # Suppress world file warnings unless @world is completely empty, + # since having an empty world file can be a valid state. + try: + world_atoms = bool(root_config.setconfig.getSetAtoms('world')) + except portage.exception.PackageSetNotFound as e: + writemsg_level(_("!!! The set '%s' " + "contains a non-existent set named '%s'.\n") % + ("world", e), level=logging.ERROR, noiselevel=-1) + set_error = True + else: + if not world_atoms: + writemsg_level(_("!!! You have no world file.\n"), level=logging.ERROR, noiselevel=-1) + set_error = True - # Skip this warning if @profile is non-empty, in order to - # support using @profile as an alternative to @selected - # for building a stage 4. - if not (set_atoms["selected"] or set_atoms["profile"]): - writemsg_level("!!! You have no world file.\n", - level=logging.WARNING, noiselevel=-1) + if set_error: + writemsg_level(_("!!! Aborting due to set configuration " + "errors displayed above.\n"), + level=logging.ERROR, noiselevel=-1) + return 1, [], False, 0 + if set_warning: writemsg_level("!!! Proceeding is likely to " + \ "break your installation.\n", level=logging.WARNING, noiselevel=-1) -- 2.4.9 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-portage-dev] [PATCH v2] calc_depclean: adjust early warning messages 2015-10-20 16:53 ` [gentoo-portage-dev] [PATCH] calc_depclean: adjust early warning messages Zac Medico @ 2015-10-20 20:19 ` Zac Medico 2015-10-20 21:50 ` Alexander Berntsen 0 siblings, 1 reply; 9+ messages in thread From: Zac Medico @ 2015-10-20 20:19 UTC (permalink / raw To: gentoo-portage-dev; +Cc: Zac Medico Suppress "no system list" warning if @profile is non-empty, in order to support @profile as an alternative to @system. Always warn if the world file is empty, but drop the "Proceeding is likely to break your installation" message and 10 second countdown. Abort if a PackageSetNotFound error is encountered, or if @world is completely empty. Fix depclean tests to have non-empty @world set. --- [PATCH v2] makes the "no world file" message always be shown when the world file is empty, drops the 10 second countdown, and fixes the depclean tests. pym/_emerge/actions.py | 50 ++++++++++++++++++----------- pym/portage/tests/resolver/test_depclean.py | 10 ++++-- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 01aef51..a872a96 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -699,35 +699,49 @@ def calc_depclean(settings, trees, ldpath_mtimes, protected_set = InternalPackageSet() protected_set_name = '____depclean_protected_set____' required_sets[protected_set_name] = protected_set - system_set = psets["system"] + set_error = False set_atoms = {} for k in ("profile", "system", "selected"): try: set_atoms[k] = root_config.setconfig.getSetAtoms(k) - except portage.exception.PackageSetNotFound: + except portage.exception.PackageSetNotFound as e: # A nested set could not be resolved, so ignore nested sets. set_atoms[k] = root_config.sets[k].getAtoms() + writemsg_level(_("!!! The set '%s' " + "contains a non-existent set named '%s'.\n") % + (k, e), level=logging.ERROR, noiselevel=-1) + set_error = True + + # Support @profile as an alternative to @system. + if not (set_atoms["system"] or set_atoms["profile"]): + writemsg_level(_("!!! You have no system list.\n"), + level=logging.WARNING, noiselevel=-1) - if (not set_atoms["system"] or - not (set_atoms["selected"] or set_atoms["profile"])): + if not set_atoms["selected"]: + writemsg_level(_("!!! You have no world file.\n"), + level=logging.WARNING, noiselevel=-1) - if not set_atoms["system"]: - writemsg_level("!!! You have no system list.\n", + # Suppress world file warnings unless @world is completely empty, + # since having an empty world file can be a valid state. + try: + world_atoms = bool(root_config.setconfig.getSetAtoms('world')) + except portage.exception.PackageSetNotFound as e: + writemsg_level(_("!!! The set '%s' " + "contains a non-existent set named '%s'.\n") % + ("world", e), level=logging.ERROR, noiselevel=-1) + set_error = True + else: + if not world_atoms: + writemsg_level(_("!!! Your @world set is empty.\n"), level=logging.ERROR, noiselevel=-1) + set_error = True - # Skip this warning if @profile is non-empty, in order to - # support using @profile as an alternative to @selected - # for building a stage 4. - if not (set_atoms["selected"] or set_atoms["profile"]): - writemsg_level("!!! You have no world file.\n", - level=logging.WARNING, noiselevel=-1) - - writemsg_level("!!! Proceeding is likely to " + \ - "break your installation.\n", - level=logging.WARNING, noiselevel=-1) - if "--pretend" not in myopts: - countdown(int(settings["EMERGE_WARNING_DELAY"]), ">>> Depclean") + if set_error: + writemsg_level(_("!!! Aborting due to set configuration " + "errors displayed above.\n"), + level=logging.ERROR, noiselevel=-1) + return 1, [], False, 0 if action == "depclean": emergelog(xterm_titles, " >>> depclean") diff --git a/pym/portage/tests/resolver/test_depclean.py b/pym/portage/tests/resolver/test_depclean.py index 42350be..f3c4c63 100644 --- a/pym/portage/tests/resolver/test_depclean.py +++ b/pym/portage/tests/resolver/test_depclean.py @@ -165,6 +165,9 @@ class DepcleanWithExcludeTestCase(TestCase): "dev-libs/B-1": { "RDEPEND": "dev-libs/A" }, } + # depclean asserts non-empty @world set + world = ["non-empty/world-set"] + test_cases = ( #Without --exclude. ResolverPlaygroundTestCase( @@ -196,7 +199,7 @@ class DepcleanWithExcludeTestCase(TestCase): cleanlist=[]), ) - playground = ResolverPlayground(installed=installed) + playground = ResolverPlayground(installed=installed, world=world) try: for test_case in test_cases: playground.run_TestCase(test_case) @@ -253,6 +256,9 @@ class DepcleanAndWildcardsTestCase(TestCase): "dev-libs/B-1": {}, } + # depclean asserts non-empty @world set + world = ["non-empty/world-set"] + test_cases = ( ResolverPlaygroundTestCase( ["*/*"], @@ -276,7 +282,7 @@ class DepcleanAndWildcardsTestCase(TestCase): cleanlist=[]), ) - playground = ResolverPlayground(installed=installed) + playground = ResolverPlayground(installed=installed, world=world) try: for test_case in test_cases: playground.run_TestCase(test_case) -- 2.4.9 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [gentoo-portage-dev] [PATCH v2] calc_depclean: adjust early warning messages 2015-10-20 20:19 ` [gentoo-portage-dev] [PATCH v2] " Zac Medico @ 2015-10-20 21:50 ` Alexander Berntsen 0 siblings, 0 replies; 9+ messages in thread From: Alexander Berntsen @ 2015-10-20 21:50 UTC (permalink / raw To: gentoo-portage-dev -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 LGTM. - -- Alexander bernalex@gentoo.org https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJWJrc2AAoJENQqWdRUGk8BbecQAPDUYX17Zr2c+E2ha32Fx8uJ vhIgUADOzGFRf2cyKX8L1iz2gj2/7CcK1mzY702JrUmK9QYOZowQw1vQHfcUa07D FNqrEtcEPhepyI48FC1eDvFUHasiwgaXYw18nLX2uL0/8s50422huj8NyFzUWZB8 gSUL0z3lsyTlu+iPZLCg+MMoJQiqwlk9gjT0U7KJJ722igwUN0dG/oJTun0mxEAF xsWMXH+Z6nIkBnacQn/6EM4XRgASp04xNs/kwkIK2FFfeqbWWESVVj3/+juDQ5ya l7OmINvdCy9enxeefiiep5hmCmyTmhXPvKYCBG1RNxALZtvv3nDvD3xshS7bG39Z CaanBoVAPuxgzYsnhptbZ1ez3w22M/GMT/Zqpt5+N/GB/0WIZ+rLtvPqrTjB62Ou BaNKHSGZIKg3bhmWrfDitOlCH0ZXSw75pMRMa281cCW5OfoHQ+l38NaOUYfc0tWe Sbe4vh87kOfmk4r24Zhcj3q1dKegrCIc0LnLT4ZXksInZoeeIunIWUMqkVZyDnjF bDSJXdISQomTkjFBFp5UixBbPwGg1B+P5c5uCRIGLF2DJOFl+sbR+Waj46Qg1Uv9 bqb0TRWvP7WY9UI5Rj5lTs1QHf+qmlQhQSRzeOYcXofWx3gJIT78sOQ0PdMzs2FD 3jDDami9PavBZIGchBtS =mmIW -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-10-20 21:50 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-10-16 13:43 [gentoo-portage-dev] !!! You have no world file Joakim Tjernlund 2015-10-16 19:38 ` Rob Wortman 2015-10-16 20:25 ` Zac Medico 2015-10-20 8:52 ` Alexander Berntsen 2015-10-20 11:20 ` Joakim Tjernlund 2015-10-20 11:23 ` Alexander Berntsen 2015-10-20 16:53 ` [gentoo-portage-dev] [PATCH] calc_depclean: adjust early warning messages Zac Medico 2015-10-20 20:19 ` [gentoo-portage-dev] [PATCH v2] " Zac Medico 2015-10-20 21:50 ` Alexander Berntsen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox