Skip to content

Commit 9f9c1e2

Browse files
committed
set_xva_bridge: get TMP_LIST from original archive
ova.xml must come first in the archive order. sort sometimes fails to do this correctly even if LC_ALL is set to "C". Fix this by taking the original file list from tar instead. Signed-off-by: Tu Dinh <[email protected]>
1 parent 1a698d6 commit 9f9c1e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/set_xva_bridge.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ fi
9696
PATHFOLDER=$(dirname "${XVA_NAME}")
9797
TMPFOLDER=$(mktemp -d "${PATHFOLDER}"/xvaXXXX)
9898

99+
# extract and create the file list at the same time
100+
TMP_LIST=$(mktemp "${PATHFOLDER}"/SortedListXXXX.txt)
99101
if [ -f "${XVA_NAME}" ]; then
100-
tar -xf $1 -C "${TMPFOLDER}"
102+
tar -xvf "${XVA_NAME}" -C "${TMPFOLDER}" > "${TMP_LIST}"
101103
else
102104
echo "Error: ${XVA_NAME} not found."
103105
exit 1
@@ -120,8 +122,6 @@ mv "${XVA_NAME}" "${XVA_NAME}.save"
120122
cd "${TMPFOLDER}"
121123

122124
# Create the new XVA
123-
TMP_LIST=$(mktemp /tmp/SortedListXXXX.txt)
124-
find . -print | cut -c3- | sort | grep -v "^Ref:[0-9]\+$" > ${TMP_LIST}
125125
sudo tar -cv --${COMPRESS_METHOD} -f ${XVA_NAME} --no-recursion -T ${TMP_LIST}
126126
rm -f "${TMP_LIST}"
127127

0 commit comments

Comments
 (0)