Has portmaster gone insane?

Doug Barton dougb at FreeBSD.org
Sat Oct 6 21:58:48 PDT 2007


On Fri, 5 Oct 2007, Lars Stokholm wrote:

> On 10/5/07, Scot Hetzel <swhetzel at gmail.com> wrote:
>> On 10/5/07, Lars Stokholm <lars.stokholm at gmail.com> wrote:
>>> Running 'portmaster --clean-distfiles-all' it began to delete *a lot*
>>> of files it shouldn't. I haven't had time to see how much is missing,
>>> but I guess is so much, that the entire installation is screwed.

I'm sincerely sorry that you've had this problem. I think Scot is right in 
that the code for --clean-distfiles* is pretty simple, and relies totally 
on a proper definition of DISTDIR.

I think I can see _what_ is happening, although I can't tell you why it's 
happening. Somehow the definition of DISTDIR on your system is empty, and 
so it's starting the find in / instead of /usr/ports/distfiles as it 
should. I'll add a check for empty DISTDIR and roll it into an update I'm 
working on at the moment.

>>> It choked on a filename of a weird charset, so it didn't get a chance 
>>> to delete everything.

I'm not sure I understand what you mean here, but I'm glad to hear that it 
didn't delete everything. Can you please try the attached patch and tell 
me if you get the error?

>> Portmaster uses the following to determine the value of DISTDIR.  What
>> does this show that DISTDIR is set to?
>>
>> make BEFOREPORTMK=yes -f/usr/share/mk/bsd.port.mk -V DISTDIR
>
> I'll have a look tomorrow.

I'm very interested in the results here.

Doug

-- 

     This .signature sanitized for your protection
-------------- next part --------------
Index: portmaster.sh.in
===================================================================
RCS file: /usr/local/ncvs/ports/ports-mgmt/portmaster/files/portmaster.sh.in,v
retrieving revision 1.21
diff -u -r1.21 portmaster.sh.in
--- portmaster.sh.in	2 Oct 2007 04:49:46 -0000	1.21
+++ portmaster.sh.in	7 Oct 2007 04:55:52 -0000
@@ -922,6 +922,7 @@
 fi
 if [ -z "$distdir" ]; then
 	distdir=`make BEFOREPORTMK=yes -f/usr/share/mk/bsd.port.mk -V DISTDIR`
+	[ -n "$distdir" ] || fail 'ERROR: The value of DISTDIR cannot be null'
 	# In case it is a symlink
 	distdir="${distdir}/"
 	export distdir


More information about the freebsd-ports mailing list