3 # This tool generates full update packages for the update system.
7 . $
(dirname "$0")/common.sh
9 # -----------------------------------------------------------------------------
12 notice
"Usage: $(basename $0) [OPTIONS] ARCHIVE DIRECTORY"
23 notice
"The contents of DIRECTORY will be stored in ARCHIVE."
26 notice
" -h show this help text"
31 # -----------------------------------------------------------------------------
35 workdir
="$targetdir.work"
36 manifest
="$workdir/update.manifest"
37 targetfiles
="update.manifest"
41 # Generate a list of all files in the target directory.
43 if test $?
-ne 0 ; then
47 # On Mac, force a top-level file so that OS X reloads the Info.plist
48 # and launches the right architecture for the OS version, bug 600098
49 if [[ -d Contents
]]; then
50 touch force_plist_reload
59 num_files
=${#files[*]}
61 for ((i
=0; $i<$num_files; i
=$i+1)); do
64 notice
"processing $f"
66 make_add_instruction
"$f" >> $manifest
69 mkdir
-p "$workdir/$dir"
70 $BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f"
71 copy_perm
"$targetdir/$f" "$workdir/$f"
73 targetfiles
="$targetfiles \"$f\""
76 # Append remove instructions for any dead files.
77 append_remove_instructions
"$targetdir" >> $manifest
79 $BZIP2 -z9 "$manifest" && mv -f "$manifest.bz2" "$manifest"
81 eval "$MAR -C \"$workdir\" -c output.mar $targetfiles"
82 mv -f "$workdir/output.mar" "$archive"