summaryrefslogtreecommitdiff
path: root/Makefile.PL
diff options
context:
space:
mode:
authorPhilipp A. Hartmann <philipp.hartmann@offis.de>2012-08-27 15:15:34 +0200
committerPhilipp A. Hartmann <philipp.hartmann@offis.de>2012-08-27 15:22:51 +0200
commit2dd28bf5f7a18e45af8285696bdbc31f6207f83c (patch)
tree948ef74f6b156cfc571a2fc6cd3c6774920e7256 /Makefile.PL
parent17d16e7457fdd768cfcb303662b237d26487640e (diff)
downloadpristine-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-xMakefile.PL5
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
}