From 56a2e2d5b2f7cf864a2ed432ac9d208298534d6d Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sun, 31 Aug 2008 16:47:19 +0200 Subject: [PATCH] Check vendors of subsystems --- scripts/mailbot | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- 2.39.5