[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] byhand-ftpsync: Add error function



---
 scripts/debian/byhand-ftpsync | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/debian/byhand-ftpsync b/scripts/debian/byhand-ftpsync
index 35eff6d..ab46531 100755
--- a/scripts/debian/byhand-ftpsync
+++ b/scripts/debian/byhand-ftpsync
@@ -51,15 +51,19 @@ case "${suite}" in
         ;;
 esac
 
+error() {
+    echo "$0:" "$@" >&2
+    exit 1
+}
+
 # Check validity of version number
 # Expected: YYYYMMDD
 if ! echo "$VERSION" | grep -Eq "^[0-9]{8}$"; then
-	error "Invalid version: '$VERSION'"
+    error "Invalid version: '$VERSION'"
 fi
 
 if [[ ! "${byhand_file}" =~ ^ftpsync-20[0-9]{6}.tar.gz$ ]]; then
-    echo "$0: unknown file '${byhand_file}'" >&2
-    exit 1
+    error "unknown file '${byhand_file}'"
 fi
 
 target="${ftpdir}/project/ftpsync/"
-- 
2.1.4



Reply to: