Date: Sun, 25 Apr 2010 15:55:27 -0700 From: Doug Barton <dougb@FreeBSD.org> To: Aristedes Maniatis <ari@ish.com.au> Cc: freebsd-ports@freebsd.org Subject: Re: portmaster and IGNOREME Message-ID: <4BD4C85F.8010307@FreeBSD.org> In-Reply-To: <4BD39FDA.7070609@ish.com.au> References: <4BD28512.2010506@ish.com.au> <4BD356AC.9080707@FreeBSD.org> <4BD37E1E.7010207@ish.com.au> <4BD39CD0.4040504@FreeBSD.org> <4BD39FDA.7070609@ish.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On 04/24/10 18:50, Aristedes Maniatis wrote: > On 25/04/10 11:37 AM, Doug Barton wrote: > >>> In this case, since it is a package and not a port, why does portmaster >>> look at it at all? >> >> The -a option looks at everything /var/db/pkg. > > Sure. And this package exists there. But without an origin to point it > back to a port directory, hopefully this package should be completely > ignored by '-a'. There is no way for portmaster to know that the lack of ORIGIN is an acceptable situation or not without input from the user. 99.99999% of the time, not having an ORIGIN in the +CONTENTS file is an error that requires user attention. For those very rare situations where it's actually Ok, the +IGNOREME file comes into play. I've just committed a fix for this problem to the svn (development) version of portmaster. You can find information on how to download it at http://dougbarton.us/portmaster-proposal.html. I would appreciate it if you would test that version in your environment to confirm that the fix is satisfactory. I've appended the commit message below, but the short version is that if you just do 'portmaster -a' as you described previously the package you have installed will be ignored silently. If you add the -v option, you will see a message about the lack of ORIGIN and the +IGNOREME file, but portmaster will not exit with an error. Please let me know how it goes for you. I have a few other small fixes to add then I would like to release a bugfix version early next week. In any case, thank you for bringing this to my attention, I think the fix for this problem is a win overall so I'm glad that your bug report gave me the opportunity to address it. hth, Doug Log: Improve the handling of various situations where there is no ORIGIN recorded in the +CONTENTS file. This is almost always an error in the package building process, and therefore usually needs to be flagged and handled as an error. There are (at least) 2 situations where it may not be an error; bsdpan ports, and when the user has added an +IGNOREME file (usually for 3rd party packages). 1. Add code to origin_from_pdb() that tests to see that grep returned something, echos the result as before, then also returns successfully. a. If the port is a bsdpan port, return with an error code but let the caller handle the reporting as appropriate. b. If there is no ORIGIN but there is an +IGNOREME file don't report the error unless we're using -v, then also report that the +IGNOREME file is there. Either way, return with an error code. c. If there is no ORIGIN, and no +IGNOREME file, report the error and return with an error code. 2. In several places this allows several lines of code where the function is called to be collapsed into: origin=`origin_from_pdb $iport` || continue 3. In the main body where we parse the command line for what to work on convert the code that was individually testing the various conditions that are now handled in origin_from_pdb() to simply parse the return codes with a case statement. In the common case (there is an ORIGIN in +CONTENTS) this is almost certainly a minor optimization since the error handling code in origin_from_pdb() is never reached, and several places where things like "is it a bsdpan port?" and other error handling have been removed. -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BD4C85F.8010307>