tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Making DESTDIR support mandatory



On Wed, Apr 06, 2011 at 03:15:05PM -0400, Greg Troxel wrote:
> Right now, using DESTDIR is not the default.   I certainly agree that
> this should change.
> 
> Your patch seems to be doing things in wrong order.  Specifically, I
> don't understand why it is reasonable to mark packages broken because of
> lack of DESTDIR support when the default is not to use DESTDIR support.
> I just checked - at least on the 2011Q4 branch, 'make replace' on a
> package uses DESTDIR with PKG_DEVELOPER=yes, and doesn't otherwise.  (I
> have PKG_DEVELOPER=yes on almost all machines.)
> 
> Steps that I think should happen are:
> 
>   1) Change default to use DESTDIR, with or without PKG_DEVELOPER.
>   Start having the norm for bulk builds to use this (perhaps they do,
>   but I'd expect default behavior for public bulk builds).  Have an
>   option to set it to the old way.  This is really the most important
>   change, and I see no reason not to do this right now.
> 
>   This is is easy; just remove the .if on PKG_DEVELOPER on line 428 of
>   bsd.prefs.mk, and replace with "USE_DESTDIR?= yes".
> 
>   2) Change the current warning to be always enabled.  I see no reason
>   not to do this immediately

I've taken these two steps, adapting your patch slightly. Thanks for
providing it.

>   3) Change the code, similarly to your patch, to set BROKEN if both a)
>   USE_DESTDIR=yes and b) the package is not DESTDIR-ready.  I see no
>   reason not to do this right now.

I suggest the attached patch for this. Seems to work as expected for
me.

>   4) Remove the option to use other than DESTDIR mode.  Given the
>   progress, I expect pretty soon the number of deficient packages will
>   be really small, instead of just small.  But I don't think we've
>   reached the time to do this step.

Ok, so let's talk about this step again in a month or so.

Cheers,
 Thomas
Index: bsd.prefs.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.prefs.mk,v
retrieving revision 1.314
diff -u -r1.314 bsd.prefs.mk
--- bsd.prefs.mk        7 Apr 2011 08:08:45 -0000       1.314
+++ bsd.prefs.mk        7 Apr 2011 09:33:23 -0000
@@ -446,6 +446,9 @@
 # non-DESTDIR-capable packages when not in DESTDIR mode is above.
 .if empty(PKG_DESTDIR_SUPPORT)
 WARNINGS+=     "[bsd.prefs.mk] The package ${PKGNAME} is missing DESTDIR 
support."
+.if empty(USE_DESTDIR:M[Nn][Oo])
+PKG_FAIL_REASON+=      "USE_DESTDIR is set to yes, but package does not 
support destdir."
+.endif
 .endif
 
 # When using staged installation, everything gets installed into


Home | Main Index | Thread Index | Old Index