Files
wehub-resource-sync e904b667c6
Build/Publish Develop Docs / deploy (push) Failing after 1s
PaddleOCR Code Style Check / check-code-style (push) Failing after 1s
PaddleOCR PR Tests GPU / detect-changes (push) Failing after 1s
PaddleOCR PR Tests / detect-changes (push) Failing after 1s
PaddleOCR PR Tests GPU / test-pr-gpu (push) Has been cancelled
PaddleOCR PR Tests / test-pr (push) Has been cancelled
PaddleOCR PR Tests GPU / test-pr-gpu-impl (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.13) (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.8) (push) Has been cancelled
PaddleOCR PR Tests / test-pr-python (3.9) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:59:26 +08:00

48 lines
1.2 KiB
Bash

#!/usr/bin/env bash
pip_build_arg_suffix() {
local v="$1"
[[ -z "$v" ]] && {
echo ""
return
}
if [[ "$v" == '=='* ]]; then
echo "$v"
return
fi
if [[ "$v" == '>='* ]] || [[ "$v" == '<='* ]] || [[ "$v" == '~='* ]] || [[ "$v" == '!='* ]]; then
echo "$v"
return
fi
if [[ "$v" == '<'* ]] || [[ "$v" == '>'* ]]; then
echo "$v"
return
fi
if [[ "$v" =~ ^(https?://|git\+|file://) ]]; then
echo " @${v}"
return
fi
if [[ "$v" == @* ]]; then
echo " @${v#@}"
return
fi
echo "==${v}"
}
version_tag_label() {
local v="$1"
if [[ "$v" =~ ^(https?://|git\+|file://) ]] || [[ "$v" == @* ]]; then
if command -v shasum >/dev/null 2>&1; then
printf 'u%s' "$(printf '%s' "$v" | shasum -a 256 | cut -c1-8)"
elif command -v sha256sum >/dev/null 2>&1; then
printf 'u%s' "$(printf '%s' "$v" | sha256sum | cut -c1-8)"
else
printf 'u%s' "$(printf '%s' "$v" | cksum | cut -c1-8)"
fi
else
local s="$v"
[[ "$s" == '=='* ]] && s="${s#==}"
echo "${s%.*}"
fi
}