Changeset ca1fb26a


Ignore:
Timestamp:
Aug 11, 2013, 4:36:03 PM (4 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master
Children:
f1a71c8, 441fd42, 883b421
Parents:
685cca7
git-author:
Anders Kaseorg <andersk@mit.edu> (06/20/13 12:08:41)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/11/13 16:36:03)
Message:
Be smarter about rebuilding on version number changes

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r1c22155 rca1fb26a  
    44.deps
    55/bin/
     6BUILD_VERSION.mk
    67META.yml
    78MYMETA.yml
     
    4041tester
    4142varstubs.c
     43version.c
     44version.c.new
    4245zcrypt
  • Makefile.am

    r685cca7 rca1fb26a  
    11ACLOCAL_AMFLAGS = -I m4
    22
    3 GIT_DESCRIPTION := $(if $(wildcard .git),$(shell git describe --match='barnowl-*' HEAD 2>/dev/null))
    4 GIT_FLAGS := $(if $(GIT_DESCRIPTION),-DGIT_VERSION=$(GIT_DESCRIPTION:barnowl-%=%))
     3GIT_DESCRIPTION := $(if $(wildcard $(srcdir)/.git),$(shell cd $(srcdir) && git describe --match='barnowl-*' HEAD 2>/dev/null))
     4VERSION = $(if $(GIT_DESCRIPTION),$(GIT_DESCRIPTION:barnowl-%=%),@VERSION@)
     5-include BUILD_VERSION.mk
     6
     7FORCE:
     8BUILD_VERSION.mk: $(if $(filter-out $(BUILD_VERSION),$(VERSION)),FORCE)
     9        echo 'BUILD_VERSION = $(VERSION)' > $@
    510
    611bin_PROGRAMS = bin/barnowl
     
    914endif
    1015
    11 zcrypt_SOURCES = zcrypt.c filterproc.c
     16zcrypt_SOURCES = zcrypt.c filterproc.c version.c
    1217
    1318check_PROGRAMS = bin/tester
     
    4752           -I$(top_srcdir)/libfaim/ \
    4853           -DDATADIR='"$(pkgdatadir)"' \
    49            -DBINDIR='"$(bindir)"' \
    50            $(GIT_FLAGS)
     54           -DBINDIR='"$(bindir)"'
    5155
    5256CODELIST_SRCS=message.c mainwin.c popwin.c zephyr.c messagelist.c \
     
    6468BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS)
    6569
    66 GEN_C = varstubs.c perlglue.c gmarshal_funcs.c
     70GEN_C = varstubs.c perlglue.c gmarshal_funcs.c version.c version.c.new
    6771GEN_H = owl_prototypes.h owl_prototypes.h.new gmarshal_funcs.h
    6872
     
    7074
    7175# Only copy file into place if file.new is different
    72 %: %.new
     76owl_prototypes.h version.c: %: %.new
    7377        @diff -U0 $@ $< || { \
    7478         test -f $@ && echo '$@ changed!'; \
     
    8791        $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
    8892
     93version.c.new: Makefile BUILD_VERSION.mk
     94        $(AM_V_GEN)echo 'const char *version = "$(VERSION)";' > $@
     95
    8996gmarshal_funcs.h: marshal_types
    9097        glib-genmarshal --header $< > $@
     
    96103        $(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
    97104
    98 CLEANFILES = $(BUILT_SOURCES) $(GEN_C) $(noinst_SCRIPTS) $(check_SCRIPTS)
     105CLEANFILES = $(BUILT_SOURCES) $(GEN_C) $(noinst_SCRIPTS) $(check_SCRIPTS) BUILD_VERSION.mk
    99106EXTRA_DIST = \
    100107    autogen.sh \
  • commands.c

    ra38becd rca1fb26a  
    11141114void owl_command_version(void)
    11151115{
    1116   owl_function_makemsg("BarnOwl version %s", OWL_VERSION_STRING);
     1116  owl_function_makemsg("BarnOwl version %s", version);
    11171117}
    11181118
  • functions.c

    ra38becd rca1fb26a  
    115115void owl_function_show_license(void)
    116116{
    117   const char *text;
    118 
    119   text=""
    120     "BarnOwl version " OWL_VERSION_STRING "\n"
     117  char *text = g_strdup_printf(
     118    "BarnOwl version %s\n"
    121119    "Copyright (c) 2006-2011 The BarnOwl Developers. All rights reserved.\n"
    122120    "Copyright (c) 2004 James Kretchmar. All rights reserved.\n"
     
    155153    "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n"
    156154    "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n"
    157     "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n";
     155    "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n",
     156    version);
    158157  owl_function_popless_text(text);
     158  g_free(text);
    159159}
    160160
     
    13591359void owl_function_about(void)
    13601360{
    1361   owl_function_popless_text(
    1362     "This is BarnOwl version " OWL_VERSION_STRING ".\n\n"
     1361  char *text = g_strdup_printf(
     1362    "This is BarnOwl version %s.\n\n"
    13631363    "BarnOwl is a fork of the Owl zephyr client, written and\n"
    13641364    "maintained by Alejandro Sedeno and Nelson Elhage at the\n"
     
    13791379    "This program is free software. You can redistribute it and/or\n"
    13801380    "modify under the terms of the Sleepycat License. Use the \n"
    1381     "':show license' command to display the full license\n"
    1382   );
     1381      "':show license' command to display the full license\n",
     1382      version);
     1383  owl_function_popless_text(text);
     1384  g_free(text);
    13831385}
    13841386
     
    17811783
    17821784  owl_fmtext_append_normal(&fm, "  Version: ");
    1783   owl_fmtext_append_normal(&fm, OWL_VERSION_STRING);
     1785  owl_fmtext_append_normal(&fm, version);
    17841786  owl_fmtext_append_normal(&fm, "\n");
    17851787
  • owl.c

    r120dac7 rca1fb26a  
    3636void usage(FILE *file)
    3737{
    38   fprintf(file, "Barnowl version %s\n", OWL_VERSION_STRING);
     38  fprintf(file, "Barnowl version %s\n", version);
    3939  fprintf(file, "Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>] [-t <ttyname>]\n");
    4040  fprintf(file, "  -n,--no-subs        don't load zephyr subscriptions\n");
     
    8080      break;
    8181    case 'v':
    82       printf("This is BarnOwl version %s\n", OWL_VERSION_STRING);
     82      printf("This is BarnOwl version %s\n", version);
    8383      exit(0);
    8484    case 'h':
     
    578578  /* welcome message */
    579579  owl_function_debugmsg("startup: creating splash message");
    580   owl_function_adminmsg("",
     580  char *welcome = g_strdup_printf(
    581581    "-----------------------------------------------------------------------\n"
    582     "Welcome to BarnOwl version " OWL_VERSION_STRING ".\n"
     582    "Welcome to BarnOwl version %s.\n"
    583583    "To see a quick introduction, type ':show quickstart'.                  \n"
    584584    "Press 'h' for on-line help.                                            \n"
     
    588588    "                                                                 OvO   \n"
    589589    "Please report any bugs or suggestions to bug-barnowl@mit.edu    (   )  \n"
    590     "-----------------------------------------------------------------m-m---\n"
    591   );
     590    "-----------------------------------------------------------------m-m---\n",
     591    version);
     592  owl_function_adminmsg("", welcome);
     593  g_free(welcome);
    592594
    593595  owl_function_debugmsg("startup: setting context interactive");
  • owl.h

    r120dac7 rca1fb26a  
    6464#include "window.h"
    6565
    66 #ifndef OWL_VERSION_STRING
    67 #ifdef  GIT_VERSION
    68 #define stringify(x)       __stringify(x)
    69 #define __stringify(x)     #x
    70 #define OWL_VERSION_STRING stringify(GIT_VERSION)
    71 #else
    72 #define OWL_VERSION_STRING PACKAGE_VERSION
    73 #endif
    74 #endif /* !OWL_VERSION_STRING */
     66extern const char *version;
    7567
    7668/* Feature that is being tested to redirect stderr through a pipe.
  • perlconfig.c

    r96d80e9 rca1fb26a  
    336336  }
    337337
    338   sv_setpv(get_sv("BarnOwl::VERSION", TRUE), OWL_VERSION_STRING);
     338  sv_setpv(get_sv("BarnOwl::VERSION", TRUE), version);
    339339
    340340  /* Add the system lib path to @INC */
  • zcrypt.c

    r8f335a8 rca1fb26a  
    2929#include "filterproc.h"
    3030
    31 #ifndef OWL_VERSION_STRING
    32 #ifdef  GIT_VERSION
    33 #define stringify(x)       __stringify(x)
    34 #define __stringify(x)     #x
    35 #define OWL_VERSION_STRING stringify(GIT_VERSION)
    36 #else
    37 #define OWL_VERSION_STRING PACKAGE_VERSION
    38 #endif
    39 #endif /* !OWL_VERSION_STRING */
     31extern const char *version;
    4032
    4133/* Annotate functions in which the caller owns the return value and is
     
    157149      case OPT_VERSION:
    158150        /* Version */
    159         printf("This is zcrypt version %s\n", OWL_VERSION_STRING);
     151        printf("This is zcrypt version %s\n", version);
    160152        exit(0);
    161153      case OPT_HELP:
Note: See TracChangeset for help on using the changeset viewer.