From owner-freebsd-pkgbase@freebsd.org Mon Nov 13 17:20:57 2017 Return-Path: Delivered-To: freebsd-pkgbase@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96D86DBFBDC for ; Mon, 13 Nov 2017 17:20:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7098575BFB; Mon, 13 Nov 2017 17:20:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 81F70A9E5; Mon, 13 Nov 2017 17:20:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 13 Nov 2017 17:20:54 +0000 From: Glen Barber To: freebsd-pkgbase@freebsd.org Cc: John Baldwin Subject: Re: Problems with packaging /etc and etcupdate(8) Message-ID: <20171113172054.GA23670@FreeBSD.org> References: <20170927163012.GA99112@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline In-Reply-To: <20170927163012.GA99112@FreeBSD.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: freebsd-pkgbase@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Packaging the FreeBSD base system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2017 17:20:57 -0000 --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Adding jhb, in case I'm doing something wrong with etcupdate(8) in this approach, but gratuitously pinging the list to solicit ideas. Glen On Wed, Sep 27, 2017 at 04:30:12PM +0000, Glen Barber wrote: > Hi, >=20 > Over the past two weeks, I spent quite a bit of time looking into using > etcupdate(8) to bootstrap /var/db/etcupdate for use with pkg(8), and > here are some of the issues I have run into. The most current diff > tested is attached. >=20 > 1) A new 'create-packages-files' target was added, which invokes the > etcupdate(8) 'extract' command using WSTAGEDIR for the DESTDIR. > Despite passing 'TAGS=3Dpackage=3Detc' and 'PACKAGE=3Detc' to etcupdat= e(8) > '-M' flag, in addition to '-DNO_ROOT', some files still fail to be > tagged in WSTAGEDIR/var/db/etcupdate/current/METALOG. To work around > this, a hack was added to release/scripts/mtree-to-plist.awk to trap > and tag files when '-v etcupdate=3Dyes' is passed to awk(1) in this > target. >=20 > 2) Some files do not automatically get created by etcupdate(8), as noted > in the manual page. For example, pwd_mkdb(8), cap_mkdb(1), > newaliases(1), tzsetup(8), and services_mkdb(8) are invoked after > merging files with the newly-created tree. This causes, for example, > files like /etc/passwd to be nonexistent when creating a package. To > work around this, another hack was added to the mtree-to-plist.awk > script to skip nonexistent files in WSTAGEDIR/var/db/etcupdate. This > is still non-ideal, I think. >=20 > 3) Setting 'prefix =3D /var/db/etcupdate' in the release/packages/etc.ucl > file appears to be ignored. Files in the 'etc' package conflict with > files installed by other packages, such as runtime, autofs, and so > on, with conflicting files being things like /etc/autofs/include_ldap > or other similarly-installed files within /etc. To work around this > when packaging files, a hack was added to the mtree-to-plist.awk > script (again) to prepend '/var/db/etcupdate' to the file path in > order to get the correct files included in the package. (This is > somewhat in parallel with (2) above.) >=20 > 4) When running etcupdate(8) after hacking around some of the issues > above, I discovered that /var/db/etcupdate/current in the root of the > system in which it is being run disappears. Additionally, I had to > restore files within /etc (such as master.passwd(5), passwd(5), etc.) > in order to make my test system usable again. In addition to > replacing files that should have been merged, 'pkg check' against the > 'FreeBSD-etc' package reports all of the files from the 'current' > directory have vanished. >=20 > In addition to the above items, I also did some (albeit minimal) testing > with mergemaster(8), as it creates /var/db/mergemaster.mtree, however in > my brief testing it seems the mtree(8) file created is not compatible > with pkg(8) or the mtree-to-plist.awk script. (Note: the mergemaster(8) > bits from my testing are not included in the diff, as I had to revert > a number of changes to ensure the correct diff was included in this > email. >=20 > I am at the point now where I am out of ideas on how to proceed, and > could use some help on figuring this out. Any help on the above issues, > or anything in the Wiki would be greatly appreciated. >=20 > https://wiki.freebsd.org/PkgBase >=20 > Thanks, >=20 > Glen >=20 > Index: Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- Makefile (revision 324062) > +++ Makefile (working copy) > @@ -132,6 +132,7 @@ > builddtb xdev xdev-build xdev-install \ > xdev-links native-xtools stageworld stagekernel stage-packages \ > create-packages-world create-packages-kernel create-packages \ > + create-files-packages \ > packages installconfig real-packages sign-packages package-pkg \ > print-dir test-system-compiler > =20 > Index: Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- Makefile.inc1 (revision 324063) > +++ Makefile.inc1 (working copy) > @@ -1555,6 +1555,7 @@ > =20 > .ORDER: stage-packages create-packages > .ORDER: create-packages create-world-packages > +.ORDER: create-packages create-files-packages > .ORDER: create-packages create-kernel-packages > .ORDER: create-packages sign-packages > =20 > @@ -1596,6 +1597,12 @@ > DESTDIR=3D${WSTAGEDIR} \ > PKG_VERSION=3D${PKG_VERSION} create-world-packages > =20 > +create-packages-files: _pkgbootstrap _repodir .PHONY > + ${_+_}@cd ${.CURDIR}; \ > + ${MAKE} -f Makefile.inc1 \ > + DESTDIR=3D${WSTAGEDIR} \ > + PKG_VERSION=3D${PKG_VERSION} create-files-packages > + > create-packages-kernel: _pkgbootstrap _repodir .PHONY > ${_+_}@cd ${.CURDIR}; \ > ${MAKE} -f Makefile.inc1 \ > @@ -1603,8 +1610,25 @@ > PKG_VERSION=3D${PKG_VERSION} DISTDIR=3Dkernel \ > create-kernel-packages > =20 > -create-packages: .PHONY create-packages-world create-packages-kernel > +create-packages: .PHONY create-packages-world create-packages-files crea= te-packages-kernel > =20 > +create-files-packages: _pkgbootstrap .PHONY > + mkdir -p ${WSTAGEDIR}/var/db/etcupdate/current > + cd ${WSTAGEDIR} ; \ > + ${WSTAGEDIR}/usr/sbin/etcupdate extract -B -M \ > + "TARGET=3D${TARGET} TARGET_ARCH=3D${TARGET_ARCH} -DNO_ROOT TAGS=3Dpack= age=3Detc PACKAGE=3Detc" \ > + -s ${SRCDIR} -d ${WSTAGEDIR}/var/db/etcupdate > + awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ > + -v etcupdate=3Dyes -v ws=3D${WSTAGEDIR} \ > + ${WSTAGEDIR}/var/db/etcupdate/current/METALOG > + sh ${SRCDIR}/release/packages/generate-ucl.sh -o etc \ > + -s ${SRCDIR} -u ${WSTAGEDIR}/etc.ucl > + ${PKG_CMD} -o ABI_FILE=3D${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=3Dyes= \ > + create -M ${WSTAGEDIR}/etc.ucl \ > + -p ${WSTAGEDIR}/etc.plist \ > + -r ${WSTAGEDIR} \ > + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=3D${WSTAGEDIR}/bin/sh config A= BI)/${PKG_VERSION} > + > create-world-packages: _pkgbootstrap .PHONY > @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || : > @cd ${WSTAGEDIR} ; \ > Index: release/packages/etc.ucl > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- release/packages/etc.ucl (nonexistent) > +++ release/packages/etc.ucl (working copy) > @@ -0,0 +1,22 @@ > +# > +# $FreeBSD: head/release/packages/runtime.ucl 322327 2017-08-09 19:16:54= Z gjb $ > +# > + > +name =3D "FreeBSD-etc" > +origin =3D "base" > +version =3D "%VERSION%" > +comment =3D "etc package" > +categories =3D [ base ] > +maintainer =3D "re@FreeBSD.org" > +www =3D "https://www.FreeBSD.org" > +prefix =3D "/var/db/etcupdate" > +licenselogic =3D "single" > +licenses =3D [ BSD2CLAUSE ] > +desc =3D < +etc package > +EOD > +scripts: { > + post-install =3D < + echo "Please use etcupdate(8) or mergemaster(8) to update" > + echo "files under /etc." > +EOD > Index: release/scripts/mtree-to-plist.awk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- release/scripts/mtree-to-plist.awk (revision 324062) > +++ release/scripts/mtree-to-plist.awk (working copy) > @@ -28,6 +28,13 @@ > tags=3Dtags""_kernconf > } > } > + if (etcupdate !=3D "") { > + if (length(gsub(/tags=3D/, "", tags) =3D=3D 0)) > + tags=3D"package=3Detc" > + if ((length(type) !=3D 0) && (type =3D=3D "dir")) { > + next > + } > + } > if (length(tags) =3D=3D 0) > next > if (tags ~ /package=3D/) { > @@ -76,5 +83,17 @@ > output=3Dpkgname".plist" > } > =20 > + if (etcupdate !=3D "") { > + pfx=3D"/var/db/etcupdate/current" > + filename=3Dws""pfx""$1 > + if (system("test -e " filename) =3D=3D 0) { > + print "@"type"("uname","gname","mode","flags") " pfx""$1 > output > + next > + } else { > + next > + } > + next > + } > + > print "@"type"("uname","gname","mode","flags") " $1 > output > } --2fHTh5uZTiUOsy+g Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAloJ1HYACgkQAxRYpUeP 4pO/mA//Zd87xE02szNGyV0b2CqbxJUhxO4shRJIkTBS7hI0nrDSFysbm4/zQ/s6 pX+iZqmwwD7N/YdhdsuWHUBJgmo5NchioXMDy0JkuMj/Cj5B6MjjUws72zcgEtXn Ajk9iEgnucuPzuF9c8d20R86I7Q0sDJMD12M1fki2YsgX+Ly5L3D5RR8gk8zNZbQ 5xV6tLKaWRaETKdcq118DkDTqM/XM1aHtQA+4D4dVx42Ne2LtML9QTqrQ/xN07pq A6XL5m6p36lGOxZ2z3KoLXrDg2zCMDan1Z+oOEIvxTIHckMjHePh6ovUVmYk6dA1 2SF0jU2DploZF/qufv2xleRjgslDPsfx8NEcHeGBXfuWgQZP0q93aXXDPB4kAkKh YwcXxZ7KMLCWv0U3PNVIOz2WZOZfAadfyyyg1+MOo+nD7lWkDBRZQWrNw8E4dceG ucl9RfVdDopWCL74in7UVnbMAzTUeJVdQY7nSHs5qSKVW611P0xC3FhZZHYOCdL/ WTsm078Zq7jaz2d5WvU61W01/mntXFsOFj3N3uRuG264fLs9F3ccu86Wx4MUzPVS AEA3/B46CHJ2qMIQVB6XeFz0Ny+lPcBVqJJ4rj4OD+O0zYgRC5agxWFabRyMq64x RyWVLQTwhgxVGYqZGtH7W5/O9ee/WyUt8b6w8YlJrfdlpRWrrEY= =fWZi -----END PGP SIGNATURE----- --2fHTh5uZTiUOsy+g-- From owner-freebsd-pkgbase@freebsd.org Mon Nov 13 18:54:18 2017 Return-Path: Delivered-To: freebsd-pkgbase@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78FA1DC16EE for ; Mon, 13 Nov 2017 18:54:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5334478AD0; Mon, 13 Nov 2017 18:54:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id DFA2F10A7DB; Mon, 13 Nov 2017 13:54:13 -0500 (EST) From: John Baldwin To: Glen Barber Cc: freebsd-pkgbase@freebsd.org Subject: Re: Problems with packaging /etc and etcupdate(8) Date: Mon, 13 Nov 2017 09:26:49 -0800 Message-ID: <1972909.hTPcQf8OeH@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20171113172054.GA23670@FreeBSD.org> References: <20170927163012.GA99112@FreeBSD.org> <20171113172054.GA23670@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 13 Nov 2017 13:54:14 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-pkgbase@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Packaging the FreeBSD base system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2017 18:54:18 -0000 I had assumed that in a pkgbase setup, one wouldn't use etcupdate or mergemaster. Instead, my understanding is that pkg was going to "learn" about configuration files and would grow etcupdate-like functionality to merge in changes to configuration files during upgrades (and would also support 'pkg confdiff', etc. so that 'pkg confdiff -a' would replace 'etcupdate diff' for example, but would also support packages built from ports, not just base system conf files). Each pkgbase package would contain its associated /etc files as configuration files in this scheme. On Monday, November 13, 2017 05:20:54 PM Glen Barber wrote: > Adding jhb, in case I'm doing something wrong with etcupdate(8) in this > approach, but gratuitously pinging the list to solicit ideas. > > Glen > > On Wed, Sep 27, 2017 at 04:30:12PM +0000, Glen Barber wrote: > > Hi, > > > > Over the past two weeks, I spent quite a bit of time looking into using > > etcupdate(8) to bootstrap /var/db/etcupdate for use with pkg(8), and > > here are some of the issues I have run into. The most current diff > > tested is attached. > > > > 1) A new 'create-packages-files' target was added, which invokes the > > etcupdate(8) 'extract' command using WSTAGEDIR for the DESTDIR. > > Despite passing 'TAGS=package=etc' and 'PACKAGE=etc' to etcupdate(8) > > '-M' flag, in addition to '-DNO_ROOT', some files still fail to be > > tagged in WSTAGEDIR/var/db/etcupdate/current/METALOG. To work around > > this, a hack was added to release/scripts/mtree-to-plist.awk to trap > > and tag files when '-v etcupdate=yes' is passed to awk(1) in this > > target. > > > > 2) Some files do not automatically get created by etcupdate(8), as noted > > in the manual page. For example, pwd_mkdb(8), cap_mkdb(1), > > newaliases(1), tzsetup(8), and services_mkdb(8) are invoked after > > merging files with the newly-created tree. This causes, for example, > > files like /etc/passwd to be nonexistent when creating a package. To > > work around this, another hack was added to the mtree-to-plist.awk > > script to skip nonexistent files in WSTAGEDIR/var/db/etcupdate. This > > is still non-ideal, I think. > > > > 3) Setting 'prefix = /var/db/etcupdate' in the release/packages/etc.ucl > > file appears to be ignored. Files in the 'etc' package conflict with > > files installed by other packages, such as runtime, autofs, and so > > on, with conflicting files being things like /etc/autofs/include_ldap > > or other similarly-installed files within /etc. To work around this > > when packaging files, a hack was added to the mtree-to-plist.awk > > script (again) to prepend '/var/db/etcupdate' to the file path in > > order to get the correct files included in the package. (This is > > somewhat in parallel with (2) above.) > > > > 4) When running etcupdate(8) after hacking around some of the issues > > above, I discovered that /var/db/etcupdate/current in the root of the > > system in which it is being run disappears. Additionally, I had to > > restore files within /etc (such as master.passwd(5), passwd(5), etc.) > > in order to make my test system usable again. In addition to > > replacing files that should have been merged, 'pkg check' against the > > 'FreeBSD-etc' package reports all of the files from the 'current' > > directory have vanished. > > > > In addition to the above items, I also did some (albeit minimal) testing > > with mergemaster(8), as it creates /var/db/mergemaster.mtree, however in > > my brief testing it seems the mtree(8) file created is not compatible > > with pkg(8) or the mtree-to-plist.awk script. (Note: the mergemaster(8) > > bits from my testing are not included in the diff, as I had to revert > > a number of changes to ensure the correct diff was included in this > > email. > > > > I am at the point now where I am out of ideas on how to proceed, and > > could use some help on figuring this out. Any help on the above issues, > > or anything in the Wiki would be greatly appreciated. > > > > https://wiki.freebsd.org/PkgBase > > > > Thanks, > > > > Glen > > > > > Index: Makefile > > =================================================================== > > --- Makefile (revision 324062) > > +++ Makefile (working copy) > > @@ -132,6 +132,7 @@ > > builddtb xdev xdev-build xdev-install \ > > xdev-links native-xtools stageworld stagekernel stage-packages \ > > create-packages-world create-packages-kernel create-packages \ > > + create-files-packages \ > > packages installconfig real-packages sign-packages package-pkg \ > > print-dir test-system-compiler > > > > Index: Makefile.inc1 > > =================================================================== > > --- Makefile.inc1 (revision 324063) > > +++ Makefile.inc1 (working copy) > > @@ -1555,6 +1555,7 @@ > > > > .ORDER: stage-packages create-packages > > .ORDER: create-packages create-world-packages > > +.ORDER: create-packages create-files-packages > > .ORDER: create-packages create-kernel-packages > > .ORDER: create-packages sign-packages > > > > @@ -1596,6 +1597,12 @@ > > DESTDIR=${WSTAGEDIR} \ > > PKG_VERSION=${PKG_VERSION} create-world-packages > > > > +create-packages-files: _pkgbootstrap _repodir .PHONY > > + ${_+_}@cd ${.CURDIR}; \ > > + ${MAKE} -f Makefile.inc1 \ > > + DESTDIR=${WSTAGEDIR} \ > > + PKG_VERSION=${PKG_VERSION} create-files-packages > > + > > create-packages-kernel: _pkgbootstrap _repodir .PHONY > > ${_+_}@cd ${.CURDIR}; \ > > ${MAKE} -f Makefile.inc1 \ > > @@ -1603,8 +1610,25 @@ > > PKG_VERSION=${PKG_VERSION} DISTDIR=kernel \ > > create-kernel-packages > > > > -create-packages: .PHONY create-packages-world create-packages-kernel > > +create-packages: .PHONY create-packages-world create-packages-files create-packages-kernel > > > > +create-files-packages: _pkgbootstrap .PHONY > > + mkdir -p ${WSTAGEDIR}/var/db/etcupdate/current > > + cd ${WSTAGEDIR} ; \ > > + ${WSTAGEDIR}/usr/sbin/etcupdate extract -B -M \ > > + "TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} -DNO_ROOT TAGS=package=etc PACKAGE=etc" \ > > + -s ${SRCDIR} -d ${WSTAGEDIR}/var/db/etcupdate > > + awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ > > + -v etcupdate=yes -v ws=${WSTAGEDIR} \ > > + ${WSTAGEDIR}/var/db/etcupdate/current/METALOG > > + sh ${SRCDIR}/release/packages/generate-ucl.sh -o etc \ > > + -s ${SRCDIR} -u ${WSTAGEDIR}/etc.ucl > > + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ > > + create -M ${WSTAGEDIR}/etc.ucl \ > > + -p ${WSTAGEDIR}/etc.plist \ > > + -r ${WSTAGEDIR} \ > > + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} > > + > > create-world-packages: _pkgbootstrap .PHONY > > @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || : > > @cd ${WSTAGEDIR} ; \ > > Index: release/packages/etc.ucl > > =================================================================== > > --- release/packages/etc.ucl (nonexistent) > > +++ release/packages/etc.ucl (working copy) > > @@ -0,0 +1,22 @@ > > +# > > +# $FreeBSD: head/release/packages/runtime.ucl 322327 2017-08-09 19:16:54Z gjb $ > > +# > > + > > +name = "FreeBSD-etc" > > +origin = "base" > > +version = "%VERSION%" > > +comment = "etc package" > > +categories = [ base ] > > +maintainer = "re@FreeBSD.org" > > +www = "https://www.FreeBSD.org" > > +prefix = "/var/db/etcupdate" > > +licenselogic = "single" > > +licenses = [ BSD2CLAUSE ] > > +desc = < > +etc package > > +EOD > > +scripts: { > > + post-install = < > + echo "Please use etcupdate(8) or mergemaster(8) to update" > > + echo "files under /etc." > > +EOD > > Index: release/scripts/mtree-to-plist.awk > > =================================================================== > > --- release/scripts/mtree-to-plist.awk (revision 324062) > > +++ release/scripts/mtree-to-plist.awk (working copy) > > @@ -28,6 +28,13 @@ > > tags=tags""_kernconf > > } > > } > > + if (etcupdate != "") { > > + if (length(gsub(/tags=/, "", tags) == 0)) > > + tags="package=etc" > > + if ((length(type) != 0) && (type == "dir")) { > > + next > > + } > > + } > > if (length(tags) == 0) > > next > > if (tags ~ /package=/) { > > @@ -76,5 +83,17 @@ > > output=pkgname".plist" > > } > > > > + if (etcupdate != "") { > > + pfx="/var/db/etcupdate/current" > > + filename=ws""pfx""$1 > > + if (system("test -e " filename) == 0) { > > + print "@"type"("uname","gname","mode","flags") " pfx""$1 > output > > + next > > + } else { > > + next > > + } > > + next > > + } > > + > > print "@"type"("uname","gname","mode","flags") " $1 > output > > } > > > -- John Baldwin From owner-freebsd-pkgbase@freebsd.org Mon Nov 13 19:51:51 2017 Return-Path: Delivered-To: freebsd-pkgbase@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D65B2DC9C67 for ; Mon, 13 Nov 2017 19:51:51 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from valentine.liquidneon.com (valentine.liquidneon.com [216.87.78.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "valentine.liquidneon.com", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B417B7B73D; Mon, 13 Nov 2017 19:51:51 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: by valentine.liquidneon.com (Postfix, from userid 1018) id 6B8693A77; Mon, 13 Nov 2017 12:51:44 -0700 (MST) Date: Mon, 13 Nov 2017 12:51:44 -0700 From: Brad Davis To: John Baldwin Cc: Glen Barber , freebsd-pkgbase@freebsd.org, Will Andrews Subject: Re: Problems with packaging /etc and etcupdate(8) Message-ID: <20171113195144.GH53537@corpmail.liquidneon.com> References: <20170927163012.GA99112@FreeBSD.org> <20171113172054.GA23670@FreeBSD.org> <1972909.hTPcQf8OeH@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1972909.hTPcQf8OeH@ralph.baldwin.cx> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: freebsd-pkgbase@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Packaging the FreeBSD base system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2017 19:51:51 -0000 On Mon, Nov 13, 2017 at 09:26:49AM -0800, John Baldwin wrote: > I had assumed that in a pkgbase setup, one wouldn't use etcupdate or mergemaster. > Instead, my understanding is that pkg was going to "learn" about configuration > files and would grow etcupdate-like functionality to merge in changes to configuration > files during upgrades (and would also support 'pkg confdiff', etc. so that > 'pkg confdiff -a' would replace 'etcupdate diff' for example, but would also support > packages built from ports, not just base system conf files). Each pkgbase package > would contain its associated /etc files as configuration files in this scheme. To that end Will and I have been working on a patch to move all files in head/etc/ to the places they belong. I am probably ~75% of the way through them so far. Once I get the last bit wrapped up, I will post a review. Regards, Brad Davis