* [PATCH] add a snapshot version string to GRUB title
@ 2009-07-02 20:20 Christian Franke
2009-07-02 20:39 ` Pavel Roskin
0 siblings, 1 reply; 5+ messages in thread
From: Christian Franke @ 2009-07-02 20:20 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]
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 <franke@computer.org>
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.
[-- Attachment #2: grub2-version-info.patch --]
[-- Type: text/x-diff, Size: 4160 bytes --]
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
+/* This file is automatically generated by genversionstr.sh. DO NOT EDIT! */
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2009 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+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 <<EOF
+#ifndef GRUB_VERSION
+ #define GRUB_VERSION PACKAGE_VERSION
+#endif
+EOF
+
+else
+ # Extract most recent date string from ChangeLog.
+ # Append number of log entries for this date.
+ datestr=`
+ sed -n 's,^\(20[0-9][0-9]-[01][0-9]-[0-3][0-9]\) .*$,\1,p;1000q' $srcdir/ChangeLog \
+ | uniq -c \
+ | sed -n 's,^ *\([0-9][0-9]*\) \(20[0-9][0-9]\)-\([01][0-9]\)-\([0-3][0-9]\)$,+\2\3\4-\1,p;1q'
+ `
+
+ # get SVN revision if possible
+ svnstr=
+ if [ -d $srcdir/.svn ] ; then
+ svnstr=`
+ ( cd $srcdir && svn info ) 2> /dev/null \
+ | sed -n 's,^Revision: *\(.*\)$,-r\1,p'
+ `
+ fi
+
+ cat <<EOF
+#ifndef GRUB_VERSION
+ #define GRUB_VERSION PACKAGE_VERSION "${datestr}${svnstr}"
+#endif
+EOF
+fi
+
diff --git a/normal/main.c b/normal/main.c
index 7f6336e..a412827 100644
--- a/normal/main.c
+++ b/normal/main.c
@@ -29,6 +29,8 @@
#include <grub/reader.h>
#include <grub/menu_viewer.h>
+#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;
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] add a snapshot version string to GRUB title
2009-07-02 20:20 [PATCH] add a snapshot version string to GRUB title Christian Franke
@ 2009-07-02 20:39 ` Pavel Roskin
2009-07-02 21:51 ` Vladimir 'phcoder' Serbinenko
2009-07-03 1:51 ` BandiPat
0 siblings, 2 replies; 5+ messages in thread
From: Pavel Roskin @ 2009-07-02 20:39 UTC (permalink / raw)
To: The development of GRUB 2
On Thu, 2009-07-02 at 22:20 +0200, Christian Franke wrote:
> 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.
I can tell from my experience with other projects that such suggestions
appear when there is not enough leadership in the project, and nobody
cares about producing stable releases.
It would be better to produce named prereleases or release candidates if
we are not comfortable about releasing 1.97 right now.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] add a snapshot version string to GRUB title
2009-07-02 20:39 ` Pavel Roskin
@ 2009-07-02 21:51 ` Vladimir 'phcoder' Serbinenko
2009-07-03 1:51 ` BandiPat
1 sibling, 0 replies; 5+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-07-02 21:51 UTC (permalink / raw)
To: The development of GRUB 2
On Thu, Jul 2, 2009 at 10:39 PM, Pavel Roskin<proski@gnu.org> wrote:
> On Thu, 2009-07-02 at 22:20 +0200, Christian Franke wrote:
>> 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.
>
> I can tell from my experience with other projects that such suggestions
> appear when there is not enough leadership in the project, and nobody
> cares about producing stable releases.
I personally care of making a stable release. Unfortunately I have no
such authority. Only Marco and Okuji have.
The usefulness of such patch isn't limited to semi-fix the lack of
stable release it's also useful for developers and testers to be sure
that new version was indeed installed
>
> It would be better to produce named prereleases or release candidates if
> we are not comfortable about releasing 1.97 right now.
1.97 is a pre-release anyway. The release would be 2.00
>
> --
> Regards,
> Pavel Roskin
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] add a snapshot version string to GRUB title
2009-07-02 20:39 ` Pavel Roskin
2009-07-02 21:51 ` Vladimir 'phcoder' Serbinenko
@ 2009-07-03 1:51 ` BandiPat
2009-07-03 17:31 ` Pavel Roskin
1 sibling, 1 reply; 5+ messages in thread
From: BandiPat @ 2009-07-03 1:51 UTC (permalink / raw)
To: The development of GRUB 2
Pavel Roskin wrote:
> On Thu, 2009-07-02 at 22:20 +0200, Christian Franke wrote:
>> 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.
>
> I can tell from my experience with other projects that such suggestions
> appear when there is not enough leadership in the project, and nobody
> cares about producing stable releases.
>
> It would be better to produce named prereleases or release candidates if
> we are not comfortable about releasing 1.97 right now.
>
===========
I do think the world is ready for another stable release number, like
1.97 or 2.0, but in the mean time, I've been doing this in my build script.
echo "-- Starting Autogen.sh... --"
sed -e "s/,\[1\.96\],/,[$softversion],/" -i configure.ac
./autogen.sh
Where basically the $softversion is your svn number I label the build
as. The above replaces the 1.96 found in the title bar with "svn2383"
or whatever the svn number is at the time, so users will know what they
are using.
But again, why not put a freeze on adding things, just fix the bugs so
you can release a stable version number for those squeamish about using svn?
Regards,
Pat
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] add a snapshot version string to GRUB title
2009-07-03 1:51 ` BandiPat
@ 2009-07-03 17:31 ` Pavel Roskin
0 siblings, 0 replies; 5+ messages in thread
From: Pavel Roskin @ 2009-07-03 17:31 UTC (permalink / raw)
To: The development of GRUB 2
On Thu, 2009-07-02 at 21:51 -0400, BandiPat wrote:
> But again, why not put a freeze on adding things, just fix the bugs so
> you can release a stable version number for those squeamish about using svn?
Fine with me. I think GRUB is in a pretty good state now for a release.
Perhaps I would still add the file access patch in LUA (without the
ad-hoc multi-file operations), as LUA is not the core functionality and
it's quite useless without file operations. Having that functionality
in GRUB 1.97 would help start developing LUA programs for GRUB that
don't require a subversion snapshot.
The already posted USB patches should be reviewed and applied too, but
we should not promise full USB support in 1.97.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-07-03 17:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-02 20:20 [PATCH] add a snapshot version string to GRUB title Christian Franke
2009-07-02 20:39 ` Pavel Roskin
2009-07-02 21:51 ` Vladimir 'phcoder' Serbinenko
2009-07-03 1:51 ` BandiPat
2009-07-03 17:31 ` Pavel Roskin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.