[haiku-commits] haiku: hrev45414 - data/bin

  • From: mattmadia@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 27 Mar 2013 22:47:48 +0100 (CET)

hrev45414 adds 2 changesets to branch 'master'
old head: 2b41b37891fa6e98df5d60a8b9581103a55917f9
new head: 7e1e5bb6ca70e442f472dbb810e5f3433b595952
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=7e1e5bb+%5E2b41b37

----------------------------------------------------------------------------

cf2f912: Implement rule AddDirectoryToHaikuImage in installoptionalpackage.
  
  Fixes #9584.

7e1e5bb: Whitespace cleanup. No functional change.

                                        [ Matt Madia <mattmadia@xxxxxxxxx> ]

----------------------------------------------------------------------------

1 file changed, 63 insertions(+), 48 deletions(-)
data/bin/installoptionalpackage | 111 ++++++++++++++++++++----------------

############################################################################

Commit:      cf2f912782a453abaad723df61bc380e137e7493
URL:         http://cgit.haiku-os.org/haiku/commit/?id=cf2f912
Author:      Matt Madia <mattmadia@xxxxxxxxx>
Date:        Wed Mar 27 21:45:03 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/9584

Implement rule AddDirectoryToHaikuImage in installoptionalpackage.

Fixes #9584.

----------------------------------------------------------------------------

diff --git a/data/bin/installoptionalpackage b/data/bin/installoptionalpackage
index 22677ae..84a82f4 100755
--- a/data/bin/installoptionalpackage
+++ b/data/bin/installoptionalpackage
@@ -216,6 +216,21 @@ function InstallSourceArchive()
 }
 
 
