Bail out earlier if the file name argument doesn't end with '.ebuild'. Thanks
authorZac Medico <zmedico@gentoo.org>
Sat, 27 Dec 2008 18:27:52 +0000 (18:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 27 Dec 2008 18:27:52 +0000 (18:27 -0000)
to Diego 'Flameeyes' Pettenò for reporting. (trunk r12350)

svn path=/main/branches/2.1.6/; revision=12355

bin/ebuild

index 90c599e2647941d18063ace922cbafca34f6dc8e..ebb96f0bb3e9ef96b200f5bc8cf655f9a9f9d7cc 100755 (executable)
@@ -82,6 +82,12 @@ if portage.settings["NOCOLOR"] in ("yes","true") or not sys.stdout.isatty():
        portage.output.nocolor()
 
 ebuild = pargs.pop(0)
+
+if not ebuild.endswith(".ebuild"):
+       portage.writemsg("'%s' does not end with '.ebuild'.\n" % \
+               (ebuild,), noiselevel=-1)
+       sys.exit(1)
+
 if not os.path.isabs(ebuild):
        mycwd = os.getcwd()
        # Try to get the non-canonical path from the PWD evironment variable, since