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