Bug 375415 - MAR generation broken when paths in the MAR contain spaces, r=cf

This commit is contained in:
benjamin@smedbergs.us 2007-03-29 07:11:40 -07:00
parent 86ec89aeff
commit cd158e4d2d
3 changed files with 21 additions and 12 deletions

View File

@ -93,11 +93,19 @@ append_remove_instructions() {
# List all files in the current directory, stripping leading "./"
# Skip the channel-prefs.js file as it should not be included in any
# generated MAR files (see bug 306077).
# generated MAR files (see bug 306077). Pass a variable name and it will be
# filled as an array.
list_files() {
count=0
find . -type f \
! -name "channel-prefs.js" \
! -name "update.manifest" \
| sed 's/\.\/\(.*\)/"\1"/' \
| sort
| sed 's/\.\/\(.*\)/\1/' \
| sort > "$workdir/temp-filelist"
while read file; do
eval "${1}[$count]=\"$file\""
(( count++ ))
done < "$workdir/temp-filelist"
rm "$workdir/temp-filelist"
}

View File

@ -36,23 +36,24 @@ workdir="$targetdir.work"
manifest="$workdir/update.manifest"
targetfiles="update.manifest"
mkdir -p "$workdir"
# Generate a list of all files in the target directory.
pushd "$targetdir"
if test $? -ne 0 ; then
exit 1
fi
files=($(list_files))
list_files files
popd
mkdir -p "$workdir"
> $manifest
num_files=${#files[*]}
for ((i=0; $i<$num_files; i=$i+1)); do
eval "f=${files[$i]}"
f="${files[$i]}"
notice "processing $f"

View File

@ -70,13 +70,15 @@ workdir="$newdir.work"
manifest="$workdir/update.manifest"
archivefiles="update.manifest"
mkdir -p "$workdir"
# Generate a list of all files in the target directory.
pushd "$olddir"
if test $? -ne 0 ; then
exit 1
fi
oldfiles=($(list_files))
list_files oldfiles
popd
@ -85,18 +87,16 @@ if test $? -ne 0 ; then
exit 1
fi
list=$(list_files)
newfiles=($(list_files))
list_files newfiles
popd
mkdir -p "$workdir"
> $manifest
num_oldfiles=${#oldfiles[*]}
for ((i=0; $i<$num_oldfiles; i=$i+1)); do
eval "f=${oldfiles[$i]}"
f="${oldfiles[$i]}"
# This file is created by Talkback, so we can ignore it
if [ "$f" = "readme.txt" ]; then
@ -146,7 +146,7 @@ done
num_newfiles=${#newfiles[*]}
for ((i=0; $i<$num_newfiles; i=$i+1)); do
eval "f=${newfiles[$i]}"
f="${newfiles[$i]}"
# If we've already tested this file, then skip it
for ((j=0; $j<$num_oldfiles; j=$j+1)); do