From fe25a76c0a4f98950768c8796a06f5b7d6f441c9 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Wed, 4 Mar 2009 13:42:58 +0100 Subject: [PATCH] sde-download: split get-tokenized.sh into dump.sh and dump-tokenized.sh --- bin/sde-check-package | 2 +- lib/sde-download/dump-tokenized.sh | 23 +++++++++++++++++++ .../{get-tokenized.sh => dump.sh} | 10 +++----- 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100755 lib/sde-download/dump-tokenized.sh rename lib/sde-download/{get-tokenized.sh => dump.sh} (78%) diff --git a/bin/sde-check-package b/bin/sde-check-package index 43946cf..81542cc 100755 --- a/bin/sde-check-package +++ b/bin/sde-check-package @@ -143,7 +143,7 @@ check_package() { http|https|ftp) lock "$dump" [ -e "$dump" ] || - "$SDEROOT/lib/sde-download/get-tokenized.sh" "$url" > "$dump" 2> "$dump.stderr" + "$SDEROOT/lib/sde-download/dump-tokenized.sh" "$url" > "$dump" 2> "$dump.stderr" unlock "$dump" ;; *) diff --git a/lib/sde-download/dump-tokenized.sh b/lib/sde-download/dump-tokenized.sh new file mode 100755 index 0000000..3224ef0 --- /dev/null +++ b/lib/sde-download/dump-tokenized.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: lib/sde-download/dump-tokenized.sh +# Copyright (C) 2009 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# 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; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +# returns mutilated but grep friendly content of a page +# +# (It will include many empty lines, but it doesn't worth to remove them +# here) +# + +set -x +echo "${0%/*}/dump.sh" "$@" #| sed -e "s,[\r\t\"'<>= /],\n,g" diff --git a/lib/sde-download/get-tokenized.sh b/lib/sde-download/dump.sh similarity index 78% rename from lib/sde-download/get-tokenized.sh rename to lib/sde-download/dump.sh index a4ce6f0..b6d09bc 100755 --- a/lib/sde-download/get-tokenized.sh +++ b/lib/sde-download/dump.sh @@ -2,7 +2,7 @@ # --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # -# Filename: lib/sde-download/get-tokenized.sh +# Filename: lib/sde-download/dump.sh # Copyright (C) 2009 The OpenSDE Project # # More information can be found in the files COPYING and README. @@ -13,11 +13,7 @@ # GNU General Public License can be found in the file COPYING. # --- SDE-COPYRIGHT-NOTE-END --- -# returns mutilated but grep friendly content of a page -# -# (It will include many empty lines, but it doesn't worth to remove them -# here) -# +# dumps the content of a page curl_options="-s -L" curl_options="$curl_options --disable-epsv" @@ -36,5 +32,5 @@ for x; do echo "$x" >&2 curl $curl_options "$x" errno="$?" -done < /dev/null | sed -e "s,[\r\t\"'<>= /],\n,g" +done < /dev/null exit "${errno:-1}"