Current-Users archive

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

Re: non-root build failure + correct permissions for /usr/obj?



On Tue, 25 May 2010, Alan Barrett wrote:
> >   | build.sh already has this code, to bomb if you try to
> >   | build as an unprivileged user without setting either -U (unprivileged)
> >   | or -E (expert mode):
> > 
> > that appears to have not worked the way it was intended...
> 
> Hmm, yes, I think you are right.  I'll try to fix at least that part.

Does the appended patch help?  It still rebuilds make before printing
the error message, because it's also valid to set MKUNPRIVED in mk.conf,
and build.sh has to rebuild make before it can rely on being able to
parse mk.conf.

--apb (Alan Barrett)

--- a/build.sh
+++ b/build.sh
@@ -1233,30 +1233,26 @@ validatemakeparams()
        removedirs="${TOOLDIR}"
 
        if [ -z "${DESTDIR}" ] || [ "${DESTDIR}" = "/" ]; then
-               if ${do_build} || ${do_distribution} || ${do_release}; then
-                       if ! ${do_build} || \
-                          [ "${uname_s}" != "NetBSD" ] || \
-                          [ "${uname_m}" != "${MACHINE}" ]; then
-                               bomb "DESTDIR must != / for cross builds, or 
${progname} 'distribution' or 'release'."
-                       fi
-                       if ! ${do_expertmode}; then
-                               bomb "DESTDIR must != / for non -E (expert) 
builds"
-                       fi
-                       statusmsg "WARNING: Building to /, in expert mode."
-                       statusmsg "         This may cause your system to 
break!  Reasons include:"
-                       statusmsg "            - your kernel is not up to date"
-                       statusmsg "            - the libraries or toolchain 
have changed"
-                       statusmsg "         YOU HAVE BEEN WARNED!"
+               if ${do_distribution} || ${do_release} || \
+                  [ "${uname_s}" != "NetBSD" ] || \
+                  [ "${uname_m}" != "${MACHINE}" ]; then
+                       bomb "DESTDIR must != / for cross builds, or 
${progname} 'distribution' or 'release'."
+               fi
+               if ! ${do_expertmode}; then
+                       bomb "DESTDIR must != / for non -E (expert) builds"
                fi
+               statusmsg "WARNING: Building to /, in expert mode."
+               statusmsg "         This may cause your system to break!  
Reasons include:"
+               statusmsg "            - your kernel is not up to date"
+               statusmsg "            - the libraries or toolchain have 
changed"
+               statusmsg "         YOU HAVE BEEN WARNED!"
        else
                removedirs="${removedirs} ${DESTDIR}"
        fi
-       if ${do_build} || ${do_distribution} || ${do_release}; then
-               if ! ${do_expertmode} && \
-                   [ "$id_u" -ne 0 ] && \
-                   [ "${MKUNPRIVED}" = "no" ] ; then
-                       bomb "-U or -E must be set for build as an unprivileged 
user."
-               fi
+       if ! ${do_expertmode} && \
+           [ "$id_u" -ne 0 ] && \
+           [ "${MKUNPRIVED}" = "no" ] ; then
+               bomb "-U or -E must be set for build as an unprivileged user."
        fi
        if ${do_releasekernel} && [ -z "${RELEASEDIR}" ]; then
                bomb "Must set RELEASEDIR with \`releasekernel=...'"
@@ -1282,9 +1278,7 @@ validatemakeparams()
                # DESTDIR is about to be removed
                ;;
        *)
-               if ( ${do_build} || ${do_distribution} || ${do_release} || \
-                   ${do_install} ) && \
-                   [ -e "${DESTDIR}/METALOG" ] && \
+               if [ -e "${DESTDIR}/METALOG" ] && \
                    [ "${MKUNPRIVED}" = "no" ] ; then
                        if $do_expertmode; then
                                warning "A previous build.sh run specified -U."


Home | Main Index | Thread Index | Old Index