Subject: Re: bsd.pkg.mk: running mtree as non-root? [patch]
To: Luke Mewburn <lukem@netbsd.org>
From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
List: tech-pkg
Date: 10/06/2003 14:29:49
On Mon, 6 Oct 2003, Luke Mewburn wrote:
> mtree -W prevents those errors...
Ay! Updated patch below.
- Hubert
Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1293
diff -u -r1.1293 bsd.pkg.mk
--- bsd.pkg.mk 2 Oct 2003 15:45:31 -0000 1.1293
+++ bsd.pkg.mk 6 Oct 2003 12:29:13 -0000
@@ -2535,19 +2535,19 @@
done
.endif # INSTALLATION_DIRS
.if !defined(NO_MTREE)
- ${_PKG_SILENT}${_PKG_DEBUG}if [ `${ID} -u` = 0 ]; then \
- if [ ! -f ${MTREE_FILE} ]; then \
- ${ECHO_MSG} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
- exit 1; \
- else \
- if [ ! -d ${PREFIX} ]; then \
- ${MKDIR} ${PREFIX}; \
- fi; \
- ${MTREE} ${MTREE_ARGS} ${PREFIX}/; \
- fi; \
- else \
- ${ECHO_MSG} "Warning: not superuser, can't run mtree."; \
- ${ECHO_MSG} "Become root and try again to ensure correct permissions."; \
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ if [ ! -f ${MTREE_FILE} ]; then \
+ ${ECHO_MSG} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
+ exit 1; \
+ else \
+ if [ ! -d ${PREFIX} ]; then \
+ ${MKDIR} ${PREFIX}; \
+ fi; \
+ if [ `${ID} -u` = 0 ]; then \
+ ${MTREE} ${MTREE_ARGS} ${PREFIX}/; \
+ else \
+ ${MTREE} -W ${MTREE_ARGS} ${PREFIX}/; \
+ fi; \
fi
.else
${_PKG_SILENT}${_PKG_DEBUG}[ -d ${PREFIX} ] || ${MKDIR} ${PREFIX}
--
___ _ _ _ _ * Harddisk Image Cloning *
/ __| | || | | | www.feyrer.de/g4u/
| (_ |_ _| |_| |
\___| |_| \___/ v1.12 out now, including partition support!