diff options
author | P. J. McDermott <pjm@nac.net> | 2012-01-19 23:15:29 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-01-19 23:15:29 (EST) |
commit | c7da269a994afeba46862b50a5ce16a085ffd651 (patch) | |
tree | fd2933d34551457e9dfdd0e1d7306e49109c5c0e /src | |
parent | 3ad9b0f39e50e4853ab6529e49f24fd0536cdcdb (diff) |
Add comments and IFS reset to oh-installfiles.
Diffstat (limited to 'src')
-rw-r--r-- | src/oh-installfiles | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/oh-installfiles b/src/oh-installfiles index 0d81eea..b200d5f 100644 --- a/src/oh-installfiles +++ b/src/oh-installfiles @@ -29,14 +29,26 @@ if [ ${#} -eq 0 ]; then exit 1 fi -while [ ${#} -gt 0 ]; do - OLDIFS=${IFS} - IFS=' +# Set the IFS to just the linebreak character to make the 'read' utility output +# entire lines. +OLDIFS="${IFS}" +IFS=' ' + +# Iterate over packages. +while [ ${#} -gt 0 ]; do + # Loop over lines in the 'install' file. while read -r pattern; do + # Ensure that the full directory path of the pattern exists in the + # package staging area. pattern_dir=$(dirname ${pattern}) mkdir -p ${1}/${pattern_dir} + # Move any matching files from the installation destination to the + # package staging area. mv dest/${pattern} ${1}/${pattern_dir} done < ../${1}.pkg/install shift done + +# Reset the IFS. +IFS="${OLDIFS}" |