package uploader: keep old versions currently, always replace deb files with same name
It seems that metadata generation take about 40 seconds. If we submit a new version of package with deleting previous one, users will observe 404 errors until new metadata will be published.
This commit is contained in:
parent
7c86a369a3
commit
0d53b9abe1
@ -32,7 +32,6 @@ declare -gA PACKAGE_METADATA
|
||||
# Initialize default configuration.
|
||||
DEBFILES_DIR_PATH="$TERMUX_PACKAGES_BASEDIR/debs"
|
||||
PACKAGE_DELETE_MODE=false
|
||||
KEEP_OLD_VERSION=false
|
||||
|
||||
# Bintray-specific configuration.
|
||||
BINTRAY_REPO_NAME="termux-packages-24"
|
||||
@ -170,11 +169,6 @@ upload_package() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! $KEEP_OLD_VERSION; then
|
||||
# Delete entry for package (with all related debfiles).
|
||||
delete_package "$package_name"
|
||||
fi
|
||||
|
||||
# Create new entry for package.
|
||||
echo -n "[@] Creating entry for version '${PACKAGE_METADATA['VERSION_FULL']}' of package '$package_name'... " >&2
|
||||
curl_response=$(
|
||||
@ -403,17 +397,6 @@ show_usage() {
|
||||
echo "Primarily indended to be used by Gitlab CI for automatic"
|
||||
echo "package uploads but it can be used for manual uploads too."
|
||||
echo
|
||||
echo "By default, this script will create a new version entries"
|
||||
echo "for specified packages and upload *.deb files for each of"
|
||||
echo "created entries."
|
||||
echo
|
||||
echo "Note that if version entry already exists, it will be"
|
||||
echo "deleted with all associated *.deb files to prevent file"
|
||||
echo "name collisions and wasting of available space."
|
||||
echo
|
||||
echo "If such behaviour is unwanted, use option '-k' which will"
|
||||
echo "not touch available versions."
|
||||
echo
|
||||
echo "Before using this script, check that you have all"
|
||||
echo "necessary credentials for accessing repository."
|
||||
echo
|
||||
@ -434,12 +417,6 @@ show_usage() {
|
||||
echo
|
||||
echo " -h, --help Print this help."
|
||||
echo
|
||||
echo " -k, --keep-old Prevent deletion of previous versions"
|
||||
echo " when submitting package. Useful when"
|
||||
echo " doing uploads within same package"
|
||||
echo " versions or just to make downgrading"
|
||||
echo " possible."
|
||||
echo
|
||||
echo " -p, --path [path] Specify a directory containing *.deb"
|
||||
echo " files ready for uploading."
|
||||
echo " Default is './debs'."
|
||||
@ -450,7 +427,7 @@ show_usage() {
|
||||
|
||||
###################################################################
|
||||
|
||||
while getopts ":-:hdkp:" opt; do
|
||||
while getopts ":-:hdp:" opt; do
|
||||
case "$opt" in
|
||||
-)
|
||||
case "$OPTARG" in
|
||||
@ -477,9 +454,6 @@ while getopts ":-:hdkp:" opt; do
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
keep-old)
|
||||
KEEP_OLD_VERSION=true
|
||||
;;
|
||||
*)
|
||||
echo "[!] Invalid option '$OPTARG'." >&2
|
||||
show_usage
|
||||
@ -494,9 +468,6 @@ while getopts ":-:hdkp:" opt; do
|
||||
show_usage
|
||||
exit 0
|
||||
;;
|
||||
k)
|
||||
KEEP_OLD_VERSION=true
|
||||
;;
|
||||
p)
|
||||
DEBFILES_DIR_PATH="${OPTARG}"
|
||||
if [ ! -d "$DEBFILES_DIR_PATH" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user