Skip to contentSkip to conversation

update-pciids: fix PCI_COMPRESSED_IDS value when zlib is disabled

PATCH In review Mike Frysinger 2 participants 3 messages Jan 31, 2012 – Apr 1, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 update-pciids: fix PCI_COMPRESSED_IDS value when zlib is disabled

If you build with zlib disabled, then PCI_COMPRESSED_IDS is not defined, which generates the line in the update script:
PCI_COMPRESSED_IDS=
which in turn causes the update script to warn:
bash: [: : integer expression expected

So default it to 0 to avoid that logic.

---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
index d5ed7ac..86fb0c7 100644
@@ -77,6 +77,7 @@ ls-map.o: ls-map.c $(LSPCIINC)
 setpci.o: setpci.c pciutils.h $(PCIINC)
 common.o: common.c pciutils.h $(PCIINC)
 
+PCI_COMPRESSED_IDS ?= 0
 update-pciids: update-pciids.sh
 	sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@"
 	chmod +x $@
Signature · 1 line
1.7.8.4
#1 lore raw

Hello!

Quoted 7 lines

If you build with zlib disabled, then PCI_COMPRESSED_IDS is not defined, which generates the line in the update script:
PCI_COMPRESSED_IDS=
which in turn causes the update script to warn:
bash: [: : integer expression expected

So default it to 0 to avoid that logic.

I hope that this is already fixed in the current tree, could you please check?

Have a nice fortnight

Signature · 3 lines
Martin `MJ' Mares                          <[email protected]>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Outside of a dog, a book is man's best friend. Inside a dog, it's too dark to read.
#2 lore raw
Quoted 5 lines · On Monday 01 April 2013 15:52:28 Martin Mares wrote:
Quoted 5 lines

If you build with zlib disabled, then PCI_COMPRESSED_IDS is not defined,

which generates the line in the update script:
PCI_COMPRESSED_IDS=

Quoted 7 lines
Quoted 4 lines

which in turn causes the update script to warn:
bash: [: : integer expression expected

So default it to 0 to avoid that logic.

I hope that this is already fixed in the current tree, could you please check?

yeah, i think this commit addressed this in a different way:

commit 4339115006b225c8e33b7427cf5dba6b3831a625

Author: Ville Skyttä <[email protected]>
Date:   Mon May 21 00:35:19 2012 +0300

Fix syntax error when PCI_COMPRESSED_IDS is empty.
-mike