From patchwork Tue Nov 24 15:21:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Nieder X-Patchwork-Id: 62488 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAOFCPmh013820 for ; Tue, 24 Nov 2009 15:12:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933274AbZKXPKe (ORCPT ); Tue, 24 Nov 2009 10:10:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933248AbZKXPKb (ORCPT ); Tue, 24 Nov 2009 10:10:31 -0500 Received: from mail-yx0-f187.google.com ([209.85.210.187]:55520 "EHLO mail-yx0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933363AbZKXPKK (ORCPT ); Tue, 24 Nov 2009 10:10:10 -0500 Received: by yxe17 with SMTP id 17so5704299yxe.33 for ; Tue, 24 Nov 2009 07:10:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=dSKurS8jv3uURisFK8SuI0/4knvmAi7ahiNKV+ZiD6k=; b=Wvnd8YUNQB9I26E6xkvFL6SwK73Cj/1hIOwnl11dkHDyzE0yJbs/kpMuIfN3uVMErn rZOqqoT8ldsPHCMujk4hxgvitNBhMP3+ik/MvYp1iM1cUbwiEYFszzFkQAQHMOY80sPp eKbIYRQ0aG1EY+nByGodj0gU8s7rsQYd2to2I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=adglyrm5K+YXwSBQN4igNzLECjzoCm0BtmoEFS0DcN26tS6W4qtjPn7VS82ytJpHX1 R+3xf8/T5eQwdcq2kXoZysh11D3hDPaSG/K08yt52HBH86tPlFqLiwneBapkLo8vdESA QqTjRgluhF6TrhIvAYfaN67h8iQkA42f7Pxv4= Received: by 10.101.62.9 with SMTP id p9mr4547432ank.149.1259075414407; Tue, 24 Nov 2009 07:10:14 -0800 (PST) Received: from progeny.tock (c-98-212-3-231.hsd1.il.comcast.net [98.212.3.231]) by mx.google.com with ESMTPS id 21sm2414578yxe.19.2009.11.24.07.10.13 (version=SSLv3 cipher=RC4-MD5); Tue, 24 Nov 2009 07:10:13 -0800 (PST) Date: Tue, 24 Nov 2009 09:21:56 -0600 From: Jonathan Nieder To: Michal Marek Cc: linux-kbuild@vger.kernel.org, maximilian attems , Sam Ravnborg , Frans Pop Subject: [PATCH v3 3/3] scripts/package: deb-pkg: use fakeroot if available Message-ID: <20091124152156.GD14731@progeny.tock> References: <20091014064622.GA8711@progeny.tock> <20091014071627.GA6256@merkur.ravnborg.org> <200910141159.03799.elendil@planet.nl> <20091014110331.GZ28231@baikonur.stro.at> <20091015133139.GA6718@progeny.tock> <20091015133532.GB6718@progeny.tock> <4B0BC306.9010009@suse.cz> <20091124150904.GA14731@progeny.tock> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091124150904.GA14731@progeny.tock> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 5c0b43a..62fcc3a 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -77,10 +77,27 @@ clean-files += $(objtree)/binkernel.spec # Deb target # --------------------------------------------------------------------------- +quiet_cmd_builddeb = BUILDDEB + cmd_builddeb = set -e; \ + test `id -u` = 0 || \ + test -n "$(KBUILD_PKG_ROOTCMD)" || { \ + which fakeroot >/dev/null 2>&1 && \ + KBUILD_PKG_ROOTCMD="fakeroot -u"; \ + } || { \ + echo; \ + echo "builddeb must be run as root (or using fakeroot)."; \ + echo "KBUILD_PKG_ROOTCMD is unset and fakeroot not found."; \ + echo "Try setting KBUILD_PKG_ROOTCMD to a command to acquire"; \ + echo "root privileges (e.g., 'fakeroot -u' or 'sudo')."; \ + false; \ + } && \ + \ + $$KBUILD_PKG_ROOTCMD $(CONFIG_SHELL) \ + $(srctree)/scripts/package/builddeb + deb-pkg: FORCE $(MAKE) KBUILD_SRC= - $(KBUILD_PKG_ROOTCMD) $(CONFIG_SHELL) \ - $(srctree)/scripts/package/builddeb + $(call cmd,builddeb) clean-dirs += $(objtree)/debian/