cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Git branch for daily snapshots instead of downloading tarballs?

From: Guenter <lists_at_gknw.net>
Date: Sat, 29 Nov 2014 03:24:36 +0100

Hi John,
On 28.11.2014 18:46, John E. Malmberg wrote:
> A VMS developer currently needs pull down and unpack a daily tarball to
> test against, and also maintain a git checkout of master to generate the
> patches against.
>
> Just trying to save a few steps.
here's a simple shell script which does these few steps automatically
for ya;
it downloads latest tarball and extracts only those two files you're
interested in into your git curl directory (this script is originally
part of an daily snapshot autobuild script):

#!/bin/sh

SNAPURL="http://curl.haxx.se/snapshots/"
SNAPEXT="tar.bz2"
EXTRACT="tar xjf"
# EXECDNL="curl -s -o"
EXECDNL="wget -q -O"
VERBOSE=1
GITCURL="curl"
FILEOPT="-C ${GITCURL} --strip 1 --no-anchored configure
lib/curl_config.h.in"

NEWEST=$(${EXECDNL} - ${SNAPURL} | sed -ne "s/^NEWEST ${SNAPEXT} //p")
test -z "${NEWEST}" && echo -e "ERROR: couldnt find 'NEWEST ${SNAPEXT}'
tag!" && exit 1
test ${VERBOSE} -eq 1 && echo -e "Newest tarball is ${NEWEST}"
if test ! -f "${NEWEST}"; then
     test ${VERBOSE} -eq 1 && echo -e "Downloading tarball ${NEWEST}"
     ${EXECDNL} ${NEWEST} ${SNAPURL}${NEWEST}
     test $? -ne 0 && echo -e "ERROR: downloading tarball failed!" && exit 1
else
     test ${VERBOSE} -eq 1 && echo -e "Newest tarball ${NEWEST} exists
already!"
fi

CURLDIR=${NEWEST%.${SNAPEXT}}
if test ! -d "${CURLDIR}"; then
   test ${VERBOSE} -eq 1 && echo -e "Extracting tarball ${NEWEST} ..."
   test -n "${GITCURL}" -a ! -d "${GITCURL}" && mkdir "${GITCURL}"
   ${EXTRACT} ${NEWEST} ${FILEOPT}
   test $? -ne 0 && echo -e "ERROR: extracting tarball failed!" && exit 1
else
   test ${VERBOSE} -eq 1 && echo -e "Source directory ${CURLDIR} exists
already!"
fi

test ${VERBOSE} -eq 1 && echo -e "Source directory: ${CURLDIR}"

Gün.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-11-29