summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/oh-installfiles18
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}"