pkgsrc-Users archive

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

Re: [patch] package.mk: use cp without -p if it fails



On 5 Aug 2021, at 9:47, Sijmen J. Mulder wrote:

After setting up pkgsrc on a new FreeBSD 13 installation on ZFS, I
encoutnered an error when building any package: cp would report a
chattr failure copying the package file from the work directory to the
packages directory.

This was because my work directory is hosted on the ZFS root
filesystem, which sets 'uarch' flags, and the packages directory is on
an NFS-mounted volume which doesn't support that flag (or any?).

The attached patch uses regular 'cp' if 'cp -p' doesn't work.

FWIW, I've been running for a long time with a similar local diff for similar reasons (many VMs building binary packages into an NFS location):

--- mk/pkgformat/pkg/package.mk
+++ mk/pkgformat/pkg/package.mk
@@ -66,7 +66,8 @@ ${PKGFILE}: ${STAGE_PKGFILE}
        @${STEP_MSG} "Creating binary package ${.TARGET}"
${RUN} ${MKDIR} ${.TARGET:H}; \ ${LN} -f ${STAGE_PKGFILE} ${PKGFILE} 2>/dev/null || \
-               ${CP} -pf ${STAGE_PKGFILE} ${PKGFILE}
+ ${CP} -pf ${STAGE_PKGFILE} ${PKGFILE} 2>/dev/null || \
+               ${CMP} ${STAGE_PKGFILE} ${PKGFILE}
 .endif

 ######################################################################


Home | Main Index | Thread Index | Old Index