Bug 458256. Use LoadLibraryW instead of LoadLibrary (patch by DougT). r+sr=vlad
[wine-gecko.git] / tools / update-packaging / make_full_update.sh
blob788cf14fcc5caf948293792e8b82fb2b5a406f16
1 #!/bin/bash
3 # This tool generates full update packages for the update system.
4 # Author: Darin Fisher
7 . $(dirname "$0")/common.sh
9 # -----------------------------------------------------------------------------
11 print_usage() {
12 notice "Usage: $(basename $0) [OPTIONS] ARCHIVE DIRECTORY"
15 if [ $# = 0 ]; then
16 print_usage
17 exit 1
20 if [ $1 = -h ]; then
21 print_usage
22 notice ""
23 notice "The contents of DIRECTORY will be stored in ARCHIVE."
24 notice ""
25 notice "Options:"
26 notice " -h show this help text"
27 notice ""
28 exit 1
31 # -----------------------------------------------------------------------------
33 archive="$1"
34 targetdir="$2"
35 workdir="$targetdir.work"
36 manifest="$workdir/update.manifest"
37 targetfiles="update.manifest"
39 mkdir -p "$workdir"
41 # Generate a list of all files in the target directory.
42 pushd "$targetdir"
43 if test $? -ne 0 ; then
44 exit 1
47 list_files files
49 popd
51 > $manifest
53 num_files=${#files[*]}
55 for ((i=0; $i<$num_files; i=$i+1)); do
56 f="${files[$i]}"
58 notice "processing $f"
60 make_add_instruction "$f" >> $manifest
62 dir=$(dirname "$f")
63 mkdir -p "$workdir/$dir"
64 $BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f"
65 copy_perm "$targetdir/$f" "$workdir/$f"
67 targetfiles="$targetfiles \"$f\""
68 done
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"
78 # cleanup
79 rm -fr "$workdir"