From: Michal Vaner Date: Sun, 31 Aug 2008 14:47:19 +0000 (+0200) Subject: Check vendors of subsystems X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=56a2e2d5b2f7cf864a2ed432ac9d208298534d6d;p=pciids.git Check vendors of subsystems --- diff --git a/scripts/mailbot b/scripts/mailbot index 864704a..eb4ac66 100755 --- a/scripts/mailbot +++ b/scripts/mailbot @@ -59,11 +59,17 @@ sub submitItem( $$$$$ ) { $id =~ s/(.{8})(.+)/$1\/$2/; $id =~ s/(.{4})(.+)/$1\/$2/; $id = "PC/$id"; + if( length $id > 12 ) { + my( $vendor ) = ( $id =~ /^PC\/....\/....\/(....)/ ); + $vendor = "PC/$vendor"; + $hasItem->execute( $vendor ); + error( "Missing subsystem vendor" ) unless( $hasItem->fetchrow_array ); + } $hasItem->execute( $id ); unless( $hasItem->fetchrow_array ) { tlog( "mailbot: Item created (empty) $id" ); my $parent = $id; - $parent =~ s/\/[^\/]*//; + $parent =~ s/\/[^\/]*$//; $addItem->execute( $id, $parent ); $created = 1; }