Top distribution takes precedence on distdefs over inherited.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 24 Apr 2005 21:58:16 +0000 (21:58 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 24 Apr 2005 21:58:16 +0000 (21:58 +0000)
apps/autodist/CHANGES
apps/autodist/autodist.in
apps/autodist/doc/autodist.texi

index 9b530d367b266888e467a84e500ab7af295d5cf9..d954c0660919c7fdd5dca1b5ada00750efc4ccab 100644 (file)
@@ -1,7 +1,12 @@
-Sun Apr 24 14:11:49 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
+Sun Apr 24 21:11:49 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
 
        * Fixed undefining to actually work.
 
 
        * Fixed undefining to actually work.
 
+       * The top distribution now takes precedence on defined
+         distdefs over inherited distributions, and can override
+         defined and undefined distdefs (previously it could only
+         undefine defined but not define specificly undefined :)).
+
 Sat Apr 23 12:49:09 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
 
        * Autodist 1.2.1.
 Sat Apr 23 12:49:09 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
 
        * Autodist 1.2.1.
index fd5b1b1d06086942b955dc89e5b2a36d1178e5fe..a87f486d4dceed8c65a3e4c484ac8bac021f4471 100755 (executable)
@@ -1070,6 +1070,16 @@ ad_parse_distribution()
   ad_debug "licenseh: $licenseh"
 
   if test x$2 = xfalse; then
   ad_debug "licenseh: $licenseh"
 
   if test x$2 = xfalse; then
+    # Take rest of the stuff from top distribution
+
+    # We take precedence on defined and undefined distdefs.  Remove
+    # undefined distdefs if we have defined them.
+    for d in $defs
+    do
+      ad_debug "defining undefined $d distdef"
+      undistdefs=`echo $undistdefs | sed s/$d//g`
+    done
+
     # Get distribution name
     dname=`sed 's/^[   ]*//' < $distdir/$1 | grep -v "^#" \
       | grep "name " | cut -d' ' -f2-`
     # Get distribution name
     dname=`sed 's/^[   ]*//' < $distdir/$1 | grep -v "^#" \
       | grep "name " | cut -d' ' -f2-`
index 928432e43d25f0fbe69f301f426c93cb0d654548..393eb6a2b542dcf697878ca663af71ed2a9853a9 100644 (file)
@@ -581,13 +581,14 @@ into the distribution.  The <distfile> specifies the name of the
 inherited distribution.  If the distribution cannot be inherited Autodist
 will give an error.
 
 inherited distribution.  If the distribution cannot be inherited Autodist
 will give an error.
 
-The 'inherit' will inherit the following information from the distribution:
-distdefs, undefines, includes, excludes and noprocess.  Other information
-will not be inherited.  If the inherited distribution inherits other
-distributions, they will also be inherited automatically.  User should be
-careful when inheriting distributions as it may be possible to create an
-infinite recursion.  The Autodist would allow for this and not detect this
-error.  Zero or more 'inherit' directives may be set for distribution.
+The 'inherit' will inherit the following information from the 
+distribution: distdefs, undefines, includes, excludes and noprocesses.  
+Other information will not be inherited.  If the inherited distribution 
+inherits other distributions, they will also be inherited automatically.  
+User should be careful when inheriting distributions as it may be possible 
+to create an infinite recursion.  The Autodist would allow for this and 
+not detect this error.  Zero or more 'inherit' directives may be set for 
+distribution.
 
 Example:
 @example
 
 Example:
 @example
@@ -600,6 +601,21 @@ Will inherit distributions 'common', 'client' and 'toolkit' into this
 distribution.  All distdefs, undefines, includes, excludes and noprocesses
 from these distributions are now also part this distribution.
 
 distribution.  All distdefs, undefines, includes, excludes and noprocesses
 from these distributions are now also part this distribution.
 
+The distribution that is being prepared or packaged take precedence when 
+defining distdefs that were specificly undefined in the inherited 
+distribution.  This means that if the inherited distribution specificly 
+undefines a distdefs but the inheriting distribution (one being prepared 
+or packaged) specificly defines it, the distdef will be defined.  
+Similarly, if the inherited distribution defines a distdef but the 
+inheriting distribution undefines it, the distdef will be undefined.  
+Note that, this precedence works only in the top distribution (the one 
+being prepared or packaged).  If the inherited distribution inherits other 
+distributions, all distdefs (defined and specificly undefined) will be 
+inherited as is.  This means that if one inherited distribution defines a 
+distdef that other inherited distribution distdef undefines, it will be 
+undefined.  However, the top distribution can then override them if 
+needed.
+
 
 @section Directive: define <symbol>
 
 
 @section Directive: define <symbol>