Date: 30 Sep 2000 04:27:13 -0700 From: asami@FreeBSD.ORG (Satoshi - Ports Wraith - Asami) To: "Jeffrey J. Mountin" <jeff-ml@mountin.net> Cc: ports@FreeBSD.ORG, mharo@FreeBSD.ORG, will@FreeBSD.ORG Subject: Re: RFC: Ports layout reorganization (Re: ports tree idea: Combine DESCR and COMMENT) Message-ID: <vqc7l7uglwu.fsf@silvia.hip.berkeley.edu> In-Reply-To: "Jeffrey J. Mountin"'s message of "Fri, 29 Sep 2000 22:58:30 -0500" References: <"Jeffrey J. Mountin"'s message of "Fri, 29 Sep 2000 15:02:50 -0500"> <vqcsnqjin86.fsf_-_@silvia.hip.berkeley.edu> <4.3.2.20000929140626.00c3fa00@207.227.119.2> <4.3.2.20000929220000.00e0d7e0@207.227.119.2>
index | next in thread | previous in thread | raw e-mail
* From: "Jeffrey J. Mountin" <jeff-ml@mountin.net>
* >You're talking about me? ;)
*
* Hmmm...
I was just kidding. :) Here is the patch for review. I intend to
commit this tomorrow as the code to deal with the new layout is not
yet activated by default, but it adds a check that safeguards against
people mixing an old bsd.port.mk with a new port.
I am planning to do the actual work sometime next weekend, so it will
only help people who updated bsd.port.mk in that one-week period, but
it's still better than nothing.
I haven't added the COMMENT stuff yet. It is not as simple as the
directory movement so I want to go one step at a time.
By the way, can someone convert portlint and addport too? (Michael,
are you there?) Perl isn't my strongest subject....
* ... like one without the patch- prefix in security/sslproxy and may be
* others, which don't follow the guidelines.
Hmm. I have no idea how that would work, since bsd.port.mk only deals
with files named "patch-*". You *can* actually put a file in
${PATCHDIR} that is not named "patch-*" and conditionally specify them
as EXTRA_PATCHES, but sslproxy is not doing that either.
===
Index: Mk/bsd.port.mk
===================================================================
RCS file: /usr/cvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.352
diff -u -r1.352 bsd.port.mk
--- Mk/bsd.port.mk 2000/09/22 07:21:24 1.352
+++ Mk/bsd.port.mk 2000/09/30 11:22:15
@@ -584,6 +602,28 @@
PACKAGES?= ${PORTSDIR}/packages
TEMPLATES?= ${PORTSDIR}/Templates
+.if defined(NEWLAYOUT)
+.if (!defined(PATCHDIR) && exists(${MASTERDIR}/patches)) || \
+ (!defined(PKGDIR) && exists(${MASTERDIR}/pkg)) || \
+ (!defined(MD5_FILE) && exists(${MASTERDIR}/files/md5))
+pre-everything::
+ @${ECHO} "Error: your port uses an old layout. Please update it to match this bsd.port.mk."
+ @${FALSE}
+.endif
+PATCHDIR?= ${MASTERDIR}/files
+FILESDIR?= ${MASTERDIR}/files
+SCRIPTDIR?= ${MASTERDIR}/scripts
+PKGDIR?= ${MASTERDIR}
+.else
+.if exists(${MASTERDIR}/pkg-comment) || exists(${MASTERDIR}/pkg-descr) || \
+ exists(${MASTERDIR}/pkg-plist) || exists(${MASTERDIR}/distinfo)
+pre-everything::
+ @${ECHO} "Error: your port uses the new layout. Please update bsd.port.mk to match the port."
+ @${FALSE}
+.endif
+.endif
+
+# delete from here when NEWLAYOUT is default
.if exists(${MASTERDIR}/patches.${ARCH}-${OPSYS})
PATCHDIR?= ${MASTERDIR}/patches.${ARCH}-${OPSYS}
.elif exists(${MASTERDIR}/patches.${OPSYS})
@@ -623,6 +663,7 @@
.else
PKGDIR?= ${MASTERDIR}/pkg
.endif
+# delete to here when NEWLAYOUT is default
.if defined(USE_IMAKE)
USE_X_PREFIX= yes
@@ -922,7 +969,12 @@
.else
MD5?= md5
.endif
+.if defined(NEWLAYOUT)
+MD5_FILE?= ${MASTERDIR}/distinfo
+.endif
+# delete from here when NEWLAYOUT is default
MD5_FILE?= ${FILESDIR}/md5
+# delete to here when NEWLAYOUT is default
MAKE_FLAGS?= -f
MAKEFILE?= Makefile
@@ -1024,20 +1076,32 @@
.undef NO_PACKAGE
.endif
+.if defined(NEWLAYOUT)
+COMMENT?= ${PKGDIR}/pkg-comment
+DESCR?= ${PKGDIR}/pkg-descr
+PLIST?= ${PKGDIR}/pkg-plist
+PKGINSTALL?= ${PKGDIR}/pkg-install
+PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall
+PKGREQ?= ${PKGDIR}/pkg-req
+PKGMESSAGE?= ${PKGDIR}/pkg-message
+.endif
+
+# delete from here when NEWLAYOUT is default
COMMENT?= ${PKGDIR}/COMMENT
DESCR?= ${PKGDIR}/DESCR
PLIST?= ${PKGDIR}/PLIST
-TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
PKGINSTALL?= ${PKGDIR}/INSTALL
PKGDEINSTALL?= ${PKGDIR}/DEINSTALL
PKGREQ?= ${PKGDIR}/REQ
PKGMESSAGE?= ${PKGDIR}/MESSAGE
+# delete to here when NEWLAYOUT is default
+TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
PKG_CMD?= /usr/sbin/pkg_create
PKG_DELETE?= /usr/sbin/pkg_delete
PKG_INFO?= /usr/sbin/pkg_info
.if !defined(PKG_ARGS)
PKG_ARGS= -v -c ${COMMENT} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | sort -u`" ${EXTRA_PKG_ARGS}
.if exists(${PKGINSTALL})
PKG_ARGS+= -i ${PKGINSTALL}
.endif
@@ -2824,8 +2911,9 @@
@${CAT} ${TEMPLATES}/README.port | \
${SED} -e 's%%PORT%%'`${ECHO} ${.CURDIR} | ${SED} -e 's.*/\([^/]*/[^/]*\)$$\1'`'g' \
-e 's%%PKG%%${PKGNAME}g' \
- -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \
+ -e '/%%COMMENT%%/r${COMMENT}' \
-e '/%%COMMENT%%/d' \
+ -e 's%%DESCR%%'"`${ECHO} ${DESCR} | ${SED} -e 's${.CURDIR}/'`"'' \
-e 's%%BUILD_DEPENDS%%'"`cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} pretty-print-build-depends-list`"'' \
-e 's%%RUN_DEPENDS%%'"`cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} pretty-print-run-depends-list`"'' \
-e 's%%TOP%%'"`${ECHO} ${CATEGORIES} | ${SED} -e 'sa .*aa' -e 'sa[^/]*a..ag'`"'/..' \
Index: Templates/README.port
===================================================================
RCS file: /usr/cvs/ports/Templates/README.port,v
retrieving revision 1.2
diff -u -r1.2 README.port
--- Templates/README.port 2000/01/21 11:08:23 1.2
+++ Templates/README.port 2000/09/30 11:21:00
@@ -11,7 +11,7 @@
%%COMMENT%%
<p><hr>
-<p>Please read the file "<a href="pkg/DESCR">pkg/DESCR</a>" for a
+<p>Please read the "<a href="%%DESCR%%">description file</a>" for a
longer description.
<p>Go to the <a href="%%TOP%%/README.html">top of the ports tree</a> for
===
As you can see, by defining NEWLAYOUT you get the new behavior. When
I finish converting all files, it will become the default. At that
time, I will also delete the lines marked by "# delete from" and
"#delete to".
If some hunks look excessively long, that's because I edited the patch
by hand to remove other stuff that I'm currently testing. (I hope I
didn't screw up the edit!)
The %%DESCR%% substitution in README.port actually doesn't work when
MASTERDIR is set relative to ${PORTSDIR} and ${PORTSDIR} is a symlink
to something else, but you are not supposed to use ${PORTSDIR} in a
MASTERDIR definition so we should be safe. (The old README.port
wouldn't have worked at all for ports with MASTERDIR or its own idea
of DESCR anyway.)
-PW
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?vqc7l7uglwu.fsf>
