]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
Allow importing packages without version if the state is not-for-us.
[wannabuild.git] / bin / wanna-build
index 002d4521aae60fce335cf0dedb7c8365ce067591..5b6fd6784b3ed1a748b5f189dad5a8eebe918a3e 100755 (executable)
@@ -24,8 +24,7 @@ package conf;
 $basedir ||= "/var/lib/debbuild";
 $dbbase ||= "build-db";
 $transactlog ||= "transactions.log";
-#$mailprog ||= "/usr/sbin/sendmail";
-$mailprog = "/bin/true";
+$mailprog ||= "/usr/sbin/sendmail";
 require "/etc/wanna-build.conf";
 die "$conf::basedir is not a directory\n" if ! -d $conf::basedir;
 die "dbbase is empty\n" if ! $dbbase;
@@ -1939,18 +1938,18 @@ 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'},
-                                 qw(Needs-Build Building Built Build-Attempted Uploaded Installed Dep-Wait
+                                 qw(Needs-Build Building Built Build-Attempted Uploaded Installed Dep-Wait Dep-Wait-Removed
                                         Failed Failed-Removed Not-For-Us BD-Uninstallable
                                         ) );
 }
@@ -2375,11 +2374,11 @@ sub pkg_version_eq {
 }
 
 sub table_name {
-       return $arch;
+       return '"' . $arch . '".packages';
 }
 
 sub user_table_name {
-       return $arch . '_users';
+       return '"' . $arch . '".users';
 }
 
 sub get_source_info {