./repack.sh fails with sed error
chron-isch opened this issue · comments
Hello,
currently, on an up to date Archlinux the ./repack.sh script fails with an sed: -e expression #1, char 47: unterminated
s' command`.
Win Surface Go with SurfaceGo-WiFi_Win10_18362_21.063.23730_WiFi_0.msi
sed 4.8
msitools 0.101
gcab 1.4
The problem seems to occure on line 131 of repack.sh.
sed -i "s|{DEVICE}|$DEVICE|g" "$FWDIR"/*.metainfo.xml
I think the problem is that the final $DEVICE contains the device number twice:
After DEVICE=$(grep 'Firmware_Install, *UEFI' "$inf"):
%FirmwareDesc% = Firmware_Install,UEFI\RES_{B4BA55B8-2CCC-40e4-B850-46AB5B4A0FEE} %FirmwareDesc% = Firmware_Install,UEFI\RES_{B4BA55B8-2CCC-40e4-B850-46AB5B4A0FEE}
DEVICE=$(echo "$DEVICE" | cut -d'{' -f2 | cut -d'}' -f1) will return
B4BA55B8-2CCC-40e4-B850-46AB5B4A0FEE B4BA55B8-2CCC-40e4-B850-46AB5B4A0FEE
I have not tested this, but at least the script runs fine with
DEVICE=$(echo $DEVICE | cut -d ' ' -f1)
would b4ba55b8-2ccc-40e4-b850-46ab5b4a0fee
be correct?