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
53 num_files
=${#files[*]}
55 for ((i
=0; $i<$num_files; i
=$i+1)); do
58 notice
"processing $f"
60 make_add_instruction
"$f" >> $manifest
63 mkdir
-p "$workdir/$dir"
64 $BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f"
65 copy_perm
"$targetdir/$f" "$workdir/$f"
67 targetfiles
="$targetfiles \"$f\""
70 # Append remove instructions for any dead files.
71 append_remove_instructions
"$targetdir" >> $manifest
73 $BZIP2 -z9 "$manifest" && mv -f "$manifest.bz2" "$manifest"
75 eval "$MAR -C \"$workdir\" -c output.mar $targetfiles"
76 mv -f "$workdir/output.mar" "$archive"