[haiku-commits] Re: r35830 - in haiku/trunk: . build/jam

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 13 Mar 2010 12:02:13 +0100

On 2010-03-13 at 09:07:21 [+0100], Matt Madia <mattmadia@xxxxxxxxx> wrote:
> Is this along the lines of what you were thinking?
> ... Though, it does require OptionalPackageDependencies to be included
> before adding any packages.

This is because you removed the AddOptionalHaikuImagePackages invocation in 
OptionalPackageDependencies.

Index: build/jam/ImageRules
===================================================================
--- build/jam/ImageRules        (revision 35826)
+++ build/jam/ImageRules        (working copy)
@@ -757,10 +757,13 @@
 {
        local package ;
        for package in $(packages) {
-               if ! [ on $(package) return $(HAIKU_OPTIONAL_PACKAGE_ADDED) ] {
+               if ! [ IsOptionalHaikuImagePackageAdded $(package) ] {

This change is incorrect, since IsOptionalHaikuImagePackageAdded has the side 
effect of marking the package as existent. I.e. if you invoked 
"AddOptionalPackagesToHaikuImage Foo" in your UserBuildConfig, the build 
system wouldn't complain that "Foo" does not exist.

                        HAIKU_OPTIONAL_PACKAGE_ADDED on $(package) = 1 ;
                        HAIKU_ADDED_OPTIONAL_PACKAGES += $(package) ;
                }
+               local dependencies = [ on $(package) 
+                       return $(HAIKU_OPTIONAL_PACKAGE_DEPENDENCIES) ] ;
+               AddOptionalHaikuImagePackages $(dependencies) ;
        }
 }
 
@@ -780,9 +783,7 @@
 
 rule OptionalPackageDependencies package : dependencies
 {
-       if [ IsOptionalHaikuImagePackageAdded $(package) ] {
-               AddOptionalHaikuImagePackages $(dependencies) ;
-       }

This part should remain (after the new line). The 
IsOptionalHaikuImagePackageAdded was not quite correct, though (well, since a 
dependency is declared for it, the package apparently exists); as above 
HAIKU_OPTIONAL_PACKAGE_ADDED should be checked instead.

+       HAIKU_OPTIONAL_PACKAGE_DEPENDENCIES on $(package) = $(dependencies) ;
 }
 
 rule InstallSourceArchive file : url

CU, Ingo

Other related posts: