Browse Source

package uploader: do not require build.sh when deleting package

emacs-27
Leonid Plyushch 6 years ago
parent
commit
23b9e7e89a
  1. 86
      scripts/package_uploader.sh

86
scripts/package_uploader.sh

@ -518,57 +518,59 @@ process_packages() {
emergency_exit emergency_exit
fi fi
if [ ! -f "$TERMUX_PACKAGES_BASEDIR/packages/$1/build.sh" ]; then if $PACKAGE_DELETION_MODE; then
msg " * ${package_name}: skipping because such package does not exist." delete_package "$package_name" || continue
continue else
fi if [ ! -f "$TERMUX_PACKAGES_BASEDIR/packages/$1/build.sh" ]; then
msg " * ${package_name}: skipping because such package does not exist."
continue
fi
PACKAGE_METADATA["NAME"]="$package_name" PACKAGE_METADATA["NAME"]="$package_name"
PACKAGE_METADATA["LICENSES"]=$(get_package_property "$package_name" "TERMUX_PKG_LICENSE") PACKAGE_METADATA["LICENSES"]=$(get_package_property "$package_name" "TERMUX_PKG_LICENSE")
if [ -z "${PACKAGE_METADATA['LICENSES']}" ]; then if [ -z "${PACKAGE_METADATA['LICENSES']}" ]; then
msg " * ${package_name}: skipping because field 'TERMUX_PKG_LICENSE' is empty." msg " * ${package_name}: skipping because field 'TERMUX_PKG_LICENSE' is empty."
continue continue
elif grep -qP '.*custom.*' <(echo "${PACKAGE_METADATA['LICENSES']}"); then elif grep -qP '.*custom.*' <(echo "${PACKAGE_METADATA['LICENSES']}"); then
msg " * ${package_name}: skipping because it has custom license." msg " * ${package_name}: skipping because it has custom license."
continue continue
fi fi
PACKAGE_METADATA["DESCRIPTION"]=$(get_package_property "$package_name" "TERMUX_PKG_DESCRIPTION") PACKAGE_METADATA["DESCRIPTION"]=$(get_package_property "$package_name" "TERMUX_PKG_DESCRIPTION")
if [ -z "${PACKAGE_METADATA['DESCRIPTION']}" ]; then if [ -z "${PACKAGE_METADATA['DESCRIPTION']}" ]; then
msg " * ${package_name}: skipping because field 'TERMUX_PKG_DESCRIPTION' is empty." msg " * ${package_name}: skipping because field 'TERMUX_PKG_DESCRIPTION' is empty."
continue continue
fi fi
PACKAGE_METADATA["WEBSITE_URL"]=$(get_package_property "$package_name" "TERMUX_PKG_HOMEPAGE") PACKAGE_METADATA["WEBSITE_URL"]=$(get_package_property "$package_name" "TERMUX_PKG_HOMEPAGE")
if [ -z "${PACKAGE_METADATA['WEBSITE_URL']}" ]; then if [ -z "${PACKAGE_METADATA['WEBSITE_URL']}" ]; then
msg " * ${package_name}: skipping because field 'TERMUX_PKG_HOMEPAGE' is empty." msg " * ${package_name}: skipping because field 'TERMUX_PKG_HOMEPAGE' is empty."
continue continue
fi fi
PACKAGE_METADATA["VERSION"]=$(get_package_property "$package_name" "TERMUX_PKG_VERSION") PACKAGE_METADATA["VERSION"]=$(get_package_property "$package_name" "TERMUX_PKG_VERSION")
if [ -z "${PACKAGE_METADATA['VERSION']}" ]; then if [ -z "${PACKAGE_METADATA['VERSION']}" ]; then
msg " * ${package_name}: skipping because field 'TERMUX_PKG_VERSION' is empty." msg " * ${package_name}: skipping because field 'TERMUX_PKG_VERSION' is empty."
continue continue
fi fi
PACKAGE_METADATA["REVISION"]=$(get_package_property "$package_name" "TERMUX_PKG_REVISION") PACKAGE_METADATA["REVISION"]=$(get_package_property "$package_name" "TERMUX_PKG_REVISION")
if [ -n "${PACKAGE_METADATA['REVISION']}" ]; then if [ -n "${PACKAGE_METADATA['REVISION']}" ]; then
PACKAGE_METADATA["VERSION_FULL"]="${PACKAGE_METADATA['VERSION']}-${PACKAGE_METADATA['REVISION']}" PACKAGE_METADATA["VERSION_FULL"]="${PACKAGE_METADATA['VERSION']}-${PACKAGE_METADATA['REVISION']}"
else
if [ "${PACKAGE_METADATA['VERSION']}" != "${PACKAGE_METADATA['VERSION']/-/}" ]; then
PACKAGE_METADATA["VERSION_FULL"]="${PACKAGE_METADATA['VERSION']}-0"
else else
PACKAGE_METADATA["VERSION_FULL"]="${PACKAGE_METADATA['VERSION']}" if [ "${PACKAGE_METADATA['VERSION']}" != "${PACKAGE_METADATA['VERSION']/-/}" ]; then
PACKAGE_METADATA["VERSION_FULL"]="${PACKAGE_METADATA['VERSION']}-0"
else
PACKAGE_METADATA["VERSION_FULL"]="${PACKAGE_METADATA['VERSION']}"
fi
fi fi
fi
if $PACKAGE_CLEANUP_MODE; then if $PACKAGE_CLEANUP_MODE; then
delete_old_versions_from_package "$package_name" || continue delete_old_versions_from_package "$package_name" || continue
elif $PACKAGE_DELETION_MODE; then else
delete_package "$package_name" || continue upload_package "$package_name" || continue
else fi
upload_package "$package_name" || continue
fi fi
done done

Loading…
Cancel
Save