Linux-KBuild Archive on lore.kernel.org
 help / color / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: "Zheng, Jiajia" <jiajia.zheng@intel.com>
Cc: "Guy, Wey-Yi W" <wey-yi.w.guy@intel.com>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: "make rpm" failed with parameter "--scm-only"
Date: Thu, 15 Jul 2010 10:42:33 +0200
Message-ID: <20100715084233.GA5835@sepie.suse.cz> (raw)
In-Reply-To: <A24AE1FFE7AEC5489F83450EE98351BF1BD77643B1@shsmsx502.ccr.corp.intel.com>

On Thu, Jul 15, 2010 at 11:23:19AM +0800, Zheng, Jiajia wrote:
> Hi Marek,
> 
> This is jiajia, Intel Wireless QA. 
> When I was compiling iwlwifi-2.6, "make rpm" failed. 
> 
> # make rpm
> make clean
> set -e; cd ..; ln -sf /usr/src/iwlwifi-2.6 kernel-2.6.35rc4wl
> /bin/sh /usr/src/iwlwifi-2.6/scripts/setlocalversion --scm-only > /usr/src/iwlwifi-2.6/.scmversion
> cat: .scmversion: input file is output file
> make[1]: *** [rpm] Error 1
> make: *** [rpm] Error 2
> 
> If the "--scm-only" parameter is removed from iwlwifi-2.6/scripts/package/Makefile, "make rpm" works. 
> 
> I noticed that it was introduced by commit#09155120cf0ffe6f0c8aba3aa625831405b65996.

Ah crap :-/. The following patch should fix it. BTW, if you remove the
--scm-only option and use the LOCALVERSION mechanism, then the resulting
kernel release string will have the localversion twice.

From 1df62f9175665a0573fe9708cb8604584a9b7bd5 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz>
Date: Thu, 15 Jul 2010 10:36:37 +0200
Subject: [PATCH] kbuild: Fix make rpm

make rpm was broken by commit 0915512:
make clean
set -e; cd ..; ln -sf /usr/src/iwlwifi-2.6 kernel-2.6.35rc4wl
/bin/sh /usr/src/iwlwifi-2.6/scripts/setlocalversion --scm-only >
/usr/src/iwlwifi-2.6/.scmversion
cat: .scmversion: input file is output file
make[1]: *** [rpm] Error 1

Reported-by: "Zheng, Jiajia" <jiajia.zheng@intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 3a681ef..d2c29b6 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -44,7 +44,7 @@ rpm-pkg rpm: $(objtree)/kernel.spec FORCE
 	fi
 	$(MAKE) clean
 	$(PREV) ln -sf $(srctree) $(KERNELPATH)
-	$(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --scm-only > $(objtree)/.scmversion
+	$(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion
 	$(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
 	$(PREV) rm $(KERNELPATH)
 	rm -f $(objtree)/.scmversion
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index d6a866e..951b067 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -10,13 +10,13 @@
 #
 
 usage() {
-	echo "Usage: $0 [--scm-only] [srctree]" >&2
+	echo "Usage: $0 [--save-scmversion] [srctree]" >&2
 	exit 1
 }
 
 scm_only=false
 srctree=.
-if test "$1" = "--scm-only"; then
+if test "$1" = "--save-scmversion"; then
 	scm_only=true
 	shift
 fi
@@ -131,7 +131,10 @@ collect_files()
 }
 
 if $scm_only; then
-	scm_version
+	if test ! -e .scmversion; then
+		res=$(scm_version)
+		echo "$res" >.scmversion
+	fi
 	exit
 fi
 

       reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <A24AE1FFE7AEC5489F83450EE98351BF1BD77643B1@shsmsx502.ccr.corp.intel.com>
2010-07-15  8:42 ` Michal Marek [this message]
2010-07-20 13:28   ` Michal Marek
2010-07-21  1:30     ` Zheng, Jiajia
2010-07-21 13:42       ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100715084233.GA5835@sepie.suse.cz \
    --to=mmarek@suse.cz \
    --cc=jiajia.zheng@intel.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wey-yi.w.guy@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-KBuild Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kbuild/0 linux-kbuild/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kbuild linux-kbuild/ https://lore.kernel.org/linux-kbuild \
		linux-kbuild@vger.kernel.org
	public-inbox-index linux-kbuild

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kbuild


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git