tzwrapper.cc: fixed use of iterator after erase
[barry.git] / maintainer / make-redirect.sh
blobf7aaaa5602405f71541736ed4a4bcf2ee7e32f24
1 #!/bin/bash
3 set -e
5 if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then
6 echo "make-redirect.sh builddir prefix_dir new_url_base"
7 echo
8 echo "Creates .htaccess output for redirecting all .deb and .rpm files"
9 echo "to another website."
10 echo
11 echo "builddir is where the resulting tree of release-bm.sh is located"
12 echo
13 echo "prefix_dir is the path from the redirecting site, from the"
14 echo "root of the domain name. Must start with a slash."
15 echo "For example: /binary-meta"
16 echo
17 echo "new_url_base is the base URL of the site where the real files"
18 echo "exist. Do not use a trailing slash, as it will be appended"
19 echo "with the filename."
20 echo
21 echo "Example:"
22 echo
23 echo " make-redirect.sh bmbuild /binary-meta http://downloads.sourceforge.net/project/barry/binary-meta/20111020"
24 echo
25 exit 1
28 BUILDDIR="$1"
29 PREFIX_DIR="$2"
30 NEW_URL_BASE="$3"
32 # Build Packages and Contents, for all distros, per arch
33 for file in $(cd $BUILDDIR && find * -type f \( -name "*.rpm" -o -name "*.deb" \) -print) ; do
34 echo "Redirect 302 $PREFIX_DIR/$file $NEW_URL_BASE/$file"
35 done