Whitespace cleanup. No functional change.
This commit is contained in:
parent
cf2f912782
commit
7e1e5bb6ca
@ -78,17 +78,17 @@ function ParseFunctionArguments()
|
|||||||
# ParseFunctionArguments <args>
|
# ParseFunctionArguments <args>
|
||||||
# Parse arguments for Jam wrapper functions into an array.
|
# Parse arguments for Jam wrapper functions into an array.
|
||||||
IN="\$@"
|
IN="\$@"
|
||||||
OIFS=\$IFS
|
OIFS=\$IFS
|
||||||
IFS=":"
|
IFS=":"
|
||||||
|
|
||||||
local count=0
|
local count=0
|
||||||
functionArgs=( )
|
functionArgs=( )
|
||||||
for x in \$IN
|
for x in \$IN
|
||||||
do
|
do
|
||||||
functionArgs[\${count}]="\${x}"
|
functionArgs[\${count}]="\${x}"
|
||||||
((count++))
|
((count++))
|
||||||
done
|
done
|
||||||
IFS=\$OIFS
|
IFS=\$OIFS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -98,11 +98,11 @@ function TrimLeadingSpace()
|
|||||||
eval local text='\$'"\$1"
|
eval local text='\$'"\$1"
|
||||||
local _outvar="\$1"
|
local _outvar="\$1"
|
||||||
|
|
||||||
local length=\${#text}
|
local length=\${#text}
|
||||||
((length--))
|
((length--))
|
||||||
if [ "\${text:0:1}" == ' ' ] ; then
|
if [ "\${text:0:1}" == ' ' ] ; then
|
||||||
text=\${text#' '}
|
text=\${text#' '}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
eval \$_outvar="'\$text'"
|
eval \$_outvar="'\$text'"
|
||||||
}
|
}
|
||||||
@ -114,11 +114,11 @@ function TrimEndingSpace()
|
|||||||
eval local text='\$'"\$1"
|
eval local text='\$'"\$1"
|
||||||
local _outvar="\$1"
|
local _outvar="\$1"
|
||||||
|
|
||||||
local length=\${#text}
|
local length=\${#text}
|
||||||
((length--))
|
((length--))
|
||||||
if [ "\${text:\$length}" == ' ' ] ; then
|
if [ "\${text:\$length}" == ' ' ] ; then
|
||||||
text=\${text%' '}
|
text=\${text%' '}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
eval \$_outvar="'\$text'"
|
eval \$_outvar="'\$text'"
|
||||||
}
|
}
|
||||||
@ -235,19 +235,19 @@ function AddSymlinkToHaikuImage()
|
|||||||
{
|
{
|
||||||
# AddSymlinkToHaikuImage <dir tokens> : <link target> [ : <link name> ]
|
# AddSymlinkToHaikuImage <dir tokens> : <link target> [ : <link name> ]
|
||||||
# Wrapper for Jam rule
|
# Wrapper for Jam rule
|
||||||
ParseFunctionArguments "\$@"
|
ParseFunctionArguments "\$@"
|
||||||
|
|
||||||
local dirTokens="/boot/\${functionArgs[0]}"
|
local dirTokens="/boot/\${functionArgs[0]}"
|
||||||
TrimLeadingSpace dirTokens
|
TrimLeadingSpace dirTokens
|
||||||
TrimEndingSpace dirTokens
|
TrimEndingSpace dirTokens
|
||||||
dirTokens=\${dirTokens//' '/\/}
|
dirTokens=\${dirTokens//' '/\/}
|
||||||
|
|
||||||
local linkTarget="\${functionArgs[1]}"
|
local linkTarget="\${functionArgs[1]}"
|
||||||
TrimLeadingSpace linkTarget
|
TrimLeadingSpace linkTarget
|
||||||
TrimEndingSpace linkTarget
|
TrimEndingSpace linkTarget
|
||||||
|
|
||||||
local linkName="\${functionArgs[2]}"
|
local linkName="\${functionArgs[2]}"
|
||||||
TrimLeadingSpace linkName
|
TrimLeadingSpace linkName
|
||||||
TrimEndingSpace linkName
|
TrimEndingSpace linkName
|
||||||
|
|
||||||
mkdir -p "\${dirTokens}"
|
mkdir -p "\${dirTokens}"
|
||||||
@ -267,27 +267,27 @@ function AddUserToHaikuImage()
|
|||||||
ParseFunctionArguments "\$@"
|
ParseFunctionArguments "\$@"
|
||||||
|
|
||||||
local user=\${functionArgs[0]}
|
local user=\${functionArgs[0]}
|
||||||
local uid=\${functionArgs[1]}
|
local uid=\${functionArgs[1]}
|
||||||
local gid=\${functionArgs[2]}
|
local gid=\${functionArgs[2]}
|
||||||
local home=\${functionArgs[3]}
|
local home=\${functionArgs[3]}
|
||||||
local shell=\${functionArgs[4]}
|
local shell=\${functionArgs[4]}
|
||||||
local realName=\${functionArgs[5]}
|
local realName=\${functionArgs[5]}
|
||||||
|
|
||||||
passwdLine="\${user}:x:\${uid}:\${gid}:\${realName}:\${home}:\${shell}"
|
passwdLine="\${user}:x:\${uid}:\${gid}:\${realName}:\${home}:\${shell}"
|
||||||
passwdLine=\${passwdLine//' :'/':'}
|
passwdLine=\${passwdLine//' :'/':'}
|
||||||
passwdLine=\${passwdLine//': '/':'}
|
passwdLine=\${passwdLine//': '/':'}
|
||||||
|
|
||||||
local length=\${#passwdLine}
|
local length=\${#passwdLine}
|
||||||
((length--))
|
((length--))
|
||||||
if [ "\${passwdLine:\$length}" == ' ' ] ; then
|
if [ "\${passwdLine:\$length}" == ' ' ] ; then
|
||||||
passwdLine=\${passwdLine%' '}
|
passwdLine=\${passwdLine%' '}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
passwdFile="\`finddir B_COMMON_ETC_DIRECTORY\`/passwd"
|
passwdFile="\`finddir B_COMMON_ETC_DIRECTORY\`/passwd"
|
||||||
touch \${passwdFile}
|
touch \${passwdFile}
|
||||||
|
|
||||||
local userExists=1
|
local userExists=1
|
||||||
while read line ; do
|
while read line ; do
|
||||||
if [ "\${passwdLine}" == "\${line}" ] ; then
|
if [ "\${passwdLine}" == "\${line}" ] ; then
|
||||||
userExists=0
|
userExists=0
|
||||||
fi
|
fi
|
||||||
@ -510,7 +510,7 @@ function GeneratePackageNames()
|
|||||||
local lowerCasePkg=`echo ${pkg} | tr '[A-Z]' '[a-z]'`
|
local lowerCasePkg=`echo ${pkg} | tr '[A-Z]' '[a-z]'`
|
||||||
if ! ContainsSubstring "${alreadyInstalled} " "${pkg} " ; then
|
if ! ContainsSubstring "${alreadyInstalled} " "${pkg} " ; then
|
||||||
if IsPackageAndDepsOkToInstall ${pkg} ; then
|
if IsPackageAndDepsOkToInstall ${pkg} ; then
|
||||||
echo "${lowerCasePkg} : ${pkg} ${nonRepeatingDeps}" >> ${file}
|
echo "${lowerCasePkg} : ${pkg} ${nonRepeatingDeps}" >> ${file}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -623,7 +623,7 @@ function BuildFinalListOfPackagesToInstall()
|
|||||||
proceedWithInstallation=false
|
proceedWithInstallation=false
|
||||||
|
|
||||||
for desiredPackage in ${wantsToInstall}; do
|
for desiredPackage in ${wantsToInstall}; do
|
||||||
if IsPackageNameValid $desiredPackage ; then
|
if IsPackageNameValid $desiredPackage ; then
|
||||||
for item in ${availablePackages[${desiredPackage}]} ; do
|
for item in ${availablePackages[${desiredPackage}]} ; do
|
||||||
if ! ContainsSubstring "${packagesToInstall}" "${item}" ; then
|
if ! ContainsSubstring "${packagesToInstall}" "${item}" ; then
|
||||||
packagesToInstall="${packagesToInstall} ${item}"
|
packagesToInstall="${packagesToInstall} ${item}"
|
||||||
@ -729,7 +729,7 @@ function ConvertJamToBash()
|
|||||||
line=${line/'Echo'/'echo'}
|
line=${line/'Echo'/'echo'}
|
||||||
|
|
||||||
# TODO: add support for converting for loops.
|
# TODO: add support for converting for loops.
|
||||||
# will need to introduce curly brace counting
|
# will need to introduce curly brace counting
|
||||||
ConvertIfStatements "$line"
|
ConvertIfStatements "$line"
|
||||||
ConvertVariables "$line"
|
ConvertVariables "$line"
|
||||||
#ReplaceComparators "$line"
|
#ReplaceComparators "$line"
|
||||||
@ -776,7 +776,7 @@ function ConvertJamToBash()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
if($1!='InstallOptionalHaikuImagePackage' && isRule!=1 && $1!="\;")
|
if($1!='InstallOptionalHaikuImagePackage' && isRule!=1 && $1!="\;")
|
||||||
print $0
|
print $0
|
||||||
}
|
}
|
||||||
{ isRule=0; }
|
{ isRule=0; }
|
||||||
' ${tmpDir}/optpkg.stage1 > ${tmpDir}/optpkg.stage2 2>/dev/null
|
' ${tmpDir}/optpkg.stage1 > ${tmpDir}/optpkg.stage2 2>/dev/null
|
||||||
@ -838,7 +838,7 @@ function ConvertVariables()
|
|||||||
# One of the Jam-to-Bash conversion functions.
|
# One of the Jam-to-Bash conversion functions.
|
||||||
|
|
||||||
# NOTE: jam's variables are normally '$(VARIABLE)'. \n
|
# NOTE: jam's variables are normally '$(VARIABLE)'. \n
|
||||||
# The issue is with '(' and ')', so let's replace them globally.
|
# The issue is with '(' and ')', so let's replace them globally.
|
||||||
if ContainsSubstring "$line" '$(' ; then
|
if ContainsSubstring "$line" '$(' ; then
|
||||||
line=${line//'('/'{'}
|
line=${line//'('/'{'}
|
||||||
line=${line//')'/'}'}
|
line=${line//')'/'}'}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user