mirror of
https://github.com/dockur/windows.git
synced 2026-08-24 15:48:59 +01:00
fix: Handle answer files without product keys (#2097)
This commit is contained in:
+9
-1
@@ -1198,7 +1198,15 @@ removeEmbeddedProductKeys() {
|
|||||||
|
|
||||||
local product_keys='//u:ProductKey'
|
local product_keys='//u:ProductKey'
|
||||||
local separator=$'\x1f' delete_xpath=""
|
local separator=$'\x1f' delete_xpath=""
|
||||||
local records position child_key direct_key
|
local count records position child_key direct_key
|
||||||
|
|
||||||
|
count=$(xmlstarlet sel \
|
||||||
|
-N "$XML_NS_UNATTEND_ARG" -T -t \
|
||||||
|
-v "count($product_keys)" \
|
||||||
|
"$asset") || return 1
|
||||||
|
|
||||||
|
[[ "$count" =~ ^[0-9]+$ ]] || return 1
|
||||||
|
(( count == 0 )) && return 0
|
||||||
|
|
||||||
records=$(xmlstarlet sel \
|
records=$(xmlstarlet sel \
|
||||||
-N "$XML_NS_UNATTEND_ARG" -T -t \
|
-N "$XML_NS_UNATTEND_ARG" -T -t \
|
||||||
|
|||||||
Reference in New Issue
Block a user