[haiku-commits] r35720 - haiku/trunk/build/jam

  • From: mattmadia@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 2 Mar 2010 15:41:06 +0100 (CET)

Author: mmadia
Date: 2010-03-02 15:41:06 +0100 (Tue, 02 Mar 2010)
New Revision: 35720
Changeset: http://dev.haiku-os.org/changeset/35720/haiku

Modified:
   haiku/trunk/build/jam/ImageRules
   haiku/trunk/build/jam/OptionalPackages
Log:
Moved the optionalpackage P7zip's code for creating expander.rules into a new 
rule AddExpanderRuleToHaikuImage.


Modified: haiku/trunk/build/jam/ImageRules
===================================================================
--- haiku/trunk/build/jam/ImageRules    2010-03-02 13:30:31 UTC (rev 35719)
+++ haiku/trunk/build/jam/ImageRules    2010-03-02 14:41:06 UTC (rev 35720)
@@ -856,6 +856,43 @@
        AddEntryToHaikuImageUserGroupFile <haiku-image>group : $(entry) ;
 }
 
+rule AddEntryToHaikuImageExpanderRuleFile file : entry
+{
+       local allEntries 
+               = [ on $(file) return $(HAIKU_IMAGE_EXPANDER_RULES_ENTRIES) ] ;
+
+       if $(allEntries) {
+               allEntries = $(allEntries)!$(entry) ;
+       } else {
+               allEntries = $(entry) ;
+
+               Always $(file) ;
+               MakeLocate $(file) : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ;
+               BuildHaikuImageExpanderRules $(file) ;
+               AddFilesToHaikuImage common etc : $(file) ;
+       }
+
+       HAIKU_IMAGE_EXPANDER_RULES_ENTRIES on $(file) = $(allEntries) ;
+}
+
+actions BuildHaikuImageExpanderRules
+{
+       echo -e "$(HAIKU_IMAGE_EXPANDER_RULES_ENTRIES)" | tr '!' '\n' > $(1)
+}
+
+rule AddExpanderRuleToHaikuImage mimetype : extension : list : extract
+{
+       #AddExpanderRuleToHaikuImage <mimetype> : <extension> : <list> : 
<extract>
+
+       if ! $(mimetype) || ! $(extension) || ! $(list) || ! $(extract) {
+               Exit "Invalid expander rule specification passed to 
AddExpanderRule." ;
+       }
+
+       local entry = 
"\\\"$(mimetype)\\\"\\\t$(extension)\\\t\\\"$(list)\\\"\\\t\\\"$(extract)\\\"" ;
+       AddEntryToHaikuImageExpanderRuleFile <haiku-image>expander.rules
+               : $(entry) ;
+}
+
 rule AddOptionalPackageDescriptionToHaikuImage file : searchPath
 {
        if $(searchPath) {

Modified: haiku/trunk/build/jam/OptionalPackages
===================================================================
--- haiku/trunk/build/jam/OptionalPackages      2010-03-02 13:30:31 UTC (rev 
35719)
+++ haiku/trunk/build/jam/OptionalPackages      2010-03-02 14:41:06 UTC (rev 
35720)
@@ -823,16 +823,11 @@
                                :
                        ;
                }
+               AddExpanderRuleToHaikuImage "application/x-7z-compressed" : .7z 
+                       : "7za l \\0045s" 
+                       : "7za x -y \\0045s" 
+               ;
 
-               actions BuildHaikuImageExpanderRules
-               {
-                       echo -e "\"application/x-7z-compressed\"\t.7z\t\"7za l 
\0045s\"\t\"7za x -y \0045s\"" > $(1)
-               }
-
-               Always expander.rules ;
-               MakeLocate expander.rules : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) 
;
-               BuildHaikuImageExpanderRules expander.rules ;
-               AddFilesToHaikuImage home config etc : expander.rules ;
        }
 }
 


Other related posts:

  • » [haiku-commits] r35720 - haiku/trunk/build/jam - mattmadia