]> git.decadent.org.uk Git - dak.git/commitdiff
Merge remote branch 'ftpmaster/master'
authorMark Hymers <mhy@debian.org>
Thu, 28 Jul 2011 07:46:12 +0000 (08:46 +0100)
committerMark Hymers <mhy@debian.org>
Thu, 28 Jul 2011 07:46:12 +0000 (08:46 +0100)
21 files changed:
config/backports/dak.conf
config/debian-security/dak.conf
config/debian/dak.conf
dak/check_archive.py
dak/check_proposed_updates.py
dak/cruft_report.py
dak/override.py
dak/override_disparity.py
dak/process_upload.py
dak/rm.py
dak/split_done.py
dak/transitions.py
dak/update_db.py
daklib/dbconn.py
daklib/holding.py
daklib/queue.py
docs/README.config
setup/README
setup/dak-minimal.conf.template [new file with mode: 0644]
setup/init_core
setup/init_minimal_conf [new file with mode: 0755]

index d019f8774a425ea45a45d0e7453f2fa4e70bfc19..36e1a58ecdc05c7081d05ca24fcaf70f1598bd81 100644 (file)
@@ -29,10 +29,7 @@ Dinstall
    CloseBugs "false";
    OverrideDisparityCheck "false";
    DefaultSuite "lenny-backports";
-   Reject
-   {
-     ReleaseTransitions "/srv/backports-master.debian.org/hints/transitions.yaml";
-   };
+   ReleaseTransitions "/srv/backports-master.debian.org/hints/transitions.yaml";
    // If set, only send mails to addresses listed there.
    // format of entries: one entry per line. Either an email address directly, or a regular expression,
    // prefixed by "RE:". Examples: "jane.doe@domain.com" or "RE:jane[^@]@domain.com", where the first will
@@ -205,25 +202,24 @@ Dir
   Pool "/srv/backports-master.debian.org/ftp/pool/";
   Export "/srv/backports-master.debian.org/export/";
   Templates "/srv/backports-master.debian.org/dak/templates/";
-  PoolRoot "pool/";
   Lists "/srv/backports-master.debian.org/database/dists/";
   Cache "/srv/backports-master.debian.org/database/";
   Log "/srv/backports-master.debian.org/log/";
   Lock "/srv/backports-master.debian.org/lock";
   Morgue "/srv/backports-master.debian.org/morgue/";
   Override "/srv/backports-master.debian.org/scripts/override/";
-  QueueBuild "/srv/backports-master.debian.org/buildd/";
   UrgencyLog "/srv/backports-master.debian.org/testing/urgencies/";
   TempPath "/srv/backports-master.debian.org/tmp";
+  BTSVersionTrack "/srv/backports-master.debian.org/queue/bts_version_track/";
+  Holding "/srv/backports-master.debian.org/queue/holding/";
+  Done "/srv/backports-master.debian.org/queue/done/";
+
   Queue
   {
     Byhand "/srv/backports-master.debian.org/queue/byhand/";
-    Done "/srv/backports-master.debian.org/queue/done/";
-    Holding "/srv/backports-master.debian.org/queue/holding/";
     New "/srv/backports-master.debian.org/queue/new/";
     Reject "/srv/backports-master.debian.org/queue/reject/";
     Unchecked "/srv/backports-master.debian.org/queue/unchecked/";
-    BTSVersionTrack "/srv/backports-master.debian.org/queue/bts_version_track/";
     Newstage "/srv/backports-master.debian.org/queue/newstage/";
     Embargoed "/srv/backports-master.debian.org/queue/Embargoed/";
     Unembargoed "/srv/backports-master.debian.org/queue/Unembargoed/";
index 1cf71a26c7de85382168176c3eb26f91547fd86b..96fb97f9fa7632bd4a5a54759ee806994544de7b 100644 (file)
@@ -20,13 +20,6 @@ Dinstall
    CloseBugs "false";
    OverrideDisparityCheck "false";
    BXANotify "false";
-   QueueBuildSuites
-   {
-     stable;
-     testing;
-   };
-   SecurityQueueHandling "true";     
-   SecurityQueueBuild "true";     
    DefaultSuite "stable";
    SuiteSuffix "updates/";
    OverrideMaintainer "dak@security.debian.org";
@@ -112,7 +105,6 @@ Clean-Suites
 {
   // How long (in seconds) dead packages are left before being killed
   StayOfExecution 129600; // 1.5 days
-  QueueBuildStayOfExecution 86400; // 24 hours
   MorgueSubDir "pool";
   OverrideFilename "override.source-only";
 };
@@ -214,7 +206,6 @@ Dir
   Export "/srv/security-master.debian.org/export/";
   Dak "/srv/security-master.debian.org/dak/";
   Templates "/srv/security-master.debian.org/dak/templates/";
-  PoolRoot "pool/";
   Override "/srv/security-master.debian.org/override/";
   Lock "/srv/security-master.debian.org/lock/";
   Cache "/srv/security-master.debian.org/database/";
@@ -222,14 +213,14 @@ Dir
   Log "/srv/security-master.debian.org/dak-log/";
   Morgue "/srv/security-master.debian.org/morgue/";
   Override "/srv/security-master.debian.org/scripts/override/";
-  QueueBuild "/srv/security-master.debian.org/buildd/";
   Upload "/srv/queued/ftpmaster/";
   TempPath "/srv/security-master.debian.org/tmp";
+  Holding "/srv/security-master.debian.org/queue/holding/";
+  Done "/srv/security-master.debian.org/queue/done/";
+
   Queue
   {
     Byhand "/srv/security-master.debian.org/queue/byhand/";
-    Done "/srv/security-master.debian.org/queue/done/";
-    Holding "/srv/security-master.debian.org/queue/holding/";
     New "/srv/security-master.debian.org/queue/new/";
     Reject "/srv/security-master.debian.org/queue/reject/";
     Unchecked "/srv/security-master.debian.org/queue/unchecked/";
index 8b1b43220b4b9600a15f352462defbb94f4fc328..24f662e113b25b818ccda92016acd193fe42fdee 100644 (file)
@@ -21,10 +21,7 @@ Dinstall
    OverrideDisparityCheck "true";
    DefaultSuite "unstable";
    LintianTags "/srv/ftp-master.debian.org/dak/config/debian/lintian.tags";
-   Reject
-   {
-     ReleaseTransitions "/srv/ftp.debian.org/web/transitions.yaml";
-   };
+   ReleaseTransitions "/srv/ftp.debian.org/web/transitions.yaml";
    // if you setup an own dak repository and want to upload Debian packages you most possibly want
    // to set the following option to a real path/filename and then enter those mail addresses that
    // you want to be able to receive mails generated by your dak installation. This avoids spamming
@@ -306,7 +303,6 @@ Dir
   Pool "/srv/ftp-master.debian.org/ftp/pool/";
   Templates "/srv/ftp-master.debian.org/dak/templates/";
   Export "/srv/ftp-master.debian.org/export/";
-  PoolRoot "pool/";
   Lists "/srv/ftp-master.debian.org/database/dists/";
   Cache "/srv/ftp-master.debian.org/database/";
   Log "/srv/ftp-master.debian.org/log/";
@@ -315,19 +311,20 @@ Dir
   Override "/srv/ftp-master.debian.org/scripts/override/";
   UrgencyLog "/srv/release.debian.org/britney/input/urgencies/";
   TempPath "/srv/ftp-master.debian.org/tmp/";
+  BTSVersionTrack "/srv/ftp-master.debian.org/queue/bts_version_track/";
+  Holding "/srv/ftp-master.debian.org/queue/holding/";
+  Done "/srv/ftp-master.debian.org/queue/done/";
+
   Queue
   {
     Byhand "/srv/ftp-master.debian.org/queue/byhand/";
     ProposedUpdates "/srv/ftp-master.debian.org/queue/p-u-new/";
     OldProposedUpdates "/srv/ftp-master.debian.org/queue/o-p-u-new/";
     ProposedUpdates "/srv/ftp-master.debian.org/queue/p-u-new/";
-    Done "/srv/ftp-master.debian.org/queue/done/";
-    Holding "/srv/ftp-master.debian.org/queue/holding/";
     New "/srv/ftp-master.debian.org/queue/new/";
     Reject "/srv/ftp-master.debian.org/queue/reject/";
     Unchecked "/srv/ftp-master.debian.org/queue/unchecked/";
     Newstage "/srv/ftp-master.debian.org/queue/newstage/";
-    BTSVersionTrack "/srv/ftp-master.debian.org/queue/bts_version_track/";
     Embargoed "/srv/ftp-master.debian.org/does/not/exist/";
     Unembargoed "/srv/ftp-master.debian.org/does/not/exist/";
     Disembargo "/srv/ftp-master.debian.org/does/not/exist/";
index 0d94bbcb1394f14c8c26107a258ab1979c256e97..1fb8560baaa628bb61abec14f56adce4094b50ac 100755 (executable)
@@ -424,7 +424,7 @@ def check_indices_files_exist():
     Ensure files mentioned in Packages & Sources exist
     """
     for suite in [ "stable", "testing", "unstable" ]:
-        for component in Cnf.ValueList("Suite::%s::Components" % (suite)):
+        for component in get_component_names():
             architectures = get_suite_architectures(suite)
             for arch in [ i.arch_string.lower() for i in architectures ]:
                 if arch == "source":
index eb488330e951d341a302f861002b1ce0e62eb406..d45fd489c61d6815510d8e37adc6a2f08cfe8266 100755 (executable)
@@ -250,7 +250,7 @@ def parse_packages():
     # Parse the Packages files (since it's a sub-second operation on auric)
     suite = "stable"
     stable = {}
-    components = cnf.ValueList("Suite::%s::Components" % (suite))
+    components = get_component_names()
     architectures = [ a.arch_string for a in get_suite_architectures(suite, skipsrc=True, skipall=True) ]
     for component in components:
         for architecture in architectures:
index 08d336d4466ea41fcef987c49a9fa105006e8b45..5b199dcab8de5756ec347f9ef96f349f63ae8025 100755 (executable)
@@ -518,7 +518,8 @@ def main ():
     for i in [ "help" ]:
         if not cnf.has_key("Cruft-Report::Options::%s" % (i)):
             cnf["Cruft-Report::Options::%s" % (i)] = ""
-    cnf["Cruft-Report::Options::Suite"] = cnf["Dinstall::DefaultSuite"]
+
+    cnf["Cruft-Report::Options::Suite"] = cnf.get("Dinstall::DefaultSuite", "unstable")
 
     if not cnf.has_key("Cruft-Report::Options::Mode"):
         cnf["Cruft-Report::Options::Mode"] = "daily"
@@ -570,7 +571,7 @@ def main ():
         bins_in_suite = get_suite_binaries(suite, session)
 
     # Checks based on the Sources files
-    components = cnf.ValueList("Suite::%s::Components" % (suite_name))
+    components = get_component_names(session)
     for component in components:
         filename = "%s/dists/%s/%s/source/Sources.gz" % (cnf["Dir::Root"], suite_name, component)
         # apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance...
index e6d47db22b01b3c34f162356e5730fbc5ae40bf3..de888e55380115358c842cd94ae0d0392df57b6f 100755 (executable)
@@ -61,7 +61,7 @@ def check_override_compliance(package, priority, suite, cnf, session):
 
     depends = set()
     rdepends = set()
-    components = cnf.ValueList("Suite::%s::Components" % suite)
+    components = get_component_names(session)
     arches = set([x.arch_string for x in get_suite_architectures(suite)])
     arches -= set(["source", "all"])
     for arch in arches:
index b0218517048e564ac82d022b7b4de173ea405bbb..3ec6ff1f96d20832cf6a549e5fa3abb3efbb39f5 100755 (executable)
@@ -82,7 +82,7 @@ def main():
     depends = {}
     session = DBConn().session()
     suite = Options['suite']
-    components = cnf.ValueList('Suite::%s::Components' % suite)
+    components = get_component_names(session)
     arches = set([x.arch_string for x in get_suite_architectures(suite)])
     arches -= set(['source', 'all'])
     for arch in arches:
index 4e734da46d58cfd7756c22d11f4418a9e808a437..bf74baa65be064e356abaa8459b39a6688c85ad9 100755 (executable)
@@ -364,7 +364,7 @@ def process_it(changes_file, session):
         # If this is the Real Thing(tm), copy things into a private
         # holding directory first to avoid replacable file races.
         if not Options["No-Action"]:
-            os.chdir(cnf["Dir::Queue::Holding"])
+            holding.chdir_to_holding()
 
             # Absolutize the filename to avoid the requirement of being in the
             # same directory as the .changes file.
@@ -455,7 +455,7 @@ def main():
 
     # Obtain lock if not in no-action mode and initialize the log
     if not Options["No-Action"]:
-        lock_fd = os.open(cnf["Dinstall::LockFile"], os.O_RDWR | os.O_CREAT)
+        lock_fd = os.open(os.path.join(cnf["Dir::Lock"], 'dinstall.lock'), os.O_RDWR | os.O_CREAT)
         try:
             fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
         except IOError, e:
index 944a46e6a0b1e5811387058e3b90743bed82a1c5..e0a5fa79d73653d538067f0947330222cae109e3 100755 (executable)
--- a/dak/rm.py
+++ b/dak/rm.py
@@ -102,7 +102,7 @@ def reverse_depends_check(removals, suites, arches=None):
     cnf = Config()
 
     print "Checking reverse dependencies..."
-    components = cnf.ValueList("Suite::%s::Components" % suites[0])
+    components = get_component_names()
     dep_problem = 0
     p2c = {}
     all_broken = {}
index 87b38827706ac752a17afc91f7a629070f9c3a08..3d07287240f18fb4e5272274dffc53fa8fe7d760 100755 (executable)
@@ -29,8 +29,8 @@ def main():
     Cnf = utils.get_conf()
     count = 0
     move_date = int(time.time())
-    os.chdir(Cnf["Dir::Queue::Done"])
-    files = glob.glob("%s/*" % (Cnf["Dir::Queue::Done"]))
+    os.chdir(Cnf["Dir::Done"])
+    files = glob.glob("%s/*" % (Cnf["Dir::Done"]))
     for filename in files:
         if os.path.isfile(filename):
             filemtime = os.stat(filename)[stat.ST_MTIME]
index 157e1c0a0febbcf6074f03ad49115c88ac583373..e2461ad2ef56b82ee0cb19bc7fdb7e14f106dcce 100755 (executable)
@@ -255,7 +255,7 @@ def write_transitions(from_trans):
 
     """
 
-    trans_file = Cnf["Dinstall::Reject::ReleaseTransitions"]
+    trans_file = Cnf["Dinstall::ReleaseTransitions"]
     trans_temp = trans_file + ".tmp"
 
     trans_lock = lock_file(trans_file)
@@ -328,7 +328,7 @@ def temp_transitions_file(transitions):
 
 def edit_transitions():
     """ Edit the defined transitions. """
-    trans_file = Cnf["Dinstall::Reject::ReleaseTransitions"]
+    trans_file = Cnf["Dinstall::ReleaseTransitions"]
     edit_file = temp_transitions_file(load_transitions(trans_file))
 
     editor = os.environ.get("EDITOR", "vi")
@@ -568,13 +568,13 @@ def main():
     init()
 
     # Check if there is a file defined (and existant)
-    transpath = Cnf.get("Dinstall::Reject::ReleaseTransitions", "")
+    transpath = Cnf.get("Dinstall::ReleaseTransitions", "")
     if transpath == "":
-        utils.warn("Dinstall::Reject::ReleaseTransitions not defined")
+        utils.warn("Dinstall::ReleaseTransitions not defined")
         sys.exit(1)
     if not os.path.exists(transpath):
         utils.warn("ReleaseTransitions file, %s, not found." %
-                          (Cnf["Dinstall::Reject::ReleaseTransitions"]))
+                          (Cnf["Dinstall::ReleaseTransitions"]))
         sys.exit(1)
     # Also check if our temp directory is defined and existant
     temppath = Cnf.get("Dir::TempPath", "")
index cd34e63ef83fd7641c359d3e70ac8290fddda1f8..2e1c0caa4d633414974d062378975a208f5732b4 100755 (executable)
@@ -198,7 +198,7 @@ Updates dak's database schema to the lastest version. You should disable crontab
             self.usage(exit_code=1)
 
         try:
-            lock_fd = os.open(cnf["Dinstall::LockFile"], os.O_RDWR | os.O_CREAT)
+            lock_fd = os.open(os.path.join(cnf["Dir::Lock"], 'dinstall.lock'), os.O_RDWR | os.O_CREAT)
             fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
         except IOError, e:
             if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EAGAIN':
index 25398981ffb83912c5e1603da961860a38f9d087..e88911c5109201ab597cd3f2ca9aba0a75dfdd6e 100755 (executable)
@@ -1132,6 +1132,19 @@ def get_component(component, session=None):
 
 __all__.append('get_component')
 
+@session_wrapper
+def get_component_names(session=None):
+    """
+    Returns list of strings of component names.
+
+    @rtype: list
+    @return: list of strings of component names
+    """
+
+    return [ x.component_name for x in session.query(Component).all() ]
+
+__all__.append('get_component_names')
+
 ################################################################################
 
 class DBConfig(object):
index f77416cadc224c7a6827608883df8db6037dd2c6..2f36a696313badb4aad725685f1c1362df6c2765 100644 (file)
@@ -45,11 +45,14 @@ class Holding(object):
             self.initialised = True
 
             self.in_holding = {}
-            self.holding_dir = Config()["Dir::Queue::Holding"]
+            self.holding_dir = Config()["Dir::Holding"]
             # ftptrainees haven't access to holding, use a temp directory instead
             if not os.access(self.holding_dir, os.W_OK):
                 self.holding_dir = Config()["Dir::TempPath"]
 
+    def chdir_to_holding(self):
+        os.chdir(self.holding_dir)
+
     def copy_to_holding(self, filename):
         base_filename = os.path.basename(filename)
 
index c5cd4a68b8595992bfeeafd2ebdd2fc30bdf12cb..a8ea3035df38102937f0f6b32720c5c43fa05272 100755 (executable)
@@ -700,7 +700,7 @@ class Upload(object):
 
         # Ensure target distributions exist
         for suite in self.pkg.changes["distribution"].keys():
-            if not Cnf.has_key("Suite::%s" % (suite)):
+            if not get_suite(suite.lower()):
                 self.rejects.append("Unknown distribution `%s'." % (suite))
 
     ###########################################################################
@@ -961,8 +961,7 @@ class Upload(object):
                 entry["component"] = dest
 
         # Ensure the component is valid for the target suite
-        if cnf.has_key("Suite:%s::Components" % (suite)) and \
-           entry["component"] not in cnf.ValueList("Suite::%s::Components" % (suite)):
+        if entry["component"] not in get_component_names(session):
             self.rejects.append("unknown component `%s' for suite `%s'." % (entry["component"], suite))
             return
 
@@ -1315,7 +1314,7 @@ class Upload(object):
             self.rejects.append("'dpkg-source -x' failed for %s." % dsc_filename)
             return
 
-        if not cnf.Find("Dir::Queue::BTSVersionTrack"):
+        if not cnf.Find("Dir::BTSVersionTrack"):
             return
 
         # Get the upstream version
@@ -1840,7 +1839,7 @@ class Upload(object):
 
         # Also only check if there is a file defined (and existant) with
         # checks.
-        transpath = cnf.get("Dinstall::Reject::ReleaseTransitions", "")
+        transpath = cnf.get("Dinstall::ReleaseTransitions", "")
         if transpath == "" or not os.path.exists(transpath):
             return
 
@@ -2174,7 +2173,7 @@ distribution."""
 
         # Move the .changes into the 'done' directory
         ye, mo, da = time.gmtime()[0:3]
-        donedir = os.path.join(cnf["Dir::Queue::Done"], str(ye), "%0.2d" % mo, "%0.2d" % da)
+        donedir = os.path.join(cnf["Dir::Done"], str(ye), "%0.2d" % mo, "%0.2d" % da)
         if not os.path.isdir(donedir):
             os.makedirs(donedir)
 
@@ -2192,19 +2191,19 @@ distribution."""
         self.announce(short_summary, 1)
 
         ## Helper stuff for DebBugs Version Tracking
-        if cnf.Find("Dir::Queue::BTSVersionTrack"):
+        if cnf.Find("Dir::BTSVersionTrack"):
             if self.pkg.changes["architecture"].has_key("source"):
-                (fd, temp_filename) = utils.temp_filename(cnf["Dir::Queue::BTSVersionTrack"], prefix=".")
+                (fd, temp_filename) = utils.temp_filename(cnf["Dir::BTSVersionTrack"], prefix=".")
                 version_history = os.fdopen(fd, 'w')
                 version_history.write(self.pkg.dsc["bts changelog"])
                 version_history.close()
-                filename = "%s/%s" % (cnf["Dir::Queue::BTSVersionTrack"],
+                filename = "%s/%s" % (cnf["Dir::BTSVersionTrack"],
                                       self.pkg.changes_file[:-8]+".versions")
                 os.rename(temp_filename, filename)
                 os.chmod(filename, 0644)
 
             # Write out the binary -> source mapping.
-            (fd, temp_filename) = utils.temp_filename(cnf["Dir::Queue::BTSVersionTrack"], prefix=".")
+            (fd, temp_filename) = utils.temp_filename(cnf["Dir::BTSVersionTrack"], prefix=".")
             debinfo = os.fdopen(fd, 'w')
             for name, entry in sorted(self.pkg.files.items()):
                 if entry["type"] == "deb":
@@ -2213,7 +2212,7 @@ distribution."""
                                      entry["source version"]])
                     debinfo.write(line+"\n")
             debinfo.close()
-            filename = "%s/%s" % (cnf["Dir::Queue::BTSVersionTrack"],
+            filename = "%s/%s" % (cnf["Dir::BTSVersionTrack"],
                                   self.pkg.changes_file[:-8]+".debinfo")
             os.rename(temp_filename, filename)
             os.chmod(filename, 0644)
index a6b71206056e6142b457944cd8c60854498196cc..c7a59659f40bfbf4a3203c6c06fe1d59c7f9e975 100644 (file)
-Explanation of configuration files options for dak
-==================================================
-
+///////////////////////////////////////////////////////////
+// Example annotated configuration file for dak
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+// Common settings
+///////////////////////////////////////////////////////////
+Common
+{
+    //// ThreadCount (optional):  Maximum number of threads to use.  Defaults to 1
+    ThreadCount 1;
+};
+
+///////////////////////////////////////////////////////////
+// Essential.  List of database details.
+///////////////////////////////////////////////////////////
 DB
---
-
-Essential.  List of database details, e.g.
-
-| DB
-| {
-|   Name "projectb";
-|   Host ""; 
-|   Port -1;
-| };
-
-Name (required): The name of the PostgreSQL database which has been created
-for dak.
-
-Host (required): The name of the host on which the database is located.  If
-the database is local, Host should be blank.
-
-Port (required): The port of the database.  If the port is the default
-value (5432), this option should be set to -1.
-
-================================================================================
-
+{
+    //// Name (required): The name of the PostgreSQL database which has been
+    //// created for dak.
+    Name "projectb";
+
+    //// Host (optional): The name of the host on which the database is located.
+    //// Not necessary if the the database is local.
+    //Host "";
+
+    //// Port (optional): The port of the database if it is remote.  If the port
+    //// is the default value (5432), this option can be set to -1.
+    //Port -1;
+
+    //// PoolSize (optional): should be at least ThreadCount + 1
+    PoolSize 5;
+
+    //// MaxOverflow (optional): shouldn't exceed postgresql.conf's
+    //// max_connections - PoolSize
+    MaxOverflow 13;
+
+    //// Unicode (optional but seriously suggested).  Should be false for
+    //// encoding == SQL_ASCII which is highly recommended.  Do not set this to
+    //// anything else unless you really know what you're doing.
+    Unicode "false";
+};
+
+///////////////////////////////////////////////////////////
+// Dinstall general settings
+///////////////////////////////////////////////////////////
+Dinstall
+{
+    //// SigningKeyring (optional): this is the private keyring used by
+    //// 'dak generate-releases'.
+    SigningKeyring "/srv/dak/s3kr1t/dot-gnupg/secring.gpg";
+
+    //// SigningPubKeyring (optional): this is the public keyring used by
+    //// 'dak generate-releases'.
+    SigningPubKeyring "/srv/dak/s3kr1t/dot-gnupg/pubring.gpg";
+
+    //// Options::No-Mail (optional): Highly recommended.  This prevents dak
+    //// from spamming people you didn't mean it to.  If you're not using this,
+    //// you almost certainly want to use the MailWhiteList option
+    Options::No-Mail "true";
+
+    //// MailWhiteList (optional).  If you're not using No-Mail, this provides
+    //// a list of email addresses or regular expressions, one per line which
+    //// dak is allowed to email.  Regular expressions need to be prefixed by "RE:".
+    //// Examples: "jane.doe@domain.com" or "RE:jane[^@]@domain.com", where the first will
+    //// only allow to mail jane.doe@domain.com while the second will mail all of jane*@domain.com
+    //// MailWhiteList "/some/path/to/a/file";
+
+    //// SendmailCommand (required unless No-Mail is set): command to call the MTA.
+    // SendmailCommand "/usr/sbin/sendmail -oi -t";
+
+    //// MyEmailAddress (required): this is used as the From: line for sending mails
+    //// as a script/daemon.
+    MyEmailAddress "FTP Masters <ftpmaster@example.org>";
+
+    //// MyAdminAddress (required): used as a contact address in mails.
+    MyAdminAddress "ftpmaster@example.org";
+
+    //// MyDistribution (required): this variable is used in emails sent out by
+    //// dak and others.  It should indicate the name of the distribution.
+    MyDistribution "MyDistro";
+
+    //// BugServer (optional): is used by 'dak process-upload' and 'dak rm'
+    //// when closing bugs.
+    // BugServer "bugs.example.org";
+
+    //// CloseBugs (optional): a boolean (default: no); if true the automated bug
+    //// closing feature of dinstall is activated.  Must have BugServer set
+    //// for this to work.
+    CloseBugs "true";
+
+    //// PackagesServer (optional): used by 'dak rm' and 'dak override' when
+    //// carbon-copying a bug close mail to a package maintainer.
+    // PackagesServer "packages.example.org";
+
+    //// TrackingServer (optional): used by 'dak process-upload' and 'dak
+    //// rm' to send messages for the maintainer also to an alias for people
+    //// tracking a specific source package.
+    // TrackingServer "packages.qa.example.org";
+
+    //// All sent mail is blind carbon copied to the email address in Bcc if it's
+    //// not blank.
+    // Bcc "archive@example.org";
+
+    //// BXANotify (optional): a boolean (default: false); if true (Debian-specific)
+    //// BXA notification is sent.  The template for the BXA notification is located
+    //// in Dir::Templates/process-new.bxa_notification and should be changed if this
+    //// option is set.
+    // BXANotify "true";
+
+    //// FutureTimeTravelGrace (required): specifies how many seconds into the
+    //// future timestamps are allowed to be inside a deb before being rejected.
+    //// 28800 = 8 hours
+    FutureTimeTravelGrace 28800;
+
+    //// PastCutoffYear (required): specifies the cut-off year which is used when
+    //// deciding whether or not to reject packages based on the file timestamp.
+    PastCutoffYear "1984";
+
+    //// SkipTime (required): an integer value which is the number of seconds
+    //// that a file must be older than (via it's last modified timestamp)
+    //// before dak process-upload will REJECT rather than SKIP the package.
+    SkipTime 300;
+
+    //// OverrideDisparityCheck (optional): a boolean (default: false); if true,
+    //// dak process-upload compares an uploads section/priority with the overrides and whines
+    //// at the maintainer if they differ.
+    OverrideDisparityCheck "false";
+
+    //// OverrideMaintainer (optional): be used to globally override the
+    //// __MAINTAINER_TO__ and __MAINTAINER_FROM__ variables in template mails.
+    //// Use with caution.
+    // OverrideMaintainer "";
+
+    //// DefaultSuite (optional): which suite to default to where one isn't
+    //// specified.  Defaults to "unstable" if not set.
+    // DefaultSuite "unstable";
+
+    //// LintianTags (optional): A set of lintian tags on which to reject
+    //// packages at upload time.  Format is a YAML file; see the ftp-master
+    //// version for an example.
+    // LintianTags "/srv/dak/dak/config/debian/lintian.tags";
+
+    //// ReleaseTransitions (optional): YAML File for blocking uploads to unstable
+    // ReleaseTransitions "/srv/dak/web/transitions.yaml";
+
+    //// KeyAutoFetch (optional): boolean (default: false), which if set (and
+    //// not overriden by explicit argument to check_signature()) will enable
+    //// auto key retrieval.  Requires KeyServer and SigningKeyIds variables be
+    //// set.  NB: you should only enable this variable on production systems
+    //// if you have strict control of your upload queue.
+    // KeyAutoFetch "false";
+
+    //// KeyServer (optional): keyserver used for key auto-retrieval
+    //// (c.f. KeyAutoFetch).
+    // KeyServer "wwwkeys.eu.pgp.net";
+};
+
+
+///////////////////////////////////////////////////////////
+// Dir (mandatory).  List of directory locations, e.g.
+///////////////////////////////////////////////////////////
 Dir
----
-
-Mandatory.  List of directory locations, e.g.
-
-| Dir
-| {
-|   Root "/org/ftp.debian.org/ftp/";
-|   Pool "/org/ftp.debian.org/ftp/pool/";
-|   Templates "/org/ftp.debian.org/dak/templates/";
-|   PoolRoot "pool/";
-|   Override "/org/ftp.debian.org/scripts/override/";
-|   Lists "/org/ftp.debian.org/database/dists/";
-|   Log "/org/ftp.debian.org/log/";
-|   Morgue "/org/ftp.debian.org/morgue/";
-|   QueueBuild "/org/incoming.debian.org/buildd/";
-|   UrgencyLog "/org/ftp.debian.org/testing/urgencies/";
-|   Queue
-|   {  
-|     Accepted "/org/ftp.debian.org/queue/accepted/";
-|     Byhand "/org/ftp.debian.org/queue/byhand/";
-|     Done "/org/ftp.debian.org/queue/done/";
-|     Holding "/org/ftp.debian.org/queue/holding/";
-|     New "/org/ftp.debian.org/queue/new/";
-|     Reject "/org/ftp.debian.org/queue/reject/";
-|     Unchecked "/org/ftp.debian.org/queue/unchecked/";
-|   };
-| };
-
-Root (required): Specifies the path of the root of the FTP archive.
-
-Pool (required): This variable specifies the path of the pool
-directory.  Debian packages will be placed in the pool by 'dak
-process-accepted' after they have been accepted by dak
-process-unchecked.
-
-Templates (required): dak sends various mails and uses templates from
-this directory.
-
-PoolRoot (required): This variable specifies the basename of the pool
-directory.
-
-Override (optional): This directory optionally stores override files (used
-by 'dak make-overrides').
-
-Lists (optional): This directory holds file lists used by apt-ftparchive to
-generate Packages and Sources files (used by 'dak make-suite-file-list').
-
-Log (required): Log files are put in this directory.
-
-Morgue (required): Removed files are moved there.  The morgue has various
-sub-directories, including (optionally) those defined by
-Clean-Queues::MorgueSubDir and Clean-Suites::MorgueSubDir.
-
-UrgencyLog (optional): If this directory is specified, 'dak
-process-accepted' will store the urgency value of each upload.  This
-is mainly used for britney (the testing script).
-
-Queue (required): This sub-tree defines important directories for the
-incoming queue.  The following variables have to be set: Accepted, Byhand
-Done, Holding, New, Reject, Unchecked.  An explanation of the function of
-these directores can be found in README.new-incoming.
-
-Queue::BTSVersionTrack (optional): this directory holds the DebBugs
-Version Tracking support files.
-
-================================================================================
-
-Suite
------
-
-Mandatory.  List of all suites, e.g. 
-
-| Suite
-| {
-|   Unstable
-|   {
-|      Components 
-|      {
-|        main;
-|      };
-|      Architectures 
-|      {
-|        source; 
-|        all;
-|        i386;
-|      };
-|      Announce "debian-devel-changes@lists.debian.org";
-|      Origin "Debian";
-|      Description "Debian Unstable - Not Released";
-|      CodeName "sid";
-|      OverrideCodeName "sid";
-|      Priority "5";
-|   };
-| };
-
-Announce (optional): controls where "Installed foo" mails are sent.
-
-CodeName, Origin and Description (optional): This settings are used by
-'dak generate-releases' and put in the Release files.
-
-OverrideCodeName (optional): used by 'dak make-overrides'.
-
-Priority (optional) determines which suite is used for the Maintainers file
-as generated by 'dak make-maintainers' (highest wins).
-
-CopyChanges (optional): if this variable is present it should be a path
-into the archive (i.e. "Dir::RootDir"); any upload targeted for a suite
-with this config option present will have the .changes file copied into
-that path.
-
-CopyDotDak (optional): if this is present it should be an absolute path; any
-upload targeted for a suite with this config option present will have the
-.dak file copied into that path.  This option is similar to CopyChanges
-and will most often be used with it; they're seperate because .changes
-files are mirrored and .dak files aren't, so the paths will usually be
-different.
-
-There are more optional variables, such as VersionChecks.  Please see
-dak.conf for examples.
-
-================================================================================
+{
+    //// Root (required): Specifies the path of the root of the FTP archive.
+    Root "/srv/dak/ftp/";
+
+    //// Pool (required): This variable specifies the path of the pool
+    //// directory.  Debian packages will be placed in the pool by
+    //// 'dak process-upload'
+    Pool "/srv/dak/ftp/pool/";
+
+    //// Templates (required): dak sends various mails and uses templates from
+    //// this directory.
+    Templates "/srv/dak/dak/templates/";
+
+    //// Override (optional): This directory optionally stores override files (used
+    //// by 'dak make-overrides').
+    // Override "/src/dak/scripts/override/";
+
+    //// Lists (optional): This directory holds file lists used by apt-ftparchive to
+    //// generate Packages and Sources files (used by 'dak make-suite-file-list').
+    //// Deprecated in favour of use of generate-packages-sources2
+    // Lists "/srv/dak/database/dists/";
+
+    //// Log (required): Directory to store dak logs in
+    Log "/srv/dak/log/";
+
+    //// Lock directory (required): Directory to store dak locks in
+    Lock "/srv/dak/lock/";
+
+    //// Morgue (required): Removed files are moved there.  The morgue has various
+    //// sub-directories, including (optionally) those defined by
+    //// Clean-Queues::MorgueSubDir and Clean-Suites::MorgueSubDir.
+    Morgue "/srv/dak/morgue/";
+
+    //// UrgencyLog (optional): If this directory is specified, 'dak
+    //// process-upload' will store the urgency value of each upload.  This
+    //// is mainly used for britney (the testing script).
+    // UrgencyLog "/srv/dak/testing/urgencies/";
+
+    //// Holding (required): Directory to use for temporary storage during
+    //// process-upload
+    Holding "/srv/dak/queue/holding/";
+
+    //// Done (required): Directory in which to store processed .changes files
+    Done "/srv/dak/queue/done/";
+
+    //// BTSVersionTrack (optional): this directory holds the DebBugs
+    //// Version Tracking support files.
+    // BTSVersionTrack "/srv/dak/btsversiontrack";
+
+    //// Queue (required): This sub-tree defines important directories for the
+    //// incoming queue.  The following variables have to be set: Byhand, New
+    //// NewStage, Reject, Unchecked.  An explanation of the function of
+    //// these directores can be found in README.new-incoming.
+    Queue
+    {  
+        Byhand "/srv/dak/queue/byhand/";
+        New "/srv/dak/queue/new/";
+        NewStage "/srv/dak/queue/newstage/";
+        Reject "/srv/dak/queue/reject/";
+        Unchecked "/srv/dak/queue/unchecked/";
+    };
+};
+
+///////////////////////////////////////////////////////////
+// SuiteMappings: (optional).  List of mappings for the Distribution file in a
+// .changes file, e.g.:
+///////////////////////////////////////////////////////////
+
+// There are three mapping types:
+//
+// (1) map <source> <dest>
+// Any target suite of '<source>' is unconditionally overriden to '<dest>'.
+// (2) map-unreleased <source> <dest>
+// Any upload targeted for suite '<source>' will be mapped to '<dest>' iff it
+// contains uploads for an architecture that is not part of '<source>'.
+// (3) ignore <suite>
+// Any target suite of '<suite>' is unconditionally removed from the list of
+// target suites.  NB: if the upload had only one target suite this will lead
+// to rejection.
 
 SuiteMappings
--------------
-
-Optional.  List of mappings for the Distribution file in a .changes file, e.g.:
-
-| SuiteMappings
-| {
-|    "map stable proposed-updates";
-|    "map frozen unstable";
-|    "map-unreleased stable unstable";
-|    "map-unreleased proposed-updates unstable";
-|    "ignore testing";
-| };
-
-There are three mapping types:
-
-(1) map <source> <dest>
-
-      Any target suite of '<source>' is unconditionally overriden to
-      '<dest>'.
-
-(2) map-unreleased <source> <dest>
-
-      Any upload targeted for suite '<source>' will be mapped to
-      '<dest>' iff it contains uploads for an architecture that is not
-      part of '<source>'.
-
-(3) ignore <suite>
-
-      Any target suite of '<suite>' is unconditionally removed from
-      the list of target suites.  NB: if the upload had only one
-      target suite this will lead to rejection.
-
-NB: ordering is not guaranteed.
-
-================================================================================
-
-Dinstall
---------
-
-Mandatory.  List of dinstall options, e.g.:
-
-| Dinstall
-| {
-|    SigningKeyring "/org/ftp.debian.org/s3kr1t/dot-gnupg/secring.gpg";
-|    SendmailCommand "/usr/sbin/sendmail -odq -oi -t";
-|    MyEmailAddress "Debian Installer <installer@ftp-master.debian.org>";
-|    MyAdminAddress "ftpmaster@debian.org";
-|    MyDistribution "Debian";
-|    BugServer "bugs.debian.org";
-|    PackagesServer "packages.debian.org";
-|    TrackingServer "packages.qa.debian.org";
-|    LockFile "/org/ftp.debian.org/dak/lock";
-|    Bcc "archive@ftp-master.debian.org";
-|    FutureTimeTravelGrace 28800; // 8 hours
-|    PastCutoffYear "1984";
-|    BXANotify "false";
-| };
-
-SigningKeyring (optional): this is the private keyring used by 'dak
-generate-releases'.
-
-SendmailCommand (required): command to call the MTA.
-
-MyEmailAddress (required): this is used as the From: line for sending mails
-as a script/daemon.
-
-MyAdminAddress (required): used as a contact address in mails.
-
-MyDistribution (required): this variable is used in emails sent out by
-dak and others.  It should indicate the name of the distribution.
-
-BugServer (required): is used by 'dak process-unchecked' and 'dak rm'
-when closing bugs.
-
-PackagesServer (required): used by 'dak rm' and 'dak override' when
-carbon-copying a bug close mail to a package maintainer.
-
-TrackingServer (optional): used by 'dak process-unchecked' and 'dak
-rm' to send messages for the maintainer also to an alias for people
-tracking a specific source package.
-
-LockFile (required): contains the filename of the lockfile used by dinstall
-when in action mode (i.e. not using -n/--no-action).
-
-All sent mail is blind carbon copied to the email address in Bcc if it's
-not blank.
-
-FutureTimeTravelGrace (required): specifies how many seconds into the
-future timestamps are allowed to be inside a deb before being rejected.
-
-PastCutoffYear (required): specifies the cut-off year which is used when
-deciding whether or not to reject packages based on the file timestamp.
-
-BXANotify (optional): a boolean (default: no); if true (Debian-specific)
-BXA notification is sent.  The template for the BXA notification is located
-in Dir::Templates/process-new.bxa_notification and should be changed if this
-option is set.
-
-OverrideDisparityCheck (optional): a boolean (default: no); if true,
-dak process-unchecked compares an uploads section/priority with the overrides and whines
-at the maintainer if they differ.
-
-CloseBugs (optional): a boolean (default: no); if true the automated bug
-closing feature of dinstall is activated.
-
-QueueBuild is a boolean; if true it activates support
-for auto-building from accepted.
-
-OverrideMaintainer (optional): be used to globally override the
-__MAINTAINER_TO__ and __MAINTAINER_FROM__ variables in template mails.
-Use with caution.
-
-SkipTime (required): an integer value which is the number of seconds that a
-file must be older than (via it's last modified timestamp) before dak process-unchecked
-will REJECT rather than SKIP the package.
-
-KeyAutoFetch (optional): boolean (default: false), which if set (and
-not overriden by explicit argument to check_signature()) will enable
-auto key retrieval.  Requires KeyServer and SigningKeyIds variables be
-set.  NB: you should only enable this variable on production systems
-if you have strict control of your upload queue.
-
-KeyServer (optional): keyserver used for key auto-retrieval
-(c.f. KeyAutoFetch).
-
-================================================================================
-
-Archive
--------
-
-Mandatory.  List of all archives, e.g.
-
-| Archive
-| {
-|   ftp-master
-|   {
-|     OriginServer "ftp-master.debian.org";
-|     PrimaryMirror "ftp.debian.org";
-|     Description "Master Archive for the Debian project";
-|   };
-| };
-
-OriginServer and PrimaryMirror (required): used 'dak rm's bug closing mail
-templates.  The host name and it's OriginServer and Description are part of
-the SQL database in the 'archive' table.
-
-================================================================================
-
-Architectures
--------------
-
-Mandatory.  List of all architectures, e.g.
-
-| Architectures
-| {
-|   source "Source";
-|   all           "Architecture Independent";
-|   i386   "Intel ia32";
-| };
-
-Both values go into the SQL database's 'architecture' table.
-The description is currently unused.
-
-================================================================================
-
-Section
--------
-
-Mandatory.  List of all valid sections, e.g.
-
-| Section
-| {
-|   base;
-| };
-
-The section goes into the 'section' table in SQL database.
-
-================================================================================
-
-Priority
---------
-
-Mandatory.  List of all valid priorities, e.g.
-
-| Priority
-| {
-|   required 1;
-|   important 2;
-|   standard 3;
-|   optional 4;
-|   extra 5;
-|   source 0; // i.e. unused
-| };
-
-The value is the sorting key.  Both the section and it's sorting key
-go into the SQL database's 'priority' table.
-
-================================================================================
-
-Location
---------
-
-Mandatory.  List all locations, e.g.
-
-| Location
-| {
-|   /org/ftp.debian.org/ftp/pool/
-|     {
-|       Archive "ftp-master";
-|       Type "pool";
-|      Suites
-|      {
-|        Stable;
-|        Unstable;
-|      };
-|     };
-| };
-
-There are three valid values for 'Type': 'legacy', 'legacy-mixed' and
-'pool'.  'legacy' and 'pool' are assumed to have sections for all
-components listed in the Components section 'legacy-mixed' are assumed
-to mix all components into one location.  The 'Archive' and 'Type'
-sections go into the SQL database's 'location' table.  'Suites' is a
-list of existent suites that should be used to populate the SQL
-database.
-
-Note that the archive value specified here must correspond to one defined
-in Archive.
-
-[Note: yes, this is horrible, it dates back to the original `import
-       the existent archive into the SQL Database' script ('dak import-archive') and
-       isn't otherwise used.  It should be revisted at some stage.]
-
-================================================================================
+{
+   "map stable proposed-updates";
+   "map frozen unstable";
+   "map-unreleased stable unstable";
+   "map-unreleased proposed-updates unstable";
+   "ignore testing";
+};
+
+///////////////////////////////////////////////////////////
+// Urgency (mandatory) This defines the valid and default urgency of an upload.
+// If a package is uploaded with an urgency not listed here, it will be
+// rejected.
+///////////////////////////////////////////////////////////
 
 Urgency
--------
-
-Mandatory.
-
-| Urgency
-| {
-|   Default "low";
-|   Valid
-|   {
-|     low;
-|     medium;
-|     high;
-|     emergency;
-|     critical;
-|   };
-| };
-
-This defines the valid and default urgency of an upload.  If a package is
-uploaded with an urgency not listed here, it will be rejected.
-
-================================================================================
+{
+  Default "low";
+  Valid
+  {
+    low;
+    medium;
+    high;
+    emergency;
+    critical;
+  };
+};
+
index 3b04d73077fd03d0a63287dd23d9088b1dc97fbb..886b390e72e6094979da1a686e74a41c5b3a024f 100644 (file)
@@ -44,9 +44,18 @@ Set up some core data in projectb to get started (read the init_vars file if
 you wish to customise various aspects):
 # ./init_core
 
+Create a minimal dak.conf
+# ./init_minimal_conf
+# cp dak-minimal.conf /etc/dak/dak.conf
+
+Set up a symlink somewhere
+# mkdir ~dak/bin
+# ln -s /path/to/dak.py ~dak/bin/dak
+
 Add some architectures you care about:
 # dak admin architecture add i386 "Intel x86 port"
 # dak admin architecture add amd64 "AMD64 port"
 
 Add a suite (origin=, label= and codename= are optional)
 # dak admin suite add-all-arches unstable x.y.z origin=MyDistro label=Master codename=sid
+
diff --git a/setup/dak-minimal.conf.template b/setup/dak-minimal.conf.template
new file mode 100644 (file)
index 0000000..7f4c9df
--- /dev/null
@@ -0,0 +1,73 @@
+Common
+{
+  ThreadCount 1;
+};
+
+DB
+{
+  Name "projectb";
+  // PoolSize should be at least ThreadCount + 1
+  PoolSize 5;
+  // MaxOverflow shouldn't exceed postgresql.conf's max_connections - PoolSize
+  MaxOverflow 13;
+  // should be false for encoding == SQL_ASCII which is highly recommended
+  Unicode "false"
+};
+
+Dinstall
+{
+   SigningKeyring "__DAKBASE__/keyrings/s3kr1t/dot-gnupg/secring.gpg";
+   SigningPubKeyring "__DAKBASE__/keyrings/s3kr1t/dot-gnupg/pubring.gpg";
+   SigningKeyIds "__ARCHIVEKEYID__";
+
+   Options
+   {
+       No-Mail "true";
+   };
+
+   MyEmailAddress "Archive Installer <dak@__DAKFQDN__>";
+   MyAdminAddress "dak@__DAKFQDN__";
+   MyDistribution "TestDakInstance";
+
+   LockFile "__DAKBASE__/lock/dinstall.lock";
+
+   FutureTimeTravelGrace 28800; // 8 hours
+   PastCutoffYear "1984";
+   SkipTime 10;
+
+   DefaultSuite "unstable";
+};
+
+Dir
+{
+  Root "__DAKBASE__/ftp/";
+  Pool "__DAKBASE__/ftp/pool/";
+  Templates "__DAKBASE__/templates/";
+  Log "__DAKBASE__/log/";
+  Lock "__DAKBASE__/lock/";
+  Morgue "__DAKBASE__/morgue/";
+  Holding "__DAKBASE__/holding/";
+  Done "__DAKBASE__/done/";
+
+  Queue
+  {
+    Byhand "__DAKBASE__/queue/byhand/";
+    New "__DAKBASE__/queue/new/";
+    NewStage "__DAKBASE__/queue/newstage/";
+    Reject "__DAKBASE__/queue/reject/";
+    Unchecked "__DAKBASE__/queue/unchecked/";
+  };
+};
+
+Urgency
+{
+  Default "low";
+  Valid
+  {
+    low;
+    medium;
+    high;
+    emergency;
+    critical;
+  };
+};
index dd6c0756ae37a3cf9f31343f071627e85f7d417a..c409cdfeee263cd5a0bca781d8bd2e84f86a3072 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-. init_vars
+. ./init_vars
 
 run-parts --exit-on-error core-init.d/
diff --git a/setup/init_minimal_conf b/setup/init_minimal_conf
new file mode 100755 (executable)
index 0000000..82400f4
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. ./init_vars
+
+cp dak-minimal.conf.template dak-minimal.conf
+
+sed -i "s@__DAKBASE__@${DAKBASE}@" dak-minimal.conf
+sed -i "s@__DAKFQDN__@${DAKFQDN}@" dak-minimal.conf