+function AddDirectoryToHaikuImage()
+{
+       # AddDirectoryToHaikuImage directoryTokens : attributeFiles
+       # Wrapper for Jam rule
+       ParseFunctionArguments "\$@"
+
+       local dirTokens="/boot/\${functionArgs[0]}"
+       TrimLeadingSpace dirTokens
+       TrimEndingSpace dirTokens
+       dirTokens=\${dirTokens//' '/\/}
+
+       mkdir -p "\${dirTokens}"
+}
+
+
 function AddSymlinkToHaikuImage()
 {
        # AddSymlinkToHaikuImage <dir tokens> : <link target> [ : <link name> ]

############################################################################

Revision:    hrev45414
Commit:      7e1e5bb6ca70e442f472dbb810e5f3433b595952
URL:         http://cgit.haiku-os.org/haiku/commit/?id=7e1e5bb
Author:      Matt Madia <mattmadia@xxxxxxxxx>
Date:        Wed Mar 27 21:47:27 2013 UTC

Whitespace cleanup. No functional change.

----------------------------------------------------------------------------

diff --git a/data/bin/installoptionalpackage b/data/bin/installoptionalpackage
index 84a82f4..1e03bc4 100755
--- a/data/bin/installoptionalpackage
+++ b/data/bin/installoptionalpackage
@@ -78,17 +78,17 @@ function ParseFunctionArguments()
        # ParseFunctionArguments <args>
        # Parse arguments for Jam wrapper functions into an array.
        IN="\$@"
-       OIFS=\$IFS
-       IFS=":"
+       OIFS=\$IFS
+       IFS=":"
 
-       local count=0
+       local count=0
        functionArgs=( )
        for x in \$IN
        do
                functionArgs[\${count}]="\${x}"
                ((count++))
        done
-       IFS=\$OIFS
+       IFS=\$OIFS
 }
 
 
@@ -98,11 +98,11 @@ function TrimLeadingSpace()
        eval local text='\$'"\$1"
        local _outvar="\$1"
 
-       local length=\${#text}
-       ((length--))
-       if [ "\${text:0:1}" == ' ' ] ; then
-               text=\${text#' '}
-       fi
+       local length=\${#text}
+       ((length--))
+       if [ "\${text:0:1}" == ' ' ] ; then
+               text=\${text#' '}
+       fi
 
        eval \$_outvar="'\$text'"
 }
@@ -114,11 +114,11 @@ function TrimEndingSpace()
        eval local text='\$'"\$1"
        local _outvar="\$1"
 
-       local length=\${#text}
-       ((length--))
-       if [ "\${text:\$length}" == ' ' ] ; then
-               text=\${text%' '}
-       fi
+       local length=\${#text}
+       ((length--))
+       if [ "\${text:\$length}" == ' ' ] ; then
+               text=\${text%' '}
+       fi
 
        eval \$_outvar="'\$text'"
 }
@@ -235,19 +235,19 @@ function AddSymlinkToHaikuImage()
 {
        # AddSymlinkToHaikuImage <dir tokens> : <link target> [ : <link name> ]
        # Wrapper for Jam rule
-       ParseFunctionArguments "\$@"
+       ParseFunctionArguments "\$@"
 
-       local dirTokens="/boot/\${functionArgs[0]}"
-       TrimLeadingSpace dirTokens
+       local dirTokens="/boot/\${functionArgs[0]}"
+       TrimLeadingSpace dirTokens
        TrimEndingSpace dirTokens
-       dirTokens=\${dirTokens//' '/\/}
+       dirTokens=\${dirTokens//' '/\/}
 
-       local linkTarget="\${functionArgs[1]}"
-       TrimLeadingSpace linkTarget
+       local linkTarget="\${functionArgs[1]}"
+       TrimLeadingSpace linkTarget
        TrimEndingSpace linkTarget
 
-       local linkName="\${functionArgs[2]}"
-       TrimLeadingSpace linkName
+       local linkName="\${functionArgs[2]}"
+       TrimLeadingSpace linkName
        TrimEndingSpace linkName
 
        mkdir -p "\${dirTokens}"
@@ -267,27 +267,27 @@ function AddUserToHaikuImage()
        ParseFunctionArguments "\$@"
 
        local user=\${functionArgs[0]}
-       local uid=\${functionArgs[1]}
-       local gid=\${functionArgs[2]}
-       local home=\${functionArgs[3]}
-       local shell=\${functionArgs[4]}
-       local realName=\${functionArgs[5]}
-
-       passwdLine="\${user}:x:\${uid}:\${gid}:\${realName}:\${home}:\${shell}"
-       passwdLine=\${passwdLine//' :'/':'}
-       passwdLine=\${passwdLine//': '/':'}
-
-       local length=\${#passwdLine}
-       ((length--))
-       if [ "\${passwdLine:\$length}" == ' ' ] ; then
-               passwdLine=\${passwdLine%' '}
-       fi
-
-       passwdFile="\`finddir B_COMMON_ETC_DIRECTORY\`/passwd"
-       touch \${passwdFile}
-
-       local userExists=1
-       while read line ; do
+       local uid=\${functionArgs[1]}
+       local gid=\${functionArgs[2]}
+       local home=\${functionArgs[3]}
+       local shell=\${functionArgs[4]}
+       local realName=\${functionArgs[5]}
+
+       passwdLine="\${user}:x:\${uid}:\${gid}:\${realName}:\${home}:\${shell}"
+       passwdLine=\${passwdLine//' :'/':'}
+       passwdLine=\${passwdLine//': '/':'}
+
+       local length=\${#passwdLine}
+       ((length--))
+       if [ "\${passwdLine:\$length}" == ' ' ] ; then
+               passwdLine=\${passwdLine%' '}
+       fi
+
+       passwdFile="\`finddir B_COMMON_ETC_DIRECTORY\`/passwd"
+       touch \${passwdFile}
+
+       local userExists=1
+       while read line ; do
                if [ "\${passwdLine}" == "\${line}" ] ; then
                        userExists=0
                fi
@@ -510,7 +510,7 @@ function GeneratePackageNames()
                local lowerCasePkg=`echo ${pkg} | tr '[A-Z]' '[a-z]'`
                if ! ContainsSubstring "${alreadyInstalled} " "${pkg} " ; then
                        if IsPackageAndDepsOkToInstall ${pkg} ; then
-                               echo "${lowerCasePkg} : ${pkg} 
${nonRepeatingDeps}"  >> ${file}
+                               echo "${lowerCasePkg} : ${pkg} 
${nonRepeatingDeps}" >> ${file}
                        fi
                fi
 
@@ -623,7 +623,7 @@ function BuildFinalListOfPackagesToInstall()
        proceedWithInstallation=false
 
        for desiredPackage in ${wantsToInstall}; do
-               if IsPackageNameValid $desiredPackage  ; then
+               if IsPackageNameValid $desiredPackage ; then
                        for item in ${availablePackages[${desiredPackage}]} ; do
                                if ! ContainsSubstring "${packagesToInstall}" 
"${item}" ; then
                                        packagesToInstall="${packagesToInstall} 
${item}"
@@ -729,7 +729,7 @@ function ConvertJamToBash()
                line=${line/'Echo'/'echo'}
 
                # TODO: add support for converting for loops.
-               #               will need to introduce curly brace counting
+               #               will need to introduce curly brace counting
                ConvertIfStatements "$line"
                ConvertVariables "$line"
                #ReplaceComparators "$line"
@@ -776,7 +776,7 @@ function ConvertJamToBash()
                }
                {
                        if($1!='InstallOptionalHaikuImagePackage' && isRule!=1 
&& $1!="\;")
-                       print $0
+                       print $0
                }
                { isRule=0; }
                ' ${tmpDir}/optpkg.stage1 > ${tmpDir}/optpkg.stage2 2>/dev/null
@@ -838,7 +838,7 @@ function ConvertVariables()
        # One of the Jam-to-Bash conversion functions.
 
        # 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
                line=${line//'('/'{'}
                line=${line//')'/'}'}


Other related posts:

  • » [haiku-commits] haiku: hrev45414 - data/bin - mattmadia