feat: add the suffix name of the specified offline package

This commit is contained in:
junjie.miao
2025-06-04 16:59:23 +08:00
parent 8173b91807
commit 749664db6d

View File

@ -23,6 +23,7 @@ if [[ "arm64" == "$ARCH_NAME" || "aarch64" == "$ARCH_NAME" ]]; then
fi fi
PIP_PLATFORM="" PIP_PLATFORM=""
PACKAGE_SUFFIX="offline"
market(){ market(){
if [[ -z "$2" || -z "$3" || -z "$4" ]]; then if [[ -z "$2" || -z "$3" || -z "$4" ]]; then
@ -136,7 +137,7 @@ repackage(){
fi fi
cd ${CURR_DIR} cd ${CURR_DIR}
chmod 755 ${CURR_DIR}/${CMD_NAME} chmod 755 ${CURR_DIR}/${CMD_NAME}
${CURR_DIR}/${CMD_NAME} plugin package ${CURR_DIR}/${PACKAGE_NAME} -o ${CURR_DIR}/${PACKAGE_NAME}-offline.difypkg ${CURR_DIR}/${CMD_NAME} plugin package ${CURR_DIR}/${PACKAGE_NAME} -o ${CURR_DIR}/${PACKAGE_NAME}-${PACKAGE_SUFFIX}.difypkg
echo "Repackage success." echo "Repackage success."
} }
@ -152,18 +153,24 @@ install_unzip(){
} }
print_usage() { print_usage() {
echo "usage: $0 [-p platform] {market|github|local}" echo "usage: $0 [-p platform] [-s package_suffix] {market|github|local}"
echo "-p platform: python packages' platform. Using for crossing repacking." echo "-p platform: python packages' platform. Using for crossing repacking.
For example: -p manylinux2014_x86_64 or -p manylinux2014_aarch64"
echo "-s package_suffix: The suffix name of the output offline package.
For example: -s linux-amd64 or -s linux-arm64"
exit 1 exit 1
} }
while getopts "p:" opt; do while getopts "p:s:" opt; do
case "$opt" in case "$opt" in
p) PIP_PLATFORM="--platform ${OPTARG} --only-binary=:all:"; shift $((OPTIND - 1)) ;; p) PIP_PLATFORM="--platform ${OPTARG} --only-binary=:all:" ;;
s) PACKAGE_SUFFIX="${OPTARG}" ;;
*) print_usage; exit 1 ;; *) print_usage; exit 1 ;;
esac esac
done done
shift $((OPTIND - 1))
echo "$1" echo "$1"
case "$1" in case "$1" in
'market') 'market')