]> git.decadent.org.uk Git - dak.git/blob - scripts/debian/byhand-win32-loader
Merge remote branch 'odyx/win32-loader-autobyhand' into merge
[dak.git] / scripts / debian / byhand-win32-loader
1 #!/bin/sh -ue
2
3 if [ $# -lt 4 ]; then
4         echo "Usage: $0 filename version arch changes_file"
5         exit 1
6 fi
7
8 WIN32_LOADER_FILE="$1"  # *-win32-loader{.exe,txt}
9 VERSION="$2"
10 ARCH="$3"
11 CHANGES="$4"    # Changes file for the upload
12
13 error() {
14         echo "$*"
15         exit 1
16 }
17
18 # Get the target suite from the Changes file
19 # NOTE: it may be better to pass this to the script as a parameter!
20 SUITE="$(grep "^Distribution:" "$CHANGES" | awk '{print $2}')"
21 case $SUITE in
22     "")
23         error "Error: unable to determine suite from Changes file"
24         ;;
25     unstable|sid)
26         : # nothing to do
27         ;;
28     *)
29         SUITE="${SUITE}-proposed-updates"
30         ;;
31 esac
32
33 # This must end with /
34 TARGET="/srv/ftp-master.debian.org/ftp/tools/"
35
36 # Check validity of the target directory
37 if [ ! -d "$TARGET" ]; then
38         mkdir -p "$TARGET"
39 fi
40
41 # Put said file into the tools directory
42 cp "$WIN32_LOADER_FILE" "$TARGET"
43
44 trap - EXIT
45 cleanup
46
47 exit 0