Implemented support for AddExpanderRuleToHaikuImage. Now P7zip and XZ-Utils can

be installed properly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35906 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2010-03-18 17:14:19 +00:00
parent 76ab3f88df
commit 74de61fda5
+53 -1
View File
@@ -30,7 +30,7 @@ declare availablePackagesKeys=""
# Some Packages cannot be installed,
# as they require either the source code or compiled binaries
declare packageIgnoreList='Bluetooth Development DevelopmentMin \
DevelopmentBase P7zip UserlandFS Welcome Wifi-ipw2100+fw Wifi-iprowifi2200+fw \
DevelopmentBase UserlandFS Welcome Wifi-ipw2100+fw Wifi-iprowifi2200+fw \
WifiFirmwareScriptData'
@@ -52,6 +52,10 @@ $urlLine
$sslPkgLine
$sslUrlLine
declare -a functionArgs
expanderRulesFile=`finddir B_COMMON_DATA_DIRECTORY`/expander.rules
if [ -f \${expanderRulesFile} ] ; then
expanderRulesFileExists=1
fi
function ParseFunctionArguments()
@@ -233,6 +237,49 @@ function AddUserToHaikuImage()
}
function AddExpanderRuleToHaikuImage()
{
# AddExpanderRuleToHaikuImage <mimetype> : <extension> : <list> : <extract>
# Wrapper for Jam rule
ParseFunctionArguments "\$@"
local mimetype=\${functionArgs[0]}
local extension=\${functionArgs[1]}
local list=\${functionArgs[2]}
local extract=\${functionArgs[3]}
# clean up the variables
TrimLeadingSpace mimetype
TrimEndingSpace mimetype
TrimLeadingSpace extension
TrimEndingSpace extension
TrimLeadingSpace list
TrimEndingSpace list
TrimLeadingSpace extract
TrimEndingSpace extract
local rule_raw="\${mimetype}\\t\${extension}\\t\${list}\\t\${extract}"
# reset this at every invocation
ruleFound=
if [ \${expanderRulesFileExists} ] ; then
# Check if a rule for the mimetype & extension exists.
while read line ; do
existing_rule=`echo \$line | awk '{ print \$1\$2 }'`
if [ "\${mimetype}\${extension}" == "\${existing_rule}" ] ; then
ruleFound=1
break
fi
done < "\${expanderRulesFile}"
fi
if ! [ \${expanderRulesFileExists} ] || ! [ \${ruleFound} ] ; then
# Either expander.rules does not exist or a rule for mimetype &
# extension does not exist. Output the new rule directly to it.
echo -e \${rule_raw} >> \${expanderRulesFile}
fi
}
EOF
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cat ${tmpDir}/optpkg.stage2 >> ${tmpDir}/install-optpkg.sh
@@ -531,6 +578,11 @@ function ConvertJamToBash()
if($0~/\;/) ORS="\n";
else ORS=" "; print
}
/AddExpanderRuleToHaikuImage/,/\;/{
isRule=1;
if($0~/\;/) ORS="\n";
else ORS=" "; print
}
/Exit/,/\;/{
isRule=1;
if($0~/\;/) ORS="\n";