diff options
author | Philipp A. Hartmann <philipp.hartmann@offis.de> | 2012-08-27 15:15:34 +0200 |
---|---|---|
committer | Philipp A. Hartmann <philipp.hartmann@offis.de> | 2012-08-27 15:22:51 +0200 |
commit | 2dd28bf5f7a18e45af8285696bdbc31f6207f83c (patch) | |
tree | 948ef74f6b156cfc571a2fc6cd3c6774920e7256 /Makefile.PL | |
parent | 17d16e7457fdd768cfcb303662b237d26487640e (diff) | |
download | pristine-tar-2dd28bf5f7a18e45af8285696bdbc31f6207f83c.tar.gz pristine-tar-2dd28bf5f7a18e45af8285696bdbc31f6207f83c.tar.bz2 pristine-tar-2dd28bf5f7a18e45af8285696bdbc31f6207f83c.zip |
Makefile.PL: avoid in-place editing with sed
This patch avoids the usage of the in-place editing option '-i' of sed for
version number extraction from debian/changelog to update pristine-tar.spec.
The -i option is not supported by all versions of sed (e.g. not by SunOS 5.9
nor by NetBSD 6.0). Additionally, the exact syntax may vary. E.g., the sed
of Mac OS X requires -i to be followed by a suffix, which is added to the
original filename to create a backup file. The portable solution is to avoid
the in-place editing altogether and to instead write first to a temporary
file, which is then moved back to the original filename.
In addition to the use of a temporary file, the rule has been changed to
use the PERLRUN variable to invoke the correct perl interpreter and a
dependency on debian/changelog (the phonyness of the rule could be
dropped as well).
Signed-off-by: Philipp A. Hartmann <philipp.hartmann@offis.de>
Diffstat (limited to 'Makefile.PL')
-rwxr-xr-x | Makefile.PL | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile.PL b/Makefile.PL index cd4f31b..e28b636 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -38,8 +38,9 @@ extra_clean: rm -f *.1 zgz/zgz $(MAKE) clean -C pit/suse-bzip2 PREFIX=$(PREFIX) -pristine-tar.spec: - sed -i "s/Version:.*/Version: $$(perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)/" pristine-tar.spec +pristine-tar.spec: debian/changelog + sed "s/Version:.*/Version: $$($(PERLRUN) -e '$$_=<>;print m/\((.*?)\)/'<$<)/" \ + $@ > $@.new && $(MV) $@.new $@ .PHONY: pristine-tar.spec } |