From owner-cvs-all@FreeBSD.ORG Wed Aug 3 12:25:09 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 644DD16A41F; Wed, 3 Aug 2005 12:25:09 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id 547F343D72; Wed, 3 Aug 2005 12:25:02 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (vol75-8-82-233-239-98.fbx.proxad.net [82.233.239.98]) by postfix4-2.free.fr (Postfix) with ESMTP id 490FF31928F; Wed, 3 Aug 2005 14:25:00 +0200 (CEST) Received: by tatooine.tataz.chchile.org (Postfix, from userid 1000) id B9FA5405B; Wed, 3 Aug 2005 14:25:18 +0200 (CEST) Date: Wed, 3 Aug 2005 14:25:18 +0200 From: Jeremie Le Hen To: Alexander Leidinger Message-ID: <20050803122517.GH45385@obiwan.tataz.chchile.org> References: <20050731102343.35bc4aa9@Magellan.Leidinger.net> <20050802090717.GK14023@ip.net.ua> <20050802140536.zstn68rcgsg84g0w@netchild.homeip.net> <20050802.085239.34568854.imp@bsdimp.com> <20050803121150.gn025733y8400wk8@netchild.homeip.net> <20050803113208.GG45385@obiwan.tataz.chchile.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Yylu36WmvOXNoKYn" Content-Disposition: inline In-Reply-To: <20050803113208.GG45385@obiwan.tataz.chchile.org> User-Agent: Mutt/1.5.9i Cc: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, ru@FreeBSD.org, "M. Warner Losh" , des@des.no, grehan@FreeBSD.org Subject: Re: cvs commit: src Makefile.inc1 ObsoleteFiles.inc src/share/man/man7 build.7 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2005 12:25:09 -0000 --Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > What about making TARGET_ARCH mandatory if DESTDIR is different from "/" ? The attached patch should work. Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org > --Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mandatory_target_arch.diff" Index: Makefile.inc1 =================================================================== RCS file: /donald/repo/FreeBSD/src/Makefile.inc1,v retrieving revision 1.506 diff -u -p -u -r1.506 Makefile.inc1 --- Makefile.inc1 30 Jul 2005 18:02:20 -0000 1.506 +++ Makefile.inc1 3 Aug 2005 12:22:47 -0000 @@ -103,6 +103,9 @@ OSRELDATE!= awk '/^\#define[[:space:]]*_ OSRELDATE= 0 .endif .endif +.if defined(TARGET_ARCH) +_TARGET_ARCH_0= ${TARGET_ARCH} +.endif TARGET_ARCH?= ${MACHINE_ARCH} .if ${TARGET_ARCH} == ${MACHINE_ARCH} TARGET?= ${MACHINE} @@ -1070,10 +1073,14 @@ RM_I=-i RM_I=-v .endif -delete-old-files: -.if ${TARGET_ARCH} != ${MACHINE_ARCH} - @echo "You have to run this in a native environment!" && false +_safe_delete: +.if defined(DESTDIR) && !defined(_TARGET_ARCH_0) + @echo "Please explicitely define TARGET_ARCH when DESTDIR is defined" + @echo "and you want to check/delete old files, libs or dirs." + @false .endif + +delete-old-files: _safe_delete @echo ">>> Removing old files (only deletes safe to delete libs)" .for file in ${OLD_FILES} # Ask for every old file if the user really wants to remove it. @@ -1086,19 +1093,13 @@ delete-old-files: .endfor @echo ">>> Old files removed" -check-old-files: -.if ${TARGET_ARCH} != ${MACHINE_ARCH} - @echo "You have to run this in a native environment!" && false -.endif +check-old-files: _safe_delete @echo ">>> Checking for old files" .for file in ${OLD_FILES} @[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}" .endfor -delete-old-libs: -.if ${TARGET_ARCH} != ${MACHINE_ARCH} - @echo "You have to run this in a native environment!" && false -.endif +delete-old-libs: _safe_delete @echo ">>> Removing old libraries" @echo "${OLD_LIBS_MESSAGE}" | fmt .for file in ${OLD_LIBS} @@ -1110,19 +1111,13 @@ delete-old-libs: .endfor @echo ">>> Old libraries removed" -check-old-libs: -.if ${TARGET_ARCH} != ${MACHINE_ARCH} - @echo "You have to run this in a native environment!" && false -.endif +check-old-libs: _safe_delete @echo ">>> Checking for old libraries" .for file in ${OLD_LIBS} @[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}" .endfor -delete-old-dirs: -.if ${TARGET_ARCH} != ${MACHINE_ARCH} - @echo "You have to run this in a native environment!" && false -.endif +delete-old-dirs: _safe_delete @echo ">>> Removing old directories" .for dir in ${OLD_DIRS} # Don't fail if an old directory isn't empty. @@ -1130,10 +1125,7 @@ delete-old-dirs: .endfor @echo ">>> Old directories removed" -check-old-dirs: -.if ${TARGET_ARCH} != ${MACHINE_ARCH} - @echo "You have to run this in a native environment!" && false -.endif +check-old-dirs: _safe_delete @echo ">>> Checking for old directories" .for dir in ${OLD_DIRS} @[ ! -d "${DESTDIR}/${dir}" ] || echo "${DESTDIR}/${dir}" Index: ObsoleteFiles.inc =================================================================== RCS file: /donald/repo/FreeBSD/src/ObsoleteFiles.inc,v retrieving revision 1.7 diff -u -p -u -r1.7 ObsoleteFiles.inc --- ObsoleteFiles.inc 30 Jul 2005 18:04:17 -0000 1.7 +++ ObsoleteFiles.inc 3 Aug 2005 12:20:55 -0000 @@ -223,7 +223,7 @@ OLD_FILES+=usr/share/man/man1/sasc.1.gz OLD_FILES+=usr/share/man/man1/sgsc.1.gz OLD_FILES+=usr/share/man/man4/i386/stl.4.gz OLD_FILES+=usr/share/man/man8/raidctl.8.gz -.if ${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "sparc64" +.if ${TARGET_ARCH} != "alpha" && ${TARGET_ARCH} != "sparc64" # 20040130: libkse renamed to libpthread OLD_FILES+=usr/lib/libkse.a OLD_FILES+=usr/lib/libkse.so @@ -636,7 +636,7 @@ OLD_LIBS+=usr/lib/libpcap.so.2 OLD_LIBS+=usr/lib/libisc.so.1 # 200408XX OLD_LIBS+=usr/lib/snmp_netgraph.so.1 -.if ${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "sparc64" +.if ${TARGET_ARCH} != "alpha" && ${TARGET_ARCH} != "sparc64" # 20040130: libkse renamed to libpthread OLD_LIBS+=usr/lib/libkse.so.1 .endif --Yylu36WmvOXNoKYn--