Compatability with FreeBSD Ports

Chris Pressey cpressey at catseye.mine.nu
Mon Aug 15 12:47:44 PDT 2005


On Mon, 15 Aug 2005 21:03:02 +0200
Joerg Sonnenberger <joerg at xxxxxxxxxxxxxxxxx> wrote:

> On Mon, Aug 15, 2005 at 10:59:35AM -0700, Chris Pressey wrote:
> > - package install/deinstall can execute arbitrary commands
> 
> This issue exists for every packaging system out there, simply because
> it is necessary for proper operation.

I disagree.  There is absolutely no reason that any package should be
able to execute 'fdisk', for example.

> > - bsd.port.mk and friends are almost unreadable/unmaintainable
> 
> Well, anything comparable to bsd.port.mk or bsd.pkg.mk is a
> complicated beast.

Make(1) is basically the wrong tool for organizing something of this
level of complexity - especially considering that 80% or more of what
ports/pkgsrc does, has *nothing* to do with what make(1) was designed to
do (dependency ordering & elimination of redundant actions.)

> I agree neither with the unreadable nor with the
> unmaintainable, at least for pkgsrc.

How long do you think it would it take the average developer to read and
understand the following code excerpt from bsd.pkg.mk?

# Cache variables listed in MAKEVARS in a phase-specific "makevars.mk"
# file.  These variables are effectively passed to sub-make processes
# that are invoked on the same Makefile.
#
. for _phase_ in ${ALL_PHASES}
${_MAKEVARS_MK.${_phase_}}: ${WRKDIR}
.   if !empty(PKG_PHASE:M${_phase_})
	${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET}.tmp
.     for _var_ in ${MAKEVARS:O:u}
.       if defined(${_var_})
	${_PKG_SILENT}${_PKG_DEBUG}					\
	${ECHO} ${_var_}"=	"${${_var_}:Q} >> ${.TARGET}.tmp
.       endif
.     endfor
	${_PKG_SILENT}${_PKG_DEBUG}					\
	if ${TEST} -f ${.TARGET}.tmp; then				\
		( ${ECHO} ".if !defined(_MAKEVARS_MK)";			\
		  ${ECHO} "_MAKEVARS_MK=	defined";		\
		  ${ECHO} "";						\
		  ${CAT} ${.TARGET}.tmp;				\
		  ${ECHO} "";						\
		  ${ECHO} ".endif # _MAKEVARS_MK";			\
		) > ${.TARGET};						\
		${RM} -f ${.TARGET}.tmp;				\
	fi
.   endif
	${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
. endfor
. undef _phase_

. ..at least it's commented and well-formatted; at least, as well as
make(1)'s syntax allows it to be.

If you say pkgsrc is better than ports, I won't dispute that.  But I
don't believe for a second that either of them is particularly _good_.

-Chris





More information about the Users mailing list