monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] package_revision.txt getting "unknown" when it shouldn'


From: Richard Levitte - VMS Whacker
Subject: [Monotone-devel] package_revision.txt getting "unknown" when it shouldn't?
Date: Mon, 06 Dec 2004 21:48:12 +0100 (CET)

I noticed the addition of package_revision.txt, and thought that was a
great idea, and was at the same time a bit disappointed at the way it
was handled.  I thought the idea would be that a distribution (made
with "make dist", for example) would carry the revision information
with it, so a compile outside of a monotone work directory would still
be identified with information about the place in history it comes
from.

The attached change does that.  If noone complains, I'll commit it
tomorrow evening.

Cheers,
Richard

-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.

-- 
Richard Levitte                         address@hidden
                                        http://richard.levitte.org/

"When I became a man I put away childish things, including
 the fear of childishness and the desire to be very grown up."
                                                -- C.S. Lewis
# 
# patch "Makefile.am"
#  from [e830d35e955c9d602cf8f34e9d7cbceeb5e1150e]
#    to [2b95fff55960f9e1af012976f96c6358208078ca]
# 
--- Makefile.am
+++ Makefile.am
@@ -233,6 +233,7 @@
              tests/atconfig.in \
              tests/atlocal.in  \
             package.m4 \
+            package_revision.txt package_full_revision.txt \
              $(wildcard m4/*.m4)
 
 MAKEINFOFLAGS=-I $(top_builddir)
@@ -316,19 +317,18 @@
 $(srcdir)/MT/revision:
        true
 package_revision.txt: $(srcdir)/MT/revision
-       if [ ! -f $< ]; then \
-         echo "unknown" > $@;        \
-       else                          \
-         cp $< $@;          \
-       fi
+       if [ -f $< ]; then cp $< $@; fi
+       if [ ! -f $@ ]; then echo "unknown" > $@; fi
 package_revision.h: package_revision.txt txt2c Makefile
        ./txt2c --strip-trailing $< package_revision >$@
 
 .PHONY: package_full_revision.txt
 package_full_revision.txt:
-       (cd $(srcdir) && $(top_builddir)/monotone status) >$@ \
-       || (cd $(srcdir) && monotone status) >$@ \
-       || echo "unknown" >$@
+       (cd $(srcdir) && $(top_builddir)/monotone status) >address@hidden \
+       || (cd $(srcdir) && monotone status) >address@hidden \
+       || rm -f address@hidden; \
+       if [ -f address@hidden ]; then mv address@hidden $@; fi; \
+       if [ ! -f $@ ]; then echo "unknown" >$@; fi
 package_full_revision.h: package_full_revision.txt txt2c Makefile
        ./txt2c $< package_full_revision >$@
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]