aboutsummaryrefslogtreecommitdiff
path: root/openssl/update-snapshot.sh
blob: 0ebc31db6b6ed6565baf73b78bb7f461b8bc1b74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh -
# $Id$
#
# Fetch today's OpenSSL tarball and do everything needed to make it
# the current code other than the git commit.

#version="1.0.0-stable-SNAP-$(date +%Y%m%d)"

version="1.0.2j"

tarball="openssl-${version}.tar.gz"

case $version in
  *SNAP*) directory=snapshot;;
  *)      directory=source;;
esac

/bin/test -f "${tarball}" || /usr/bin/fetch -m -p "ftp://ftp.openssl.org/${directory}/${tarball}" || exit

/bin/rm -f openssl

for i in *.tar.gz
do
  if [ "$i" != "$tarball" ]
  then
    /bin/rm -rf "${i%.tar.gz}"
    /usr/local/bin/git rm "$i"
  fi
done

/usr/bin/awk -v version="$version" '/^VERSION = / {$NF = version} {print}' Makefile.in >Makefile.in.$$ &&
/bin/mv Makefile.in.$$ Makefile.in

/usr/local/bin/git add -v "$tarball"
/usr/local/bin/git add -v -u