7 echo "Usage: $0 filename version arch changes_file"
11 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
14 WIN32_LOADER_PATH="$1" # win32-loader_${VERSION}_${ARCH}{.exe,txt}
15 WIN32_LOADER_FILE="${WIN32_LOADER_PATH##*/}"
18 CHANGES="$4" # Changes file for the upload
20 # Get the target suite from the Changes file
21 # NOTE: it may be better to pass this to the script as a parameter!
22 SUITE="$(grep "^Distribution:" "$CHANGES" | awk '{print $2}')"
25 echo "Error: unable to determine suite from Changes file"
32 SUITE="${SUITE}-proposed-updates"
36 case "${WIN32_LOADER_FILE}" in
37 win32-loader_*.exe|win32-loader_*.txt)
41 echo "Error: invalid filename for byhand-win32-loader"
46 # This must end with /
47 TARGET="${ftpdir}/tools/win32-loader/${SUITE}/"
49 # Prepare the target filename by removing the version and arch parts;
50 # transforms any/path/win32-loader_${VERSION}_${ARCH}.${extension} to win32-loader.${extension}
51 TARGET_FILENAME="${WIN32_LOADER_FILE%%_*}.${WIN32_LOADER_FILE##*.}"
53 # Check validity of the target directory
54 if [ ! -d "$TARGET" ]; then
58 # Put said file into the tools directory
59 # Use --remove-destination to avoid problems with the fact that the target may
60 # be a hardlink and in that case we'd update multiple suites together
61 cp --remove-destination "$WIN32_LOADER_PATH" "${TARGET}${TARGET_FILENAME}"
64 chmod 0644 "${TARGET}${TARGET_FILENAME}"