From: Kurt Roeckx Date: Fri, 4 Sep 2009 18:02:16 +0000 (+0000) Subject: Allow importing packages without version if the state is not-for-us. X-Git-Url: https://git.donarmstrong.com/?p=wannabuild.git;a=commitdiff_plain;h=7b763e902e29b81ecf3ed75560ec428f8814325b Allow importing packages without version if the state is not-for-us. The version doesn't get updated anyway. --- diff --git a/bin/wanna-build b/bin/wanna-build index 8401dff..5b6fd67 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -1938,14 +1938,14 @@ sub check_entry { join( "\n", map { "$_: $pkg->{$_}" } keys %$pkg ), "\n"; die "Database entry lacks package or username field\n"; } - if (!exists $pkg->{'version'}) { - die "Database entry for $pkg->{'package'} lacks Version: field\n"; - } # if no State: field, generate one (for old db compat) if (!exists($pkg->{'state'})) { $pkg->{'state'} = exists $pkg->{'failed'} ? 'Failed' : 'Building'; } + if (!exists $pkg->{'version'} and $pkg->{'state'} ne 'Not-For-Us') { + die "Database entry for $pkg->{'package'} lacks Version: field\n"; + } # check state field die "Bad state $pkg->{'state'} of package $pkg->{Package}\n" if !isin( $pkg->{'state'},