summaryrefslogtreecommitdiff
path: root/maketgz
diff options
context:
space:
mode:
authorNils Gillmann <ng0@n0.is>2018-08-05 10:00:26 +0000
committerNils Gillmann <ng0@n0.is>2018-08-05 10:00:26 +0000
commite811856677be94017c4d2bb333830a7f743649a6 (patch)
tree1483daf2649cd4da1db8b10218c5756965839512 /maketgz
parentcb5937f5c0669fee3f8c3d4e1f9d640f592d91fa (diff)
parenteb8138405a3f747f2c236464932f72e918946f68 (diff)
downloadgnurl-e811856677be94017c4d2bb333830a7f743649a6.tar.gz
gnurl-e811856677be94017c4d2bb333830a7f743649a6.tar.bz2
gnurl-e811856677be94017c4d2bb333830a7f743649a6.zip
Merge tag 'curl-7_61_0'
curl 7.61.0 Signed-off-by: Nils Gillmann <ng0@n0.is>
Diffstat (limited to 'maketgz')
-rwxr-xr-xmaketgz67
1 files changed, 42 insertions, 25 deletions
diff --git a/maketgz b/maketgz
index 03e4fdb61..07fa9d5fa 100755
--- a/maketgz
+++ b/maketgz
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
# Script to build release-archives with. Note that this requires a checkout
# from git and you should first run ./buildconf and build curl once.
#
@@ -9,7 +9,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -32,8 +32,8 @@ if [ -z "$version" ]; then
fi
if [ "xonly" = "x$2" ]; then
- echo "Setup version number only!"
- only=1
+ echo "Setup version number only!"
+ only=1
fi
libversion="$version"
@@ -41,13 +41,13 @@ libversion="$version"
# we make curl the same version as libcurl
curlversion=$libversion
-major=`echo $libversion |cut -d. -f1 | sed -e "s/[^0-9]//g"`
-minor=`echo $libversion |cut -d. -f2 | sed -e "s/[^0-9]//g"`
-patch=`echo $libversion |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
+major=`echo $libversion | cut -d. -f1 | sed -e "s/[^0-9]//g"`
+minor=`echo $libversion | cut -d. -f2 | sed -e "s/[^0-9]//g"`
+patch=`echo $libversion | cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
if test -z "$patch"; then
- echo "invalid version number? needs to be z.y.z"
- exit
+ echo "invalid version number? needs to be z.y.z"
+ exit
fi
#
@@ -64,37 +64,41 @@ CHEADER=src/tool_version.h
PLIST=lib/libgnurl.plist
if test -z "$only"; then
- ext=".dist"
- # when not setting up version numbers locally
- for a in $HEADER $CHEADER $PLIST; do
- cp $a "$a$ext"
- done
- HEADER="$HEADER$ext"
- CHEADER="$CHEADER$ext"
- PLIST="$PLIST$ext"
+ ext=".dist"
+ # when not setting up version numbers locally
+ for a in $HEADER $CHEADER $PLIST; do
+ cp $a "$a$ext"
+ done
+ HEADER="$HEADER$ext"
+ CHEADER="$CHEADER$ext"
+ PLIST="$PLIST$ext"
fi
# requires a date command that knows + for format
datestamp=`date +"%F"`
# Replace version number in header file:
-sed -i -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
+sed -i.bak \
+ -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \
-e 's/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x'$numeric'/g' \
-e 's/^#define LIBCURL_VERSION_MAJOR .*/#define LIBCURL_VERSION_MAJOR '$major'/g' \
-e 's/^#define LIBCURL_VERSION_MINOR .*/#define LIBCURL_VERSION_MINOR '$minor'/g' \
-e 's/^#define LIBCURL_VERSION_PATCH .*/#define LIBCURL_VERSION_PATCH '$patch'/g' \
-e "s/^#define LIBCURL_TIMESTAMP .*/#define LIBCURL_TIMESTAMP \"$datestamp\"/g" \
- $HEADER
+ $HEADER
+rm -f "$HEADER.bak"
# Replace version number in header file:
-sed -i 's/#define CURL_VERSION .*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER
+sed -i.bak 's/#define CURL_VERSION .*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER
+rm -f "$CHEADER.bak"
# Replace version number in plist file:
-sed -i "s/7\.12\.3/$libversion/g" $PLIST
+sed -i.bak "s/7\.12\.3/$libversion/g" $PLIST
+rm -f "$PLIST.bak"
if test -n "$only"; then
- # done!
- exit;
+ # done!
+ exit;
fi
# Replace version number in plist file:
@@ -106,8 +110,7 @@ echo "libgnurl version $libversion"
echo "libgnurl numerical $numeric"
echo "datestamp $datestamp"
-findprog()
-{
+findprog() {
file="$1"
for part in `echo $PATH| tr ':' ' '`; do
path="$part/$file"
@@ -175,6 +178,20 @@ makeZ() {
mv $compress ../
cd ..
rm -rf $tempdir
+
+############################################################################
+#
+# Now make a zip archive from the tar.gz original
+#
+makezip() {
+ rm -rf $tempdir
+ mkdir $tempdir
+ cd $tempdir
+ gzip -dc ../$targz | tar -xf -
+ find . | zip $zip -@ >/dev/null
+ mv $zip ../
+ cd ..
+ rm -rf $tempdir
}
echo "Generating $compress"