From owner-svn-src-head@FreeBSD.ORG Sat Jun 6 13:33:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE8E9106566B; Sat, 6 Jun 2009 13:33:11 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2E5E8FC19; Sat, 6 Jun 2009 13:33:11 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n56DXBGV062551; Sat, 6 Jun 2009 13:33:11 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n56DXBEO062550; Sat, 6 Jun 2009 13:33:11 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906061333.n56DXBEO062550@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 6 Jun 2009 13:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193585 - head/tools/tools/pciid X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 13:33:12 -0000 Author: edwin Date: Sat Jun 6 13:33:11 2009 New Revision: 193585 URL: http://svn.freebsd.org/changeset/base/193585 Log: pciconf(8) removes characters after an #, therefor remove them. Also remove \s used to escape 's. Modified: head/tools/tools/pciid/mk_pci_vendors.pl Modified: head/tools/tools/pciid/mk_pci_vendors.pl ============================================================================== --- head/tools/tools/pciid/mk_pci_vendors.pl Sat Jun 6 12:53:54 2009 (r193584) +++ head/tools/tools/pciid/mk_pci_vendors.pl Sat Jun 6 13:33:11 2009 (r193585) @@ -184,7 +184,7 @@ foreach my $vid (sort keys %vendors) { exit 0; -# Parse a line from the Boemler file and place the vendor id, pciid, +# Parse a line from the Boemler CSV file and place the vendor id, pciid, # vendor description and description in the scalars. # # Returns 0 if there is a problem. @@ -194,17 +194,19 @@ sub vendors_parse($\$\$\$\$) my ($line, $vendorid_ref, $pciid_ref, $vendor_ref, $descr_ref) = @_; my @a = split(/","/, $line); - $a[0] =~ s/0x//; + $a[0] =~ s/0x//; # 0x1234 -> 1234 $a[1] =~ s/0x//; - $a[0] =~ s/^"//; + $a[0] =~ s/^"//; # Remove starting or trailing " $a[4] =~ s/"$//; - $a[0] = uc($a[0]); + $a[0] = uc($a[0]); # Some are lowercase hex-digits $a[1] = uc($a[1]); + # Length of the Vendor ID or PCI ID is not four hex-digits, ignore it return 0 if (length($a[0]) != 4 || length($a[1]) != 4); + # If there is no description, see if the chip data exists and use that if ($a[4] eq "") { if ($a[3] ne "") { $a[4] = $a[3]; @@ -218,9 +220,7 @@ sub vendors_parse($\$\$\$\$) $$pciid_ref = $a[1]; $$vendor_ref = $a[2]; $$descr_ref = clean_descr($a[4]); - if ($a[3] =~ /[a-zA-Z0-0]/) { - $$descr_ref .= clean_descr(" ($a[3])"); - } + $$descr_ref .= clean_descr(" ($a[3])") if ($a[3] =~ /[a-zA-Z0-0]/); return 1; } @@ -255,7 +255,9 @@ sub clean_descr($) { my ($descr) = @_; - $descr =~ s/[^[:print:]]//g; + $descr =~ s/[^[:print:]]//g; # non-printable + $descr =~ s/\\//g; # escape of 's + $descr =~ s/\#/*/g; # pciconf(8) ignores data after this return $descr; }