Moved the optionalpackage P7zip's code for creating expander.rules into a new

rule AddExpanderRuleToHaikuImage.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35720 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia 2010-03-02 14:41:06 +00:00
parent 1487898473
commit ce811940ba
2 changed files with 41 additions and 9 deletions

View File

@ -856,6 +856,43 @@ rule AddGroupToHaikuImage group : gid : members
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) {

View File

@ -823,16 +823,11 @@ if [ IsOptionalHaikuImagePackageAdded P7zip ] {
:
;
}
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 ;
}
}