1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-28 14:56:33 -04: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)" echo ">>> Generated: $(basename $PKG)"
} }
packtgzAbPath() {
local ABPATH="$1"
echo ">>> Generating tgz package at $ABPATH"
pushd $TMP
tar cvfz $ABPATH .
echo ">>> Generated: $ABPATH"
}
pkg=zip pkg=zip
nosource=0 nosource=0
@ -127,6 +135,15 @@ case $arg in
tgz) tgz)
pkg=tgz pkg=tgz
;; ;;
abpathtgz=*)
pkg=${arg##abpathtgz=}
;;
codename=*)
CODENAME=${arg##codename=}
;;
buildname=*)
BUILDNAME=${arg##buildname=}
;;
esac esac
done done
@ -135,6 +152,8 @@ if [[ $nosource != 1 ]]; then
fi fi
export GOOS GOARCH export GOOS GOARCH
echo "Build ARGS: GOOS=${GOOS} GOARCH=${GOARCH} CODENAME=${CODENAME} BUILDNAME=${BUILDNAME}"
echo "PKG ARGS: pkg=${pkg}"
build_v2 build_v2
if [[ $nodat != 1 ]]; then if [[ $nodat != 1 ]]; then
@ -147,11 +166,12 @@ fi
if [[ $pkg == "zip" ]]; then if [[ $pkg == "zip" ]]; then
packzip packzip
elif [[ $pkg == "tgz" ]]; then
packtgz
else
packtgzAbPath $pkg
fi fi
if [[ $pkg == "tgz" ]]; then
packtgz
fi
cleanup cleanup