1- #! /bin/sh
1+ #! /bin/sh
22# Script to build release-archives with. Note that this requires a checkout
33# from git and you should first run ./buildconf and build curl once.
44#
99# | (__| |_| | _ <| |___
1010# \___|\___/|_| \_\_____|
1111#
12- # Copyright (C) 1998 - 2017 , Daniel Stenberg, <[email protected] >, et al.12+ # Copyright (C) 1998 - 2018 , Daniel Stenberg, <[email protected] >, et al.1313#
1414# This software is licensed as described in the file COPYING, which
1515# you should have received as part of this distribution. The terms
@@ -32,22 +32,22 @@ if [ -z "$version" ]; then
3232fi
3333
3434if [ " xonly" = " x$2 " ]; then
35- echo " Setup version number only!"
36- only=1
35+ echo " Setup version number only!"
36+ only=1
3737fi
3838
3939libversion=" $version "
4040
4141# we make curl the same version as libcurl
4242curlversion=$libversion
4343
44- major=` echo $libversion | cut -d. -f1 | sed -e " s/[^0-9]//g" `
45- minor=` echo $libversion | cut -d. -f2 | sed -e " s/[^0-9]//g" `
46- patch=` echo $libversion | cut -d. -f3 | cut -d- -f1 | sed -e " s/[^0-9]//g" `
44+ major=` echo $libversion | cut -d. -f1 | sed -e " s/[^0-9]//g" `
45+ minor=` echo $libversion | cut -d. -f2 | sed -e " s/[^0-9]//g" `
46+ patch=` echo $libversion | cut -d. -f3 | cut -d- -f1 | sed -e " s/[^0-9]//g" `
4747
4848if test -z " $patch " ; then
49- echo " invalid version number? needs to be z.y.z"
50- exit
49+ echo " invalid version number? needs to be z.y.z"
50+ exit
5151fi
5252
5353#
@@ -64,46 +64,49 @@ CHEADER=src/tool_version.h
6464PLIST=lib/libcurl.plist
6565
6666if test -z " $only " ; then
67- ext=" .dist"
68- # when not setting up version numbers locally
69- for a in $HEADER $CHEADER $PLIST ; do
70- cp $a " $a$ext "
71- done
72- HEADER=" $HEADER$ext "
73- CHEADER=" $CHEADER$ext "
74- PLIST=" $PLIST$ext "
67+ ext=" .dist"
68+ # when not setting up version numbers locally
69+ for a in $HEADER $CHEADER $PLIST ; do
70+ cp $a " $a$ext "
71+ done
72+ HEADER=" $HEADER$ext "
73+ CHEADER=" $CHEADER$ext "
74+ PLIST=" $PLIST$ext "
7575fi
7676
7777# requires a date command that knows + for format
7878datestamp=` date +" %F" `
7979
8080# Replace version number in header file:
81- sed -i.bak -e ' s/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "' $libversion ' "/g' \
81+ sed -i.bak \
82+ -e ' s/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "' $libversion ' "/g' \
8283 -e ' s/^#define LIBCURL_VERSION_NUM .*/#define LIBCURL_VERSION_NUM 0x' $numeric ' /g' \
8384 -e ' s/^#define LIBCURL_VERSION_MAJOR .*/#define LIBCURL_VERSION_MAJOR ' $major ' /g' \
8485 -e ' s/^#define LIBCURL_VERSION_MINOR .*/#define LIBCURL_VERSION_MINOR ' $minor ' /g' \
8586 -e ' s/^#define LIBCURL_VERSION_PATCH .*/#define LIBCURL_VERSION_PATCH ' $patch ' /g' \
8687 -e " s/^#define LIBCURL_TIMESTAMP .*/#define LIBCURL_TIMESTAMP \" $datestamp \" /g" \
87- $HEADER
88+ $HEADER
89+ rm -f " $HEADER .bak"
8890
8991# Replace version number in header file:
9092sed -i.bak ' s/#define CURL_VERSION .*/#define CURL_VERSION "' $curlversion ' "/g' $CHEADER
93+ rm -f " $CHEADER .bak"
9194
9295# Replace version number in plist file:
9396sed -i.bak " s/7\.12\.3/$libversion /g" $PLIST
97+ rm -f " $PLIST .bak"
9498
9599if test -n " $only " ; then
96- # done!
97- exit ;
100+ # done!
101+ exit ;
98102fi
99103
100104echo " curl version $curlversion "
101105echo " libcurl version $libversion "
102106echo " libcurl numerical $numeric "
103107echo " datestamp $datestamp "
104108
105- findprog ()
106- {
109+ findprog () {
107110 file=" $1 "
108111 for part in ` echo $PATH | tr ' :' ' ' ` ; do
109112 path=" $part /$file "
@@ -189,8 +192,7 @@ gzip -dc $targz | xz -6e - > $xz
189192#
190193# Now make a zip archive from the tar.gz original
191194#
192- makezip ()
193- {
195+ makezip () {
194196 rm -rf $tempdir
195197 mkdir $tempdir
196198 cd $tempdir
0 commit comments