From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MMSla-0002Lq-T8 for mharc-grub-devel@gnu.org; Thu, 02 Jul 2009 16:20:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MMSlX-0002KX-TJ for grub-devel@gnu.org; Thu, 02 Jul 2009 16:20:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MMSlP-0002HF-Q7 for grub-devel@gnu.org; Thu, 02 Jul 2009 16:20:17 -0400 Received: from [199.232.76.173] (port=48429 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMSlP-0002HA-Fp for grub-devel@gnu.org; Thu, 02 Jul 2009 16:20:11 -0400 Received: from mailout09.t-online.de ([194.25.134.84]:34462) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MMSlO-0005z4-Sw for grub-devel@gnu.org; Thu, 02 Jul 2009 16:20:11 -0400 Received: from fwd01.aul.t-online.de by mailout09.t-online.de with smtp id 1MMSlN-0003Ol-01; Thu, 02 Jul 2009 22:20:09 +0200 Received: from [10.3.2.2] (bKlcLsZHZh8Mf0E5iaWWb-PoKApi8gu2NZI9c6VGQjK1H7MO26WtLGg17+paR34gyB@[217.235.242.161]) by fwd01.aul.t-online.de with esmtp id 1MMSlD-1hUBDE0; Thu, 2 Jul 2009 22:19:59 +0200 Message-ID: <4A4D1670.3040709@t-online.de> Date: Thu, 02 Jul 2009 22:20:00 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090403 SeaMonkey/1.1.16 MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: multipart/mixed; boundary="------------020606070407000004060002" X-ID: bKlcLsZHZh8Mf0E5iaWWb-PoKApi8gu2NZI9c6VGQjK1H7MO26WtLGg17+paR34gyB X-TOI-MSGID: 795b30f9-067d-4f04-bff3-8d6f4a08893a X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH] add a snapshot version string to GRUB title X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2009 20:20:20 -0000 This is a multi-part message in MIME format. --------------020606070407000004060002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Many "GNU GRUB version 1.96" used in production are likely builds from more recent SVN snapshots. It would (IMO) be useful to have some info about the actual installed version. This patch adds a script to generate some version info from ChangeLog and (if available) from SVN. The version syntax is "PACKAGE_VERSION+DATE-N-rSVN" where DATE is the most recent date in ChangeLog and 'N' is the number of the entries for this date. If the last ChangeLog entry suggests that this is an official release, only "PACKAGE_VERSION" is used. The current string is "1.96+20090702-1-r2391" or "1.96+20090702-1" if 'svn info' is not available. The string is added to grub title only, utils are left out for now. Regards, Christian Franke 2009-07-02 Christian Franke Auto-generate a snapshot version string for GRUB title. * Makefile.in: Add targets for genversionstr.sh. Add target and dependency for grub_version.h. * configure.ac: Add genversionstr.sh to AC_CONFIG_FILES. * genversionstr.sh.in: New script. Generates GRUB_VERSION string from ChangeLog. * normal/main.c: Add include "grub_version.h". (grub_normal_init_page): Replace PACKAGE_VERSION by GRUB_VERSION in TITLE. --------------020606070407000004060002 Content-Type: text/x-diff; name="grub2-version-info.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-version-info.patch" diff --git a/Makefile.in b/Makefile.in index 3d208e7..6b56c83 100644 --- a/Makefile.in +++ b/Makefile.in @@ -419,6 +419,16 @@ gensymlist.sh: gensymlist.sh.in config.status genkernsyms.sh: genkernsyms.sh.in config.status $(SHELL) ./config.status +genversionstr.sh: genversionstr.sh.in config.status + $(SHELL) ./config.status + +# Build version string +grub_version.h: genversionstr.sh ChangeLog + $(SHELL) ./genversionstr.sh > $@ || (rm -f $@ ; exit 1) + +normal_mod-normal_main.o: grub_version.h + + .PHONY: all install install-strip uninstall clean mostlyclean distclean .PHONY: maintainer-clean info dvi dist check diff --git a/configure.ac b/configure.ac index 8b12c58..890cf3d 100644 --- a/configure.ac +++ b/configure.ac @@ -529,6 +529,6 @@ else rm -rf include/grub/machine cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null fi -AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh]) +AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh genversionstr.sh]) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) AC_OUTPUT diff --git a/genversionstr.sh.in b/genversionstr.sh.in new file mode 100644 index 0000000..6e58fb3 --- /dev/null +++ b/genversionstr.sh.in @@ -0,0 +1,77 @@ +#! /bin/sh +# +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This genversionstr.sh.in is free software; the author +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +### The configure script will replace these variables. + +srcdir=@srcdir@ + + +cat <. + */ + +EOF + + +if sed -n '2,/^20/p' $srcdir/ChangeLog \ + | grep 'configure.ac (AC_INIT): Bumped' >/dev/null 2>/dev/null +then + # Last entry documents new PACKAGE_VERSION, assume official release + + cat < /dev/null \ + | sed -n 's,^Revision: *\(.*\)$,-r\1,p' + ` + fi + + cat < #include +#include "grub_version.h" + #define GRUB_DEFAULT_HISTORY_SIZE 50 /* Read a line from the file FILE. */ @@ -375,7 +377,7 @@ grub_normal_init_page (void) { grub_uint8_t width, margin; -#define TITLE ("GNU GRUB version " PACKAGE_VERSION) +#define TITLE ("GNU GRUB version " GRUB_VERSION) width = grub_getwh () >> 8; margin = (width - (sizeof(TITLE) + 7)) / 2; --------------020606070407000004060002--