From: Ben Pfaff Date: Sat, 26 Sep 2009 04:14:31 +0000 (-0700) Subject: perl-module: Additional fixes for Perl version number on PSPP autobuilder. X-Git-Tag: build49^0 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=5f4930cf00f1e88353b4e06baed71fb8c668cd16 perl-module: Additional fixes for Perl version number on PSPP autobuilder. Commit 30f21302 "perl-module: Tolerate minor PSPP version number differences" tried to improve the behavior of the PSPP Perl module when the PSPP version number includes a suffix such as -build40. But it didn't entirely work, since it overlooked some uses of $(VERSION) in perl-module/automake.mk. This commit fixes those too. --- diff --git a/acinclude.m4 b/acinclude.m4 index a3275a32..307ce149 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -34,6 +34,13 @@ AC_DEFUN([PSPP_PERL], if test "$PERL" != no && $PERL -e 'require 5.005_03;'; then :; else PSPP_REQUIRED_PREREQ([Perl 5.005_03 (or later)]) fi + + # The PSPP autobuilder appends a build number to the PSPP version number, + # e.g. "0.7.2-build40". But Perl won't parse version numbers that contain + # anything other than digits and periods, so "-build" causes an error. So we + # define $(VERSION_FOR_PERL) that drops everything from the hyphen onward. + VERSION_FOR_PERL=`echo "$VERSION" | sed 's/-.*//'` + AC_SUBST([VERSION_FOR_PERL]) ]) dnl Check that libplot is available. diff --git a/perl-module/automake.mk b/perl-module/automake.mk index 9c30cef6..d329080d 100644 --- a/perl-module/automake.mk +++ b/perl-module/automake.mk @@ -28,7 +28,7 @@ perl-module/pspp-module-config: Makefile perl-module/Makefile: perl-module/Makefile.PL perl-module/pspp-module-config cd perl-module && $(PERL) Makefile.PL PREFIX=$(prefix) -perl-module/PSPP-Perl-$(VERSION).tar.gz: $(module_sources) +perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz: $(module_sources) $(RM) $@ cd perl-module && $(MAKE) $(AM_MAKEFLAGS) tardist @@ -47,7 +47,7 @@ perl_module_tarball: fi ; \ done \ fi - $(MAKE) $(AM_MAKEFLAGS) module-make perl-module/PSPP-Perl-$(VERSION).tar.gz + $(MAKE) $(AM_MAKEFLAGS) module-make perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz ALL_LOCAL += perl_module_tarball @@ -66,7 +66,7 @@ perl_module_CLEAN: CLEAN_LOCAL += perl_module_CLEAN CLEANFILES += \ - perl-module/PSPP-Perl-$(VERSION).tar.gz \ + perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz \ perl-module/pspp-module-config \ perl-module/const-c.inc \ perl-module/const-xs.inc diff --git a/src/libpspp/automake.mk b/src/libpspp/automake.mk index c7992b46..7cd5bbfa 100644 --- a/src/libpspp/automake.mk +++ b/src/libpspp/automake.mk @@ -89,7 +89,7 @@ src/libpspp/version.c: $(top_srcdir)/AUTHORS Makefile echo " Generated by src/libpspp/automake.mk --- Do not edit.">> $@ echo "" >> $@ echo " The following line is for the benefit of the perl module" >>$@ - echo "\$$VERSION='`echo '$(VERSION)' | sed 's/-.*//'`';" >> $@ + echo "\$$VERSION='$(VERSION_FOR_PERL)';" >> $@ echo "*/" >> $@ echo "#include \"version.h\"" >> $@ echo "const char bare_version[] = \"@VERSION@\";" >> $@