update
This commit is contained in:
@@ -23,3 +23,17 @@ TAPM_VIRTIO_LABELED_FILENAME() {
|
||||
|
||||
printf 'virtio-win-%s%s.iso\n' "$label" "${version:+-${version}}"
|
||||
}
|
||||
|
||||
TAPM_VIRTIO_CACHE_VALID() {
|
||||
local checked_at="${1:-}"
|
||||
local now="${2:-}"
|
||||
local max_age="${3:-}"
|
||||
local filename="${4:-}"
|
||||
|
||||
[[ "$checked_at" =~ ^[0-9]+$ &&
|
||||
"$now" =~ ^[0-9]+$ &&
|
||||
"$max_age" =~ ^[1-9][0-9]*$ &&
|
||||
"$filename" =~ ^virtio-win(-[0-9]+\.[0-9]+\.[0-9]+)?\.iso$ ]] ||
|
||||
return 1
|
||||
(( now >= checked_at && now - checked_at < max_age ))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user