* PATCH: Report branch/revsion info from "gcc -v"
@ 2007-07-30 16:43 H.J. Lu
2007-07-30 17:29 ` Andreas Schwab
0 siblings, 1 reply; 15+ messages in thread
From: H.J. Lu @ 2007-07-30 16:43 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 934 bytes --]
"gcc -v" only reports very limited branch/revsion info like:
4.3.0 20070730 (experimental)
4.2.1 20070702 (prerelease)
There may be quite a few checkins within a day. "4.3.0 20070730"
doesn't tell which revision it is. However, you can't expand the
revision number from subversion checkout command. I am enclosing 2
patches to get the branch info and the revision number from
contrib/gcc_update. I now get
# /usr/gcc-4.3/bin/gcc -v
...
gcc version 4.3.0 20070724 (experimental) [trunk revision 126877]
# /usr/gcc-4.2/bin/gcc -v
...
gcc version 4.2.1 20070710 (prerelease) [gcc-4_2-branch revision 126519]
# /usr/gcc-4.1-redhat/bin/gcc -v
...
gcc version 4.1.3 20070626 (Red Hat 4.1.2-14) [redhat/gcc-4_1-branch revision 126103]
If you don't use contrib/gcc_update to update gcc source tree, nothing
is changed. I have been using them for more than a year like:
http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg01061.html
H.J.
[-- Attachment #2: gcc-rev-3.patch --]
[-- Type: text/plain, Size: 2469 bytes --]
2006-01-23 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (REVISION): New.
(REVISION_c): New.
(REVISION_s): New.
(version.o): Also depend on $(REVISION). Add
-DREVISION=$(REVISION_s).
* version.c (version_string): Add REVISION.
--- gcc/Makefile.in.rev 2006-01-23 10:00:31.000000000 -0800
+++ gcc/Makefile.in 2006-01-23 10:29:38.000000000 -0800
@@ -710,11 +710,18 @@ TM_H = $(GTM_H) insn-constants.h in
BASEVER := $(srcdir)/BASE-VER # 4.x.y
DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
+REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX]
BASEVER_c := $(shell cat $(BASEVER))
DEVPHASE_c := $(shell cat $(DEVPHASE))
DATESTAMP_c := $(shell cat $(DATESTAMP))
+ifeq (,$(wildcard $(REVISION)))
+REVISION :=
+else
+REVISION_c := $(shell cat $(REVISION))
+endif
+
version := $(BASEVER_c)
# For use in version.c - double quoted strings, with appropriate
@@ -726,6 +733,12 @@ BASEVER_s := "\"$(BASEVER_c)\""
DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
+ifdef REVISION_c
+REVISION_s := "\"$(if $(DEVPHASE_c), $(REVISION_c))\""
+else
+REVISION_s :=
+endif
+
# Shorthand variables for dependency lists.
TARGET_H = $(TM_H) target.h insn-modes.h
MACHMODE_H = machmode.h mode-classes.def insn-modes.h
@@ -1742,9 +1755,10 @@ options.o: options.c $(CONFIG_H) $(SYSTE
dumpvers: dumpvers.c
-version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
+version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
-DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
+ -DREVISION=$(REVISION_s) \
-DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION)
gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
--- gcc/version.c.rev 2005-11-04 14:14:18.000000000 -0800
+++ gcc/version.c 2006-01-23 10:30:19.000000000 -0800
@@ -20,6 +20,7 @@
const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
/* The complete version string, assembled from several pieces.
- BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */
+ BASEVER, DATESTAMP, DEVPHASE, and REVISION are defined by the
+ Makefile. */
-const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX;
+const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX REVISION;
[-- Attachment #3: gcc-update-rev-6.patch --]
[-- Type: text/plain, Size: 647 bytes --]
Index: contrib/gcc_update
===================================================================
--- contrib/gcc_update (revision 116299)
+++ contrib/gcc_update (working copy)
@@ -255,8 +255,18 @@ if [ $? -ne 0 ]; then
exit 1
fi
+rm -f info.$$ LAST_UPDATED gcc/REVISION
+
+svn info > info.$$
+revision=`grep Revision: info.$$ | awk '{ print $2 }'`
+branch=`grep URL: info.$$ | sed -e "s,.*/gcc/,,g" | sed -e "s,branches/,,"`
{
date
- echo "`TZ=UTC date` (revision `svnversion .`)"
+ echo "`TZ=UTC date` (revision $revision)"
} > LAST_UPDATED
+
+rm -f info.$$
+
+echo "[$branch revision $revision]" > gcc/REVISION
+
touch_files_reexec
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-07-30 16:43 PATCH: Report branch/revsion info from "gcc -v" H.J. Lu
@ 2007-07-30 17:29 ` Andreas Schwab
2007-07-30 17:57 ` H.J. Lu
0 siblings, 1 reply; 15+ messages in thread
From: Andreas Schwab @ 2007-07-30 17:29 UTC (permalink / raw)
To: H.J. Lu; +Cc: gcc-patches
"H.J. Lu" <hjl@lucon.org> writes:
> --- gcc/Makefile.in.rev 2006-01-23 10:00:31.000000000 -0800
> +++ gcc/Makefile.in 2006-01-23 10:29:38.000000000 -0800
> @@ -710,11 +710,18 @@ TM_H = $(GTM_H) insn-constants.h in
> BASEVER := $(srcdir)/BASE-VER # 4.x.y
> DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
> DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
> +REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX]
>
> BASEVER_c := $(shell cat $(BASEVER))
> DEVPHASE_c := $(shell cat $(DEVPHASE))
> DATESTAMP_c := $(shell cat $(DATESTAMP))
>
> +ifeq (,$(wildcard $(REVISION)))
> +REVISION :=
s/REVISION/REVISION_c/ ?
> Index: contrib/gcc_update
> ===================================================================
> --- contrib/gcc_update (revision 116299)
> +++ contrib/gcc_update (working copy)
> @@ -255,8 +255,18 @@ if [ $? -ne 0 ]; then
> exit 1
> fi
>
> +rm -f info.$$ LAST_UPDATED gcc/REVISION
> +
> +svn info > info.$$
> +revision=`grep Revision: info.$$ | awk '{ print $2 }'`
> +branch=`grep URL: info.$$ | sed -e "s,.*/gcc/,,g" | sed -e "s,branches/,,"`
revision=`svn info | awk '/Revision:/ { print $2 }'`
branch=`svn info | sed -ne "/URL:/ { s,.*/gcc/,,g; s,branches/,,; p; }"`
(Net savings of 2 processes :-) )
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-07-30 17:29 ` Andreas Schwab
@ 2007-07-30 17:57 ` H.J. Lu
2007-07-30 18:07 ` Andreas Schwab
0 siblings, 1 reply; 15+ messages in thread
From: H.J. Lu @ 2007-07-30 17:57 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gcc-patches
On Mon, Jul 30, 2007 at 07:08:40PM +0200, Andreas Schwab wrote:
> "H.J. Lu" <hjl@lucon.org> writes:
>
> > --- gcc/Makefile.in.rev 2006-01-23 10:00:31.000000000 -0800
> > +++ gcc/Makefile.in 2006-01-23 10:29:38.000000000 -0800
> > @@ -710,11 +710,18 @@ TM_H = $(GTM_H) insn-constants.h in
> > BASEVER := $(srcdir)/BASE-VER # 4.x.y
> > DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
> > DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
> > +REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX]
> >
> > BASEVER_c := $(shell cat $(BASEVER))
> > DEVPHASE_c := $(shell cat $(DEVPHASE))
> > DATESTAMP_c := $(shell cat $(DATESTAMP))
> >
> > +ifeq (,$(wildcard $(REVISION)))
> > +REVISION :=
>
> s/REVISION/REVISION_c/ ?
Thanks. I am enclosing updated patch.
>
> > Index: contrib/gcc_update
> > ===================================================================
> > --- contrib/gcc_update (revision 116299)
> > +++ contrib/gcc_update (working copy)
> > @@ -255,8 +255,18 @@ if [ $? -ne 0 ]; then
> > exit 1
> > fi
> >
> > +rm -f info.$$ LAST_UPDATED gcc/REVISION
> > +
> > +svn info > info.$$
> > +revision=`grep Revision: info.$$ | awk '{ print $2 }'`
> > +branch=`grep URL: info.$$ | sed -e "s,.*/gcc/,,g" | sed -e "s,branches/,,"`
>
> revision=`svn info | awk '/Revision:/ { print $2 }'`
> branch=`svn info | sed -ne "/URL:/ { s,.*/gcc/,,g; s,branches/,,; p; }"`
>
> (Net savings of 2 processes :-) )
>
Will "svn info" be fast for all cases? I was trying to avoid calling
"svn info" twice if it might be slow for some users.
H.J.
----
2006-01-23 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (REVISION): New.
(REVISION_c): New.
(REVISION_s): New.
(version.o): Also depend on $(REVISION). Add
-DREVISION=$(REVISION_s).
* version.c (version_string): Add REVISION.
--- gcc/Makefile.in.rev 2006-01-23 10:00:31.000000000 -0800
+++ gcc/Makefile.in 2006-01-23 10:29:38.000000000 -0800
@@ -710,11 +710,18 @@ TM_H = $(GTM_H) insn-constants.h in
BASEVER := $(srcdir)/BASE-VER # 4.x.y
DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
+REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX]
BASEVER_c := $(shell cat $(BASEVER))
DEVPHASE_c := $(shell cat $(DEVPHASE))
DATESTAMP_c := $(shell cat $(DATESTAMP))
+ifeq (,$(wildcard $(REVISION)))
+REVISION_c :=
+else
+REVISION_c := $(shell cat $(REVISION))
+endif
+
version := $(BASEVER_c)
# For use in version.c - double quoted strings, with appropriate
@@ -726,6 +733,12 @@ BASEVER_s := "\"$(BASEVER_c)\""
DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
+ifdef REVISION_c
+REVISION_s := "\"$(if $(DEVPHASE_c), $(REVISION_c))\""
+else
+REVISION_s :=
+endif
+
# Shorthand variables for dependency lists.
TARGET_H = $(TM_H) target.h insn-modes.h
MACHMODE_H = machmode.h mode-classes.def insn-modes.h
@@ -1742,9 +1755,10 @@ options.o: options.c $(CONFIG_H) $(SYSTE
dumpvers: dumpvers.c
-version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
+version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
-DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
+ -DREVISION=$(REVISION_s) \
-DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION)
gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
--- gcc/version.c.rev 2005-11-04 14:14:18.000000000 -0800
+++ gcc/version.c 2006-01-23 10:30:19.000000000 -0800
@@ -20,6 +20,7 @@
const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
/* The complete version string, assembled from several pieces.
- BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */
+ BASEVER, DATESTAMP, DEVPHASE, and REVISION are defined by the
+ Makefile. */
-const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX;
+const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX REVISION;
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-07-30 17:57 ` H.J. Lu
@ 2007-07-30 18:07 ` Andreas Schwab
2007-07-30 18:27 ` H.J. Lu
0 siblings, 1 reply; 15+ messages in thread
From: Andreas Schwab @ 2007-07-30 18:07 UTC (permalink / raw)
To: H.J. Lu; +Cc: gcc-patches
"H.J. Lu" <hjl@lucon.org> writes:
> Will "svn info" be fast for all cases?
"svn info" just needs to examine the head of .svn/entries, so it is
always fast.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-07-30 18:07 ` Andreas Schwab
@ 2007-07-30 18:27 ` H.J. Lu
2007-08-06 21:15 ` Ralf Wildenhues
2007-08-09 9:09 ` Manuel López-Ibáñez
0 siblings, 2 replies; 15+ messages in thread
From: H.J. Lu @ 2007-07-30 18:27 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 333 bytes --]
On Mon, Jul 30, 2007 at 07:29:32PM +0200, Andreas Schwab wrote:
> "H.J. Lu" <hjl@lucon.org> writes:
>
> > Will "svn info" be fast for all cases?
>
> "svn info" just needs to examine the head of .svn/entries, so it is
> always fast.
>
Here are updated patches. I found "svn info" is much faster than
"svnversion".
Thanks.
H.J.
[-- Attachment #2: gcc-rev-4.patch --]
[-- Type: text/plain, Size: 2469 bytes --]
2006-01-23 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (REVISION): New.
(REVISION_c): New.
(REVISION_s): New.
(version.o): Also depend on $(REVISION). Add
-DREVISION=$(REVISION_s).
* version.c (version_string): Add REVISION.
--- gcc/Makefile.in.rev 2006-01-23 10:00:31.000000000 -0800
+++ gcc/Makefile.in 2006-01-23 10:29:38.000000000 -0800
@@ -710,11 +710,18 @@ TM_H = $(GTM_H) insn-constants.h in
BASEVER := $(srcdir)/BASE-VER # 4.x.y
DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
+REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX]
BASEVER_c := $(shell cat $(BASEVER))
DEVPHASE_c := $(shell cat $(DEVPHASE))
DATESTAMP_c := $(shell cat $(DATESTAMP))
+ifeq (,$(wildcard $(REVISION)))
+REVISION_c :=
+else
+REVISION_c := $(shell cat $(REVISION))
+endif
+
version := $(BASEVER_c)
# For use in version.c - double quoted strings, with appropriate
@@ -726,6 +733,12 @@ BASEVER_s := "\"$(BASEVER_c)\""
DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
+ifdef REVISION_c
+REVISION_s := "\"$(if $(DEVPHASE_c), $(REVISION_c))\""
+else
+REVISION_s :=
+endif
+
# Shorthand variables for dependency lists.
TARGET_H = $(TM_H) target.h insn-modes.h
MACHMODE_H = machmode.h mode-classes.def insn-modes.h
@@ -1742,9 +1755,10 @@ options.o: options.c $(CONFIG_H) $(SYSTE
dumpvers: dumpvers.c
-version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
+version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
-DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
+ -DREVISION=$(REVISION_s) \
-DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION)
gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
--- gcc/version.c.rev 2005-11-04 14:14:18.000000000 -0800
+++ gcc/version.c 2006-01-23 10:30:19.000000000 -0800
@@ -20,6 +20,7 @@
const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
/* The complete version string, assembled from several pieces.
- BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */
+ BASEVER, DATESTAMP, DEVPHASE, and REVISION are defined by the
+ Makefile. */
-const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX;
+const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX REVISION;
[-- Attachment #3: gcc-update-rev-7.patch --]
[-- Type: text/plain, Size: 791 bytes --]
2007-07-30 H.J. Lu <hongjiu.lu@intel.com>
Andreas Schwab <schwab@suse.de>
* gcc_update: Use "svn info" for revision number. Create
gcc/REVISION with branch name and revision number.
Index: contrib/gcc_update
===================================================================
--- contrib/gcc_update (revision 127065)
+++ contrib/gcc_update (working copy)
@@ -258,8 +258,15 @@ if [ $? -ne 0 ]; then
exit 1
fi
+rm -f LAST_UPDATED gcc/REVISION
+
+revision=`svn info | awk '/Revision:/ { print $2 }'`
+branch=`svn info | sed -ne "/URL:/ { s,.*/gcc/,,g; s,branches/,,; p; }"`
{
date
- echo "`TZ=UTC date` (revision `svnversion .`)"
+ echo "`TZ=UTC date` (revision $revision)"
} > LAST_UPDATED
+
+echo "[$branch revision $revision]" > gcc/REVISION
+
touch_files_reexec
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-07-30 18:27 ` H.J. Lu
@ 2007-08-06 21:15 ` Ralf Wildenhues
2007-08-08 14:22 ` H.J. Lu
2007-08-09 9:09 ` Manuel López-Ibáñez
1 sibling, 1 reply; 15+ messages in thread
From: Ralf Wildenhues @ 2007-08-06 21:15 UTC (permalink / raw)
To: H.J. Lu; +Cc: Andreas Schwab, gcc-patches
Hello,
A nit:
* H.J. Lu wrote on Mon, Jul 30, 2007 at 08:17:45PM CEST:
> --- contrib/gcc_update (revision 127065)
> +++ contrib/gcc_update (working copy)
> @@ -258,8 +258,15 @@ if [ $? -ne 0 ]; then
> exit 1
> fi
>
> +rm -f LAST_UPDATED gcc/REVISION
> +
> +revision=`svn info | awk '/Revision:/ { print $2 }'`
> +branch=`svn info | sed -ne "/URL:/ { s,.*/gcc/,,g; s,branches/,,; p; }"`
POSIX sed requires that there be newlines both right after the `{' and
instead of each of the `;' inside the braced commands. No, I don't know
whether there exists an interesting sed implementation that needs this
(but autotools have been cleaned of this issue AFAIK).
> {
> date
> - echo "`TZ=UTC date` (revision `svnversion .`)"
> + echo "`TZ=UTC date` (revision $revision)"
> } > LAST_UPDATED
Cheers,
RalfS
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-08-06 21:15 ` Ralf Wildenhues
@ 2007-08-08 14:22 ` H.J. Lu
2007-08-08 20:58 ` Ralf Wildenhues
0 siblings, 1 reply; 15+ messages in thread
From: H.J. Lu @ 2007-08-08 14:22 UTC (permalink / raw)
To: Ralf Wildenhues, Andreas Schwab, gcc-patches
On Mon, Aug 06, 2007 at 11:15:41PM +0200, Ralf Wildenhues wrote:
> Hello,
>
> A nit:
>
> * H.J. Lu wrote on Mon, Jul 30, 2007 at 08:17:45PM CEST:
> > --- contrib/gcc_update (revision 127065)
> > +++ contrib/gcc_update (working copy)
> > @@ -258,8 +258,15 @@ if [ $? -ne 0 ]; then
> > exit 1
> > fi
> >
> > +rm -f LAST_UPDATED gcc/REVISION
> > +
> > +revision=`svn info | awk '/Revision:/ { print $2 }'`
> > +branch=`svn info | sed -ne "/URL:/ { s,.*/gcc/,,g; s,branches/,,; p; }"`
>
> POSIX sed requires that there be newlines both right after the `{' and
> instead of each of the `;' inside the braced commands. No, I don't know
> whether there exists an interesting sed implementation that needs this
> (but autotools have been cleaned of this issue AFAIK).
>
> > {
> > date
> > - echo "`TZ=UTC date` (revision `svnversion .`)"
> > + echo "`TZ=UTC date` (revision $revision)"
> > } > LAST_UPDATED
>
Like this?
H.J.
2007-08-08 H.J. Lu <hongjiu.lu@intel.com>
Andreas Schwab <schwab@suse.de>
* gcc_update: Use "svn info" for revision number. Create
gcc/REVISION with branch name and revision number.
Index: contrib/gcc_update
===================================================================
--- contrib/gcc_update (revision 127293)
+++ contrib/gcc_update (working copy)
@@ -255,8 +255,19 @@ if [ $? -ne 0 ]; then
exit 1
fi
+rm -f LAST_UPDATED gcc/REVISION
+
+revision=`svn info | awk '/Revision:/ { print $2 }'`
+branch=`svn info | sed -ne "/URL:/ {\
+s,.*/gcc/,,g
+s,branches/,,
+p
+}"`
{
date
- echo "`TZ=UTC date` (revision `svnversion .`)"
+ echo "`TZ=UTC date` (revision $revision)"
} > LAST_UPDATED
+
+echo "[$branch revision $revision]" > gcc/REVISION
+
touch_files_reexec
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-08-08 14:22 ` H.J. Lu
@ 2007-08-08 20:58 ` Ralf Wildenhues
2007-08-08 22:35 ` H.J. Lu
0 siblings, 1 reply; 15+ messages in thread
From: Ralf Wildenhues @ 2007-08-08 20:58 UTC (permalink / raw)
To: H.J. Lu; +Cc: Andreas Schwab, gcc-patches
Hello,
* H.J. Lu wrote on Wed, Aug 08, 2007 at 04:21:57PM CEST:
> On Mon, Aug 06, 2007 at 11:15:41PM +0200, Ralf Wildenhues wrote:
> >
> > POSIX sed requires that there be newlines both right after the `{' and
> > instead of each of the `;' inside the braced commands. No, I don't know
> > whether there exists an interesting sed implementation that needs this
> > (but autotools have been cleaned of this issue AFAIK).
> Like this?
Yes, except you should also drop the backslash in this line:
> +branch=`svn info | sed -ne "/URL:/ {\
because otherwise sed won't ever see the newline. It's ok portability-
wise if you'd like to indent the lines of the sed script for readability.
Thanks,
Ralf
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-08-08 20:58 ` Ralf Wildenhues
@ 2007-08-08 22:35 ` H.J. Lu
2007-08-09 7:39 ` Ralf Wildenhues
2007-08-16 18:36 ` Alexandre Oliva
0 siblings, 2 replies; 15+ messages in thread
From: H.J. Lu @ 2007-08-08 22:35 UTC (permalink / raw)
To: Ralf Wildenhues, Andreas Schwab, gcc-patches
On Wed, Aug 08, 2007 at 10:58:02PM +0200, Ralf Wildenhues wrote:
> Hello,
>
> * H.J. Lu wrote on Wed, Aug 08, 2007 at 04:21:57PM CEST:
> > On Mon, Aug 06, 2007 at 11:15:41PM +0200, Ralf Wildenhues wrote:
> > >
> > > POSIX sed requires that there be newlines both right after the `{' and
> > > instead of each of the `;' inside the braced commands. No, I don't know
> > > whether there exists an interesting sed implementation that needs this
> > > (but autotools have been cleaned of this issue AFAIK).
>
> > Like this?
>
> Yes, except you should also drop the backslash in this line:
>
> > +branch=`svn info | sed -ne "/URL:/ {\
>
> because otherwise sed won't ever see the newline. It's ok portability-
> wise if you'd like to indent the lines of the sed script for readability.
>
Here is a new one. OK to install?
H.J.
---
2007-08-08 H.J. Lu <hongjiu.lu@intel.com>
Andreas Schwab <schwab@suse.de>
* gcc_update: Use "svn info" for revision number. Create
gcc/REVISION with branch name and revision number.
Index: contrib/gcc_update
===================================================================
--- contrib/gcc_update (revision 127304)
+++ contrib/gcc_update (working copy)
@@ -255,8 +255,19 @@ if [ $? -ne 0 ]; then
exit 1
fi
+rm -f LAST_UPDATED gcc/REVISION
+
+revision=`svn info | awk '/Revision:/ { print $2 }'`
+branch=`svn info | sed -ne "/URL:/ {
+s,.*/gcc/,,g
+s,branches/,,
+p
+}"`
{
date
- echo "`TZ=UTC date` (revision `svnversion .`)"
+ echo "`TZ=UTC date` (revision $revision)"
} > LAST_UPDATED
+
+echo "[$branch revision $revision]" > gcc/REVISION
+
touch_files_reexec
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-08-08 22:35 ` H.J. Lu
@ 2007-08-09 7:39 ` Ralf Wildenhues
2007-08-16 18:36 ` Alexandre Oliva
1 sibling, 0 replies; 15+ messages in thread
From: Ralf Wildenhues @ 2007-08-09 7:39 UTC (permalink / raw)
To: H.J. Lu; +Cc: Andreas Schwab, gcc-patches
Hello,
* H.J. Lu wrote on Thu, Aug 09, 2007 at 12:34:30AM CEST:
>
> Here is a new one. OK to install?
FWIW, looks good to me, but I can't approve the patch.
Cheers,
Ralf
> 2007-08-08 H.J. Lu <hongjiu.lu@intel.com>
> Andreas Schwab <schwab@suse.de>
>
> * gcc_update: Use "svn info" for revision number. Create
> gcc/REVISION with branch name and revision number.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-08-08 22:35 ` H.J. Lu
2007-08-09 7:39 ` Ralf Wildenhues
@ 2007-08-16 18:36 ` Alexandre Oliva
2007-08-16 19:18 ` H.J. Lu
1 sibling, 1 reply; 15+ messages in thread
From: Alexandre Oliva @ 2007-08-16 18:36 UTC (permalink / raw)
To: H.J. Lu; +Cc: Ralf Wildenhues, Andreas Schwab, gcc-patches
On Aug 8, 2007, "H.J. Lu" <hjl@lucon.org> wrote:
> 2007-08-08 H.J. Lu <hongjiu.lu@intel.com>
> Andreas Schwab <schwab@suse.de>
> * gcc_update: Use "svn info" for revision number. Create
> gcc/REVISION with branch name and revision number.
Ok, thanks.
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-08-16 18:36 ` Alexandre Oliva
@ 2007-08-16 19:18 ` H.J. Lu
2007-08-16 20:50 ` Alexandre Oliva
0 siblings, 1 reply; 15+ messages in thread
From: H.J. Lu @ 2007-08-16 19:18 UTC (permalink / raw)
To: Alexandre Oliva; +Cc: Ralf Wildenhues, Andreas Schwab, gcc-patches
On Thu, Aug 16, 2007 at 03:36:16PM -0300, Alexandre Oliva wrote:
> On Aug 8, 2007, "H.J. Lu" <hjl@lucon.org> wrote:
>
> > 2007-08-08 H.J. Lu <hongjiu.lu@intel.com>
> > Andreas Schwab <schwab@suse.de>
>
> > * gcc_update: Use "svn info" for revision number. Create
> > gcc/REVISION with branch name and revision number.
>
> Ok, thanks.
>
Done. This is the second patch which will give
[hjl@gnu-26 build-x86_64-linux]$ ./gcc/xgcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
...
Thread model: posix
gcc version 4.3.0 20070815 (experimental) [trunk revision 127516]
OK to install?
Thanks.
H.J.
-----
2006-01-23 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (REVISION): New.
(REVISION_c): New.
(REVISION_s): New.
(version.o): Also depend on $(REVISION). Add
-DREVISION=$(REVISION_s).
* version.c (version_string): Add REVISION.
--- gcc/Makefile.in.rev 2006-01-23 10:00:31.000000000 -0800
+++ gcc/Makefile.in 2006-01-23 10:29:38.000000000 -0800
@@ -710,11 +710,18 @@ TM_H = $(GTM_H) insn-constants.h in
BASEVER := $(srcdir)/BASE-VER # 4.x.y
DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
+REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX]
BASEVER_c := $(shell cat $(BASEVER))
DEVPHASE_c := $(shell cat $(DEVPHASE))
DATESTAMP_c := $(shell cat $(DATESTAMP))
+ifeq (,$(wildcard $(REVISION)))
+REVISION_c :=
+else
+REVISION_c := $(shell cat $(REVISION))
+endif
+
version := $(BASEVER_c)
# For use in version.c - double quoted strings, with appropriate
@@ -726,6 +733,12 @@ BASEVER_s := "\"$(BASEVER_c)\""
DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
+ifdef REVISION_c
+REVISION_s := "\"$(if $(DEVPHASE_c), $(REVISION_c))\""
+else
+REVISION_s :=
+endif
+
# Shorthand variables for dependency lists.
TARGET_H = $(TM_H) target.h insn-modes.h
MACHMODE_H = machmode.h mode-classes.def insn-modes.h
@@ -1742,9 +1755,10 @@ options.o: options.c $(CONFIG_H) $(SYSTE
dumpvers: dumpvers.c
-version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
+version.o: version.c version.h $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
-DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
+ -DREVISION=$(REVISION_s) \
-DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION)
gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
--- gcc/version.c.rev 2005-11-04 14:14:18.000000000 -0800
+++ gcc/version.c 2006-01-23 10:30:19.000000000 -0800
@@ -20,6 +20,7 @@
const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
/* The complete version string, assembled from several pieces.
- BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */
+ BASEVER, DATESTAMP, DEVPHASE, and REVISION are defined by the
+ Makefile. */
-const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX;
+const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX REVISION;
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-08-16 19:18 ` H.J. Lu
@ 2007-08-16 20:50 ` Alexandre Oliva
2007-08-16 21:07 ` H.J. Lu
0 siblings, 1 reply; 15+ messages in thread
From: Alexandre Oliva @ 2007-08-16 20:50 UTC (permalink / raw)
To: H.J. Lu; +Cc: Ralf Wildenhues, Andreas Schwab, gcc-patches
On Aug 16, 2007, "H.J. Lu" <hjl@lucon.org> wrote:
> 2006-01-23 H.J. Lu <hongjiu.lu@intel.com>
> * Makefile.in (REVISION): New.
> (REVISION_c): New.
> (REVISION_s): New.
> (version.o): Also depend on $(REVISION). Add
> -DREVISION=$(REVISION_s).
This is ok
> * version.c (version_string): Add REVISION.
I'm not sure I can approve this. Although it looks obvious enough,
it's a new feature, and I'm not sure it's a consensus that it's
desirable. As in, in the absence of approval from a global
maintainer, put it in at your own risk ;-)
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-08-16 20:50 ` Alexandre Oliva
@ 2007-08-16 21:07 ` H.J. Lu
0 siblings, 0 replies; 15+ messages in thread
From: H.J. Lu @ 2007-08-16 21:07 UTC (permalink / raw)
To: Alexandre Oliva; +Cc: Ralf Wildenhues, Andreas Schwab, gcc-patches
On Thu, Aug 16, 2007 at 05:50:22PM -0300, Alexandre Oliva wrote:
> On Aug 16, 2007, "H.J. Lu" <hjl@lucon.org> wrote:
>
> > 2006-01-23 H.J. Lu <hongjiu.lu@intel.com>
>
> > * Makefile.in (REVISION): New.
> > (REVISION_c): New.
> > (REVISION_s): New.
> > (version.o): Also depend on $(REVISION). Add
> > -DREVISION=$(REVISION_s).
>
> This is ok
>
> > * version.c (version_string): Add REVISION.
>
> I'm not sure I can approve this. Although it looks obvious enough,
> it's a new feature, and I'm not sure it's a consensus that it's
> desirable. As in, in the absence of approval from a global
> maintainer, put it in at your own risk ;-)
>
I haven't heard objections from any global maintainers. I am checking
it in at my own risk.
Thanks.
H.J.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: PATCH: Report branch/revsion info from "gcc -v"
2007-07-30 18:27 ` H.J. Lu
2007-08-06 21:15 ` Ralf Wildenhues
@ 2007-08-09 9:09 ` Manuel López-Ibáñez
1 sibling, 0 replies; 15+ messages in thread
From: Manuel López-Ibáñez @ 2007-08-09 9:09 UTC (permalink / raw)
To: H.J. Lu; +Cc: Andreas Schwab, gcc-patches
On 30/07/07, H.J. Lu <hjl@lucon.org> wrote:
> On Mon, Jul 30, 2007 at 07:29:32PM +0200, Andreas Schwab wrote:
> > "H.J. Lu" <hjl@lucon.org> writes:
> >
> > > Will "svn info" be fast for all cases?
> >
> > "svn info" just needs to examine the head of .svn/entries, so it is
> > always fast.
> >
>
> Here are updated patches. I found "svn info" is much faster than
> "svnversion".
>
That is because they are not the same thing at all. "svn info" will
only give you the base revision of the current directory (not even the
files in that directory). On the other hand, svnversion gives you a
lot more information: it will tell you if the working copy has been
modified (M), if there are outdated parts (files, directories) with
different base revisions, if there are parts of your working copy that
are switched to a branch.
They are different tools and they give you different information.
You just need to have a clear idea of what you really want to get.
Cheers,
Manuel.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2007-08-16 21:07 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-30 16:43 PATCH: Report branch/revsion info from "gcc -v" H.J. Lu
2007-07-30 17:29 ` Andreas Schwab
2007-07-30 17:57 ` H.J. Lu
2007-07-30 18:07 ` Andreas Schwab
2007-07-30 18:27 ` H.J. Lu
2007-08-06 21:15 ` Ralf Wildenhues
2007-08-08 14:22 ` H.J. Lu
2007-08-08 20:58 ` Ralf Wildenhues
2007-08-08 22:35 ` H.J. Lu
2007-08-09 7:39 ` Ralf Wildenhues
2007-08-16 18:36 ` Alexandre Oliva
2007-08-16 19:18 ` H.J. Lu
2007-08-16 20:50 ` Alexandre Oliva
2007-08-16 21:07 ` H.J. Lu
2007-08-09 9:09 ` Manuel López-Ibáñez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).