From patchwork Tue May 3 21:27:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Sharma X-Patchwork-Id: 751752 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p43LWBjH017409 for ; Tue, 3 May 2011 21:32:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755146Ab1ECVcK (ORCPT ); Tue, 3 May 2011 17:32:10 -0400 Received: from outmail004.snc4.facebook.com ([66.220.144.136]:53028 "EHLO mx-out.facebook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754957Ab1ECVcK (ORCPT ); Tue, 3 May 2011 17:32:10 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 03 May 2011 21:32:11 +0000 (UTC) X-Greylist: delayed 300 seconds by postgrey-1.27 at vger.kernel.org; Tue, 03 May 2011 17:32:09 EDT Received: from [10.47.65.39] ([10.47.65.39:45785] helo=facebook.com) by mta014.snc4.facebook.com (envelope-from ) (ecelerity 2.2.2.45 r(37388)) with ESMTP id 09/85-11236-C2370CD4; Tue, 03 May 2011 14:27:08 -0700 Received: from dev1756.snc6.facebook.com (localhost.localdomain [127.0.0.1]) by dev1756.snc6.facebook.com (Postfix) with ESMTP id DA855918335; Tue, 3 May 2011 14:27:08 -0700 (PDT) Received: (from asharma@localhost) by dev1756.snc6.facebook.com (8.13.8/8.13.8/Submit) id p43LR6hm028962; Tue, 3 May 2011 14:27:06 -0700 X-Authentication-Warning: dev1756.snc6.facebook.com: asharma set sender to asharma@fb.com using -f Date: Tue, 3 May 2011 14:27:06 -0700 From: Arun Sharma To: linux-kbuild@vger.kernel.org Subject: make rpm-pkg and version mismatch Message-ID: <20110503212706.GA26044@dev1756.snc6.facebook.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org make rpm-pkg produces files that look like: kernel-2.6.39rc5-2.x86_64.rpm However, uname -r produces 2.6.39rc5 (-2 is missing). This differs from how some of the distributors are packaging the kernel. Their setup includes %{release} in uname -r. One way to achive that is: Rinse and repeat in all other places that refer to KERNELRELEASE but want KERNELVERSION. Is there a simpler way to do this? -Arun --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -170,4 +170,8 @@ else fi fi +# Append the RPM release +release=`. ./scripts/mkversion` +res="${res}-${release}" + But then, I have to go back and remove the %{release} in a number of places: --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -24,9 +24,12 @@ fi PROVIDES="$PROVIDES kernel-$KERNELRELEASE" __KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-/_/g"` +# Remove the -%{release} from __KERNELRELEASE +__KERNELVERSION=`echo $__KERNELRELEASE | sed -e "s/-[^-]*$//"` + echo "Name: kernel" echo "Summary: The Linux Kernel" -echo "Version: $__KERNELRELEASE" +echo "Version: $__KERNELVERSION" # we need to determine the NEXT version number so that uname and # rpm -q will agree echo "Release: `. $srctree/scripts/mkversion`"