2018-11-23 04:17:47 +08:00
|
|
|
#! /bin/sh
|
2020-04-23 20:55:52 +08:00
|
|
|
# Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
|
2018-11-23 21:40:39 +08:00
|
|
|
#
|
2018-12-06 20:03:50 +08:00
|
|
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
2018-11-23 21:40:39 +08:00
|
|
|
# this file except in compliance with the License. You can obtain a copy
|
|
|
|
# in the file LICENSE in the source distribution or at
|
|
|
|
# https://www.openssl.org/source/license.html
|
2018-11-23 04:17:47 +08:00
|
|
|
|
|
|
|
HERE=`dirname $0`
|
|
|
|
|
2020-02-27 08:09:23 +08:00
|
|
|
# Get all version data as shell variables
|
2020-07-16 21:08:30 +08:00
|
|
|
. $HERE/../VERSION.dat
|
2020-02-27 08:09:23 +08:00
|
|
|
|
|
|
|
if [ -n "$PRE_RELEASE_TAG" ]; then PRE_RELEASE_TAG=-$PRE_RELEASE_TAG; fi
|
2022-12-02 13:59:58 +08:00
|
|
|
if [ -n "$BUILD_METADATA" ]; then BUILD_METADATA=+$BUILD_METADATA; fi
|
2020-02-27 08:09:23 +08:00
|
|
|
version=$MAJOR.$MINOR.$PATCH$PRE_RELEASE_TAG$BUILD_METADATA
|
2018-11-23 04:17:47 +08:00
|
|
|
basename=openssl
|
|
|
|
|
|
|
|
NAME="$basename-$version"
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
|
|
|
--name=* ) NAME=`echo "$1" | sed -e 's|[^=]*=||'` ;;
|
|
|
|
--name ) shift; NAME="$1" ;;
|
|
|
|
--tarfile=* ) TARFILE=`echo "$1" | sed -e 's|[^=]*=||'` ;;
|
|
|
|
--tarfile ) shift; TARFILE="$1" ;;
|
|
|
|
* ) echo >&2 "Could not parse '$1'"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "$TARFILE" ]; then TARFILE="$NAME.tar"; fi
|
|
|
|
|
|
|
|
# This counts on .gitattributes to specify what files should be ignored
|
2020-09-10 00:01:17 +08:00
|
|
|
git archive --worktree-attributes -9 --prefix="$NAME/" -o $TARFILE.gz -v HEAD
|
2018-11-23 04:17:47 +08:00
|
|
|
|
2018-11-25 00:51:24 +08:00
|
|
|
# Good old way to ensure we display an absolute path
|
|
|
|
td=`dirname $TARFILE`
|
|
|
|
tf=`basename $TARFILE`
|
|
|
|
ls -l "`cd $td; pwd`/$tf.gz"
|