+ # Special support to enable clean auto-building of accepted packages
+ if Cnf.FindB("Dinstall::SpecialAcceptedAutoBuild") and \
+ self.pkg.changes["distribution"].has_key("unstable"):
+ self.projectB.query("BEGIN WORK");
+ for file in file_keys:
+ src = os.path.join(Cnf["Dir::Queue::Accepted"], file);
+ dest = os.path.join(Cnf["Dir::AcceptedAutoBuild"], file);
+ # Create a symlink to it
+ os.symlink(src, dest);
+ # Add it to the list of packages for later processing by apt-ftparchive
+ self.projectB.query("INSERT INTO unstable_accepted (filename, in_accepted) VALUES ('%s', 't')" % (dest));
+ # If the .orig.tar.gz is in the pool, create a symlink to
+ # it (if one doesn't already exist)
+ if self.pkg.orig_tar_id:
+ # Determine the .orig.tar.gz file name
+ for dsc_file in self.pkg.dsc_files.keys():
+ if dsc_file[-12:] == ".orig.tar.gz":
+ filename = dsc_file;
+ dest = os.path.join(Cnf["Dir::AcceptedAutoBuild"],filename);
+ # If it doesn't exist, create a symlink
+ if not os.path.exists(dest):
+ # Find the .orig.tar.gz in the pool
+ q = self.projectB.query("SELECT l.path, f.filename from location l, files f WHERE f.id = %s and f.location = l.id" % (self.pkg.orig_tar_id));
+ ql = q.getresult();
+ if not ql:
+ utils.fubar("[INTERNAL ERROR] Couldn't find id %s in files table." % (self.pkg.orig_tar_id));
+ src = os.path.join(ql[0][0], ql[0][1]);
+ os.symlink(src, dest);
+ # Add it to the list of packages for later processing by apt-ftparchive
+ self.projectB.query("INSERT INTO unstable_accepted (filename, in_accepted) VALUES ('%s', 't')" % (dest));
+
+ self.projectB.query("COMMIT WORK");
+