1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-25 00:45:24 +00:00

Merge pull request #2056 from vcptr/userpkg

user-package script allow custom codename/buildname
This commit is contained in:
Kslr 2019-11-26 19:21:12 +08:00 committed by GitHub
commit 45398c2bc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,14 @@ packtgz() {
echo ">>> Generated: $(basename $PKG)"
}
packtgzAbPath() {
local ABPATH="$1"
echo ">>> Generating tgz package at $ABPATH"
pushd $TMP
tar cvfz $ABPATH .
echo ">>> Generated: $ABPATH"
}
pkg=zip
nosource=0
@ -127,6 +135,15 @@ case $arg in
tgz)
pkg=tgz
;;
abpathtgz=*)
pkg=${arg##abpathtgz=}
;;
codename=*)
CODENAME=${arg##codename=}
;;
buildname=*)
BUILDNAME=${arg##buildname=}
;;
esac
done
@ -135,6 +152,8 @@ if [[ $nosource != 1 ]]; then
fi
export GOOS GOARCH
echo "Build ARGS: GOOS=${GOOS} GOARCH=${GOARCH} CODENAME=${CODENAME} BUILDNAME=${BUILDNAME}"
echo "PKG ARGS: pkg=${pkg}"
build_v2
if [[ $nodat != 1 ]]; then
@ -147,11 +166,12 @@ fi
if [[ $pkg == "zip" ]]; then
packzip
elif [[ $pkg == "tgz" ]]; then
packtgz
else
packtgzAbPath $pkg
fi
if [[ $pkg == "tgz" ]]; then
packtgz
fi
cleanup