mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-05 03:52:07 -04:00
distro:(Workflow) Save the resources
This commit is contained in:
@@ -56,6 +56,15 @@ release_base() {
|
||||
echo "$1" | sed -E 's/ppa[0-9]+$//' | sed -E 's/-[0-9]+$//'
|
||||
}
|
||||
|
||||
ppa_suffix() {
|
||||
local version="$1"
|
||||
if [[ "$version" =~ ppa([0-9]+)$ ]]; then
|
||||
echo "${BASH_REMATCH[1]}"
|
||||
else
|
||||
echo "0"
|
||||
fi
|
||||
}
|
||||
|
||||
embedded_commit() {
|
||||
echo "$1" | sed -nE 's/.*[+~]git[0-9]+\.([a-f0-9]{7,12}).*/\1/p'
|
||||
}
|
||||
@@ -75,6 +84,18 @@ target_ppa() {
|
||||
fi
|
||||
}
|
||||
|
||||
rebuild_release_is_newer() {
|
||||
local series="$1"
|
||||
local published="$2"
|
||||
local requested current
|
||||
|
||||
[[ -n "$REBUILD_RELEASE" ]] || return 1
|
||||
|
||||
requested="$(target_ppa "$series")"
|
||||
current="$(ppa_suffix "$published")"
|
||||
[[ "$requested" -gt "$current" ]]
|
||||
}
|
||||
|
||||
include_package() {
|
||||
local package="$1"
|
||||
[[ "$PACKAGE_FILTER" == "all" || "$PACKAGE_FILTER" == "$package" ]]
|
||||
@@ -93,10 +114,7 @@ for pkg_info in "${PACKAGES[@]}"; do
|
||||
needs_update=false
|
||||
reason=""
|
||||
|
||||
if [[ -n "$REBUILD_RELEASE" ]]; then
|
||||
needs_update=true
|
||||
reason="manual rebuild"
|
||||
elif [[ -z "$ppa_version" ]]; then
|
||||
if [[ -z "$ppa_version" ]]; then
|
||||
needs_update=true
|
||||
reason="missing from ${series}"
|
||||
elif [[ "$type" == "git" ]]; then
|
||||
@@ -116,6 +134,11 @@ for pkg_info in "${PACKAGES[@]}"; do
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$needs_update" != "true" ]] && rebuild_release_is_newer "$series" "$ppa_version"; then
|
||||
needs_update=true
|
||||
reason="rebuild ppa$(ppa_suffix "$ppa_version") -> ppa$(target_ppa "$series")"
|
||||
fi
|
||||
|
||||
if [[ "$needs_update" == "true" ]]; then
|
||||
target="${package}:${series}:$(target_ppa "$series")"
|
||||
TARGETS+=("$target")
|
||||
|
||||
Reference in New Issue
Block a user