Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#29031 - [pciutils] Bash bug in /usr/sbin/update-pciids

Attached to Project: Arch Linux
Opened by Nicolas Michel (sylock) - Wednesday, 21 March 2012, 10:42 GMT
Last edited by Tobias Powalowski (tpowa) - Wednesday, 23 May 2012, 13:19 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
When trying to update the pci ids database there is an error message :
[root@myhost ~]# update-pciids
/usr/sbin/update-pciids: line 18: [: : integer expression expected

The problem sits in line 8 where PCI_COMPRESSED_IDS is set to nothing.
At line 18 there is a test to see if the variable equal 1. Of course it fails doing the comparison.
That code is a nonsense since there is no code that could change the value of PCI_COMPRESSED_IDS after its definition and before the comparison. So I suppose the script miss some code?


1 #!/bin/sh
2
3 [ "$1" = "-q" ] && quiet=true || quiet=false
4
5 set -e
6 SRC="http://pci-ids.ucw.cz/v2.2/pci.ids"
7 DEST=/usr/share/hwdata/pci.ids
8 PCI_COMPRESSED_IDS=
9 GREP=grep
10
11 # if pci.ids is read-only (because the filesystem is read-only),
12 # then just skip this whole process.
13 if ! touch ${DEST} >/dev/null 2>&1 ; then
14 ${quiet} || echo "${DEST} is read-only, exiting." 1>&2
15 exit 1
16 fi
17
18 if [ "$PCI_COMPRESSED_IDS" -eq 1 ] ; then
19 DECOMP="cat"
20 SRC="$SRC.gz"
21 GREP=zgrep
22 elif which bzip2 >/dev/null 2>&1 ; then
23 DECOMP="bzip2 -d"
24 SRC="$SRC.bz2"
25 elif which gzip >/dev/null 2>&1 ; then
26 DECOMP="gzip -d"
27 SRC="$SRC.gz"
28 else
29 DECOMP="cat"
30 fi


Additional info:
* package version(s)
core/pciutils 3.1.9-1 (base) [installed]
* config and/or log files etc.


Steps to reproduce:
launch : /usr/sbin/update-pciids
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Wednesday, 23 May 2012, 13:19 GMT
Reason for closing:  Fixed
Comment by Stephen Hassard (shassard) - Friday, 27 April 2012, 18:39 GMT
Here's a very small patch to set the PCI_COMPRESSED_IDS variable to something sane which fixes the bash error.
Comment by Tobias Powalowski (tpowa) - Wednesday, 23 May 2012, 13:19 GMT
script removed from package, closing this bug.

Loading...