Makefile: Fix PACKAGE_VERSION extraction
authorW. Trevor King <wking@tremily.us>
Sat, 22 Feb 2014 19:37:36 +0000 (11:37 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Sat, 22 Feb 2014 21:43:18 +0000 (13:43 -0800)
The old method grepped for __version__ in catalyst.  That broke with
24c5352 (Initial rearrangement of the python directories, 2013-01-10),
which moved catalyst to bin/catalyst, kept the __version__ in
bin/catalyst, and added a new __version__ in catalyst/main.py.  Then
46b261e (setup.py: Add disutils-based packaging, 2013-06-05)
consolidated the __version__ definitions in catalyst/__init__.py,
removing them from bin/catalyst and catalyst/main.py.  This patch
adjusts the Makefile, invoking Python to extract catalyst.__version__
instead of grepping through the file that defines it.

Makefile

index 98accbe12b1ac1ad4315b79be22ce6b3c3afde0a..757113c5694e0cdb66e8b2ad72944f0a510fc657 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 # Copyright (C) 2011 Sebastian Pipping <sebastian@pipping.org>
 # Licensed under GPL v2 or later
 
-PACKAGE_VERSION = `fgrep '__version__=' catalyst | sed 's|^__version__="\(.*\)"$$|\1|'`
+PACKAGE_VERSION = $(shell PYTHONPATH=. python -c 'import catalyst; print(catalyst.__version__)')
 MAN_PAGE_SOURCES = $(wildcard doc/*.?.txt)
 MAN_PAGES = $(patsubst doc/%.txt,files/%,$(MAN_PAGE_SOURCES))
 MAN_PAGE_INCLUDES = doc/subarches.generated.txt doc/targets.generated.txt