Added prereq directive.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 1 Jun 2007 09:17:16 +0000 (09:17 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 1 Jun 2007 09:17:16 +0000 (09:17 +0000)
apps/autodist/CHANGES
apps/autodist/autodist.in
apps/autodist/doc/autodist.texi

index a14e56ab6f4dd6a46c12d75669cc4ef47683a1f7..73d44ff54e6665262cb7ea26ecaa4fe1fbc493e5 100644 (file)
@@ -2,6 +2,9 @@ Thu May 31 23:34:00 EEST 2007 Pekka Riikonen <priikone@silcnet.org>
 
        * 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.
index 517aae779c55401f42ae1d2437e4ae0d26de0442..e4388ab0a4fb9fbc74b1af3485e12dec28556597 100755 (executable)
@@ -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`
index cdb4848191d9f72afcd01c39d3be81851b8e669c..aadb62fca86dad87e06d086aa9c9c8895298ef26 100644 (file)
@@ -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 <version>
+
+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 <distfile>
 
 The Autodist provides inheritance of distributions.  The 'inherit'