Don't fail hard if package_version does not exist
authorRon <ron@debian.org>
Fri, 10 May 2013 22:03:03 +0000 (07:33 +0930)
committerRon <ron@debian.org>
Fri, 10 May 2013 22:03:03 +0000 (07:33 +0930)
There's currently at least one way that people can legitimately get a
tarball that doesn't include it, via the gitweb snapshots, so create
it rather than considering that an error to be manually fixed.

Makefile.am
Makefile.unix

index e22abfa..b128541 100644 (file)
@@ -171,6 +171,9 @@ $(top_srcdir)/configure.ac: force
            dist-* | dist | distcheck | distclean) _arg=release ;; \
        esac; \
        if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
+           if [ ! -e $(top_srcdir)/package_version ]; then \
+               echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
+           fi; \
            . $(top_srcdir)/package_version || exit 1; \
            [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
        fi; \
index 84244bf..7d37995 100644 (file)
@@ -116,7 +116,11 @@ celt/celt.o: CFLAGS += -DPACKAGE_VERSION='$(PACKAGE_VERSION)'
 celt/celt.o: package_version
 
 package_version: force
-       @./update_version || true
+       @if [ -x ./update_version ]; then \
+               ./update_version || true; \
+       elif [ ! -e ./package_version ]; then \
+               echo 'PACKAGE_VERSION="unknown"' > ./package_version; \
+       fi
 
 force: