Author: lmuelle Date: 2005-08-29 19:04:12 +0000 (Mon, 29 Aug 2005) New Revision: 788
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-web&rev=788 Log: Add support for a non default series file. This might allow us to provide more than one patch series. E.g. series-3.0.21pre2 It's now possible to override the PATCH_DIR if it is set in the environment from where the script is called. Modified: trunk/patches/fetch-patches Changeset: Modified: trunk/patches/fetch-patches =================================================================== --- trunk/patches/fetch-patches 2005-08-29 18:54:08 UTC (rev 787) +++ trunk/patches/fetch-patches 2005-08-29 19:04:12 UTC (rev 788) @@ -1,9 +1,38 @@ #! /bin/bash +# Copyright (c) 2005 Lars Mueller <lmuelle at samba.org> +# +# If called without any argument the default series filename 'series' is used. +# It's possible to pass a non default series filename, e.g. series-3.0.20, as +# first argument. +# +# If PATCH_DIR is defined, we don't use our default at Samba.org. That's +# at least handy for testing changes to the script. +# +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA + + PATH="/usr/bin:/usr/X11R6/bin:/bin" -# URL to the series file -SERIES_FILE="http://www.samba.org/samba/patches/series" +# Path to the series file and patches +test "${PATCH_DIR}" || \ + PATCH_DIR="http://www.samba.org/samba/patches" +test "$1" && + SERIES_FILE="$1" || \ + SERIES_FILE="series" if ! which wget>/dev/null; then echo "Error: You have to install wget." @@ -13,13 +42,18 @@ test -d patches || mkdir patches pushd patches >/dev/null -wget -N "$SERIES_FILE" +if ! wget -N "${PATCH_DIR}/${SERIES_FILE}"; then + echo "Error: Can not download ${PATCH_DIR}/${SERIES_FILE}" + exit 1 +fi +test "${SERIES_FILE}" = "series" || \ + ln -fs "$1" series while read patch rest; do - case "$patch" in + case "${patch}" in \#*|"") continue ;; *) - wget -N http://www.samba.org/samba/patches/$patch + wget -N "${PATCH_DIR}/${patch}" ;; esac done <series
