Skip to content

Commit 676f4b7

Browse files
committed
maketgz: delete .bak files, fix indentation
Ref: curl#2660 Closes curl#2662
1 parent 99ae23c commit 676f4b7

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

maketgz

+27-25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
#
@@ -9,7 +9,7 @@
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
3232
fi
3333

3434
if [ "xonly" = "x$2" ]; then
35-
echo "Setup version number only!"
36-
only=1
35+
echo "Setup version number only!"
36+
only=1
3737
fi
3838

3939
libversion="$version"
4040

4141
# we make curl the same version as libcurl
4242
curlversion=$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

4848
if 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
5151
fi
5252

5353
#
@@ -64,46 +64,49 @@ CHEADER=src/tool_version.h
6464
PLIST=lib/libcurl.plist
6565

6666
if 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"
7575
fi
7676

7777
# requires a date command that knows + for format
7878
datestamp=`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:
9092
sed -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:
9396
sed -i.bak "s/7\.12\.3/$libversion/g" $PLIST
97+
rm -f "$PLIST.bak"
9498

9599
if test -n "$only"; then
96-
# done!
97-
exit;
100+
# done!
101+
exit;
98102
fi
99103

100104
echo "curl version $curlversion"
101105
echo "libcurl version $libversion"
102106
echo "libcurl numerical $numeric"
103107
echo "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

Comments
 (0)