Gentoo Archives: gentoo-catalyst

From: Brian Dolbec <dolsen@g.o>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] [PATCH] Makefile: Fix PACKAGE_VERSION extraction
Date: Sat, 22 Feb 2014 21:51:25
Message-Id: 20140222134636.6be7d503.dolsen@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH] Makefile: Fix PACKAGE_VERSION extraction by "W. Trevor King"
1 On Sat, 22 Feb 2014 11:37:36 -0800
2 "W. Trevor King" <wking@×××××××.us> wrote:
3
4 > The old method grepped for __version__ in catalyst. That broke with
5 > 24c5352 (Initial rearrangement of the python directories, 2013-01-10),
6 > which moved catalyst to bin/catalyst, kept the __version__ in
7 > bin/catalyst, and added a new __version__ in catalyst/main.py. Then
8 > 46b261e (setup.py: Add disutils-based packaging, 2013-06-05)
9 > consolidated the __version__ definitions in catalyst/__init__.py,
10 > removing them from bin/catalyst and catalyst/main.py. This patch
11 > adjusts the Makefile, invoking Python to extract catalyst.__version__
12 > instead of grepping through the file that defines it.
13 > ---
14 > This patch is in git://tremily.us/catalyst.git setup-py as 575419c.
15 >
16 > Makefile | 2 +-
17 > 1 file changed, 1 insertion(+), 1 deletion(-)
18 >
19 > diff --git a/Makefile b/Makefile
20 > index 98accbe..757113c 100644
21 > --- a/Makefile
22 > +++ b/Makefile
23 > @@ -1,7 +1,7 @@
24 > # Copyright (C) 2011 Sebastian Pipping <sebastian@×××××××.org>
25 > # Licensed under GPL v2 or later
26 >
27 > -PACKAGE_VERSION = `fgrep '__version__=' catalyst | sed 's|^__version__="\(.*\)"$$|\1|'`
28 > +PACKAGE_VERSION = $(shell PYTHONPATH=. python -c 'import catalyst; print(catalyst.__version__)')
29 > MAN_PAGE_SOURCES = $(wildcard doc/*.?.txt)
30 > MAN_PAGES = $(patsubst doc/%.txt,files/%,$(MAN_PAGE_SOURCES))
31 > MAN_PAGE_INCLUDES = doc/subarches.generated.txt doc/targets.generated.txt
32
33 looks fine, added and queued up right after the setup.py commit.
34
35 In git pending branch.
36
37 --
38 Brian Dolbec <dolsen>