From 72e15be581fe84afacf876dbe775a1a6cc2bbca3 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 1 Jun 2007 09:17:16 +0000 Subject: [PATCH] Added prereq directive. --- apps/autodist/CHANGES | 3 +++ apps/autodist/autodist.in | 9 +++++++++ apps/autodist/doc/autodist.texi | 14 ++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/apps/autodist/CHANGES b/apps/autodist/CHANGES index a14e56a..73d44ff 100644 --- a/apps/autodist/CHANGES +++ b/apps/autodist/CHANGES @@ -2,6 +2,9 @@ Thu May 31 23:34:00 EEST 2007 Pekka Riikonen * Autodist 1.3.2. + * Added 'prereq' directive to support encforcment of Autodist + version. + * Added support for providing extra parameters to autodist that are passed to the hook scripts. User can specify whatever extra parameter they want. diff --git a/apps/autodist/autodist.in b/apps/autodist/autodist.in index 517aae7..e4388ab 100755 --- a/apps/autodist/autodist.in +++ b/apps/autodist/autodist.in @@ -1182,6 +1182,15 @@ ad_parse_distribution() ad_fatal "Distribution '$1' is not declared" fi + # Get and enforce prereq version + prereq=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ + | grep "prereq " | cut -d' ' -f2- | sort | uniq` + if test '!' -z $prereq; then + if [[ $ver < $prereq ]]; then + ad_fatal "Autodist $prereq or newer is required for distribution $1" + fi + fi + # Get inherited inhs=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "inherit " | cut -d' ' -f2 | sort | uniq` diff --git a/apps/autodist/doc/autodist.texi b/apps/autodist/doc/autodist.texi index cdb4848..aadb62f 100644 --- a/apps/autodist/doc/autodist.texi +++ b/apps/autodist/doc/autodist.texi @@ -579,6 +579,20 @@ Note that, the current header must match exactly the header used in files. Otherwise the replacement will not be complete. +@section Directive: prereq + +The 'prereq' may be used to enforce the Autodist version. If the Autodist +version used to process the distribution is older than the version +specified with 'prereq' the Autodist will fail. + +Example: +@example +prereq 1.3.2 +@end example + +Will require Autodist 1.3.2 or newer for this distribution. + + @section Directive: inherit The Autodist provides inheritance of distributions. The 'inherit' -- 2.24.0