Refactor to avoid deprecated wmic execution (#18122)

* wmic deprecated?

* Update platforms/avr/flash.mk

* Update platforms/avr/flash.mk
This commit is contained in:
Joel Challis 2022-10-31 20:16:43 +00:00 committed by GitHub
parent a45607f4e6
commit 96c48a5f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,7 @@ AVRDUDE_PROGRAMMER ?= avrdude
define EXEC_AVRDUDE define EXEC_AVRDUDE
list_devices() { \ list_devices() { \
if $(GREP) -q -s icrosoft /proc/version; then \ if $(GREP) -q -s icrosoft /proc/version; then \
wmic.exe path Win32_SerialPort get DeviceID 2>/dev/null | LANG=C perl -pne 's/COM(\d+)/COM.($$1-1)/e' | sed 's!COM!/dev/ttyS!' | xargs echo -n | sort; \ powershell.exe 'Get-CimInstance -Class Win32_SerialPort | Select -ExpandProperty "DeviceID"' 2>/dev/null | sed -e "s/\r//g" | LANG=C perl -pne 's/COM(\d+)/COM.($$1-1)/e' | sed 's!COM!/dev/ttyS!' | sort; \
elif [ "`uname`" = "FreeBSD" ]; then \ elif [ "`uname`" = "FreeBSD" ]; then \
ls /dev/tty* | grep -v '\.lock$$' | grep -v '\.init$$'; \ ls /dev/tty* | grep -v '\.lock$$' | grep -v '\.init$$'; \
else \ else \