public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] Friendly error on user supplied invalid atoms
@ 2005-09-27 15:22 Jason Stubbs
  2005-09-27 15:33 ` Jason Stubbs
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Stubbs @ 2005-09-27 15:22 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

Don't mind if the message is changed at all - this one kind of reminds me of a 
pre-recorded telephone operator - so if anyone has any suggestions...

[-- Attachment #2: check-user-atoms.patch --]
[-- Type: text/x-diff, Size: 564 bytes --]

diff -uNr 2.0/bin/emerge 2.0-patched/bin/emerge
--- 2.0/bin/emerge	2005-09-27 13:16:09.000000000 +0900
+++ 2.0-patched/bin/emerge	2005-09-28 00:15:21.000000000 +0900
@@ -1071,6 +1071,10 @@
 				elif not "--oneshot" in myopts:
 					myfavorites.append(mykey)
 			else:
+				if not portage.isvalidatom(x):
+					print ("\n\n!!! '%s' is an invalid atom." % x)
+					print "!!! Please check the syntax and try again."
+					print "!!! man 5 ebuild for specific details."
 				try:
 					mykey=portage.dep_expand(x,mydb=portage.portdb)
 				except ValueError, errpkgs:

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] Friendly error on user supplied invalid atoms
  2005-09-27 15:22 [gentoo-portage-dev] [PATCH] Friendly error on user supplied invalid atoms Jason Stubbs
@ 2005-09-27 15:33 ` Jason Stubbs
  2005-10-01 15:29   ` Jason Stubbs
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Stubbs @ 2005-09-27 15:33 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

On Wednesday 28 September 2005 00:22, Jason Stubbs wrote:
> Don't mind if the message is changed at all - this one kind of reminds me
> of a pre-recorded telephone operator - so if anyone has any suggestions...

After a small amount of discussion:

!!! '%s' is not a valid package atom.
!!! Please check ebuild(5) for full details.
!!! (Did you specify a version but forget to prefix with '='?)


[-- Attachment #2: check-user-atoms.patch --]
[-- Type: text/x-diff, Size: 599 bytes --]

diff -uNr 2.0/bin/emerge 2.0-patched/bin/emerge
--- 2.0/bin/emerge	2005-09-27 13:16:09.000000000 +0900
+++ 2.0-patched/bin/emerge	2005-09-28 00:15:21.000000000 +0900
@@ -1071,6 +1071,10 @@
 				elif not "--oneshot" in myopts:
 					myfavorites.append(mykey)
 			else:
+				if not portage.isvalidatom(x):
+					print ("\n\n!!! '%s' is not a valid package atom." % x)
+					print "!!! Please check ebuild(5) for full details."
+					print "!!! (Did you specify a version but forget to prefix with '='?)"
 				try:
 					mykey=portage.dep_expand(x,mydb=portage.portdb)
 				except ValueError, errpkgs:

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] Friendly error on user supplied invalid atoms
  2005-09-27 15:33 ` Jason Stubbs
@ 2005-10-01 15:29   ` Jason Stubbs
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Stubbs @ 2005-10-01 15:29 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 691 bytes --]

On Wednesday 28 September 2005 00:33, Jason Stubbs wrote:
> On Wednesday 28 September 2005 00:22, Jason Stubbs wrote:
> > Don't mind if the message is changed at all - this one kind of reminds me
> > of a pre-recorded telephone operator - so if anyone has any
> > suggestions...
>
> After a small amount of discussion:
>
> !!! '%s' is not a valid package atom.
> !!! Please check ebuild(5) for full details.
> !!! (Did you specify a version but forget to prefix with '='?)

Using portage.isvalidatom() is a little too strict. Any atom with no category 
is marked as invalid. _rc1 has a quick workaround but this patch restores the 
full range of atoms classes that was available previously.

[-- Attachment #2: allow-no-category-atoms.patch --]
[-- Type: text/x-diff, Size: 766 bytes --]

Index: emerge
===================================================================
--- emerge	(revision 2066)
+++ emerge	(working copy)
@@ -1083,7 +1083,14 @@
 				elif not "--oneshot" in myopts:
 					myfavorites.append(mykey)
 			else:
-				if not portage.isvalidatom(x) and not portage.isvalidatom("cat/"+x):
+				testkey = portage.dep_getkey(x)
+				if testkey.startswith("null/"):
+					testatom = x.replace(testkey[5:], "cat/"+testkey[5:])
+				elif "/" not in x:
+					testatom = "cat/"+x
+				else:
+					testatom = x
+				if not portage.isvalidatom(testatom):
 					print ("\n\n!!! '%s' is not a valid package atom." % x)
 					print "!!! Please check ebuild(5) for full details."
 					print "!!! (Did you specify a version but forget to prefix with '='?)"

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-01 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-27 15:22 [gentoo-portage-dev] [PATCH] Friendly error on user supplied invalid atoms Jason Stubbs
2005-09-27 15:33 ` Jason Stubbs
2005-10-01 15:29   ` Jason Stubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox