Author: jerry
Date: 2005-08-30 14:23:13 +0000 (Tue, 30 Aug 2005)
New Revision: 798

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-web&rev=798

Log:
some scripting portability fixes
Modified:
   trunk/patches/fetch-patches


Changeset:
Modified: trunk/patches/fetch-patches
===================================================================
--- trunk/patches/fetch-patches 2005-08-30 01:30:19 UTC (rev 797)
+++ trunk/patches/fetch-patches 2005-08-30 14:23:13 UTC (rev 798)
@@ -1,4 +1,4 @@
-#! /bin/bash
+#!/bin/sh
 
 # Copyright (c) 2005 Lars Mueller <lmuelle at samba.org>
 #
@@ -25,8 +25,6 @@
 # Place, Suite 330, Boston, MA 02111-1307 USA
 
 
-PATH="/usr/bin:/usr/X11R6/bin:/bin"
-
 # Path to the series file and patches
 test "${PATCH_DIR}" || \
        PATCH_DIR="http://www.samba.org/samba/patches";
@@ -34,28 +32,31 @@
        SERIES_FILE="$1" || \
        SERIES_FILE="series"
 
-if ! which wget>/dev/null; then
+if test ! -f  "`which wget 2> /dev/null`"; then
        echo "Error: You have to install wget."
        exit 1
 fi
 
 test -d patches || mkdir patches
-pushd patches >/dev/null
+cd patches || exit $?
 
-if ! wget -N "${PATCH_DIR}/${SERIES_FILE}"; then
+wget -N "${PATCH_DIR}/${SERIES_FILE}"
+if test $? != 0; 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
-               \#*|"") continue ;;
+               \#*|"") continue 
+                       ;;
                *)
                        wget -N "${PATCH_DIR}/${patch}"
                        ;;
        esac
-done <series
+done < series
 
-popd >/dev/null
+cd .. >/dev/null

Reply via email to