1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00

maketgz: delete .bak files, fix indentation

Ref: https://github.com/curl/curl/pull/2660

Closes https://github.com/curl/curl/pull/2662
This commit is contained in:
Viktor Szakats 2018-06-15 23:28:34 +00:00
parent 99ae23c23c
commit 676f4b742d

52
maketgz
View File

@ -1,4 +1,4 @@
#! /bin/sh #!/bin/sh
# Script to build release-archives with. Note that this requires a checkout # Script to build release-archives with. Note that this requires a checkout
# from git and you should first run ./buildconf and build curl once. # 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 # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@ -32,8 +32,8 @@ if [ -z "$version" ]; then
fi fi
if [ "xonly" = "x$2" ]; then if [ "xonly" = "x$2" ]; then
echo "Setup version number only!" echo "Setup version number only!"
only=1 only=1
fi fi
libversion="$version" libversion="$version"
@ -41,13 +41,13 @@ libversion="$version"
# we make curl the same version as libcurl # we make curl the same version as libcurl
curlversion=$libversion curlversion=$libversion
major=`echo $libversion |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"` 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"` patch=`echo $libversion | cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
if test -z "$patch"; then if test -z "$patch"; then
echo "invalid version number? needs to be z.y.z" echo "invalid version number? needs to be z.y.z"
exit exit
fi fi
# #
@ -64,37 +64,41 @@ CHEADER=src/tool_version.h
PLIST=lib/libcurl.plist PLIST=lib/libcurl.plist
if test -z "$only"; then if test -z "$only"; then
ext=".dist" ext=".dist"
# when not setting up version numbers locally # when not setting up version numbers locally
for a in $HEADER $CHEADER $PLIST; do for a in $HEADER $CHEADER $PLIST; do
cp $a "$a$ext" cp $a "$a$ext"
done done
HEADER="$HEADER$ext" HEADER="$HEADER$ext"
CHEADER="$CHEADER$ext" CHEADER="$CHEADER$ext"
PLIST="$PLIST$ext" PLIST="$PLIST$ext"
fi fi
# requires a date command that knows + for format # requires a date command that knows + for format
datestamp=`date +"%F"` datestamp=`date +"%F"`
# Replace version number in header file: # Replace version number in header file:
sed -i.bak -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_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_MAJOR .*/#define LIBCURL_VERSION_MAJOR '$major'/g' \
-e 's/^#define LIBCURL_VERSION_MINOR .*/#define LIBCURL_VERSION_MINOR '$minor'/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_VERSION_PATCH .*/#define LIBCURL_VERSION_PATCH '$patch'/g' \
-e "s/^#define LIBCURL_TIMESTAMP .*/#define LIBCURL_TIMESTAMP \"$datestamp\"/g" \ -e "s/^#define LIBCURL_TIMESTAMP .*/#define LIBCURL_TIMESTAMP \"$datestamp\"/g" \
$HEADER $HEADER
rm -f "$HEADER.bak"
# Replace version number in header file: # Replace version number in header file:
sed -i.bak '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: # Replace version number in plist file:
sed -i.bak "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 if test -n "$only"; then
# done! # done!
exit; exit;
fi fi
echo "curl version $curlversion" echo "curl version $curlversion"
@ -102,8 +106,7 @@ echo "libcurl version $libversion"
echo "libcurl numerical $numeric" echo "libcurl numerical $numeric"
echo "datestamp $datestamp" echo "datestamp $datestamp"
findprog() findprog() {
{
file="$1" file="$1"
for part in `echo $PATH| tr ':' ' '`; do for part in `echo $PATH| tr ':' ' '`; do
path="$part/$file" path="$part/$file"
@ -189,8 +192,7 @@ gzip -dc $targz | xz -6e - > $xz
# #
# Now make a zip archive from the tar.gz original # Now make a zip archive from the tar.gz original
# #
makezip () makezip() {
{
rm -rf $tempdir rm -rf $tempdir
mkdir $tempdir mkdir $tempdir
cd $tempdir cd $tempdir