]> git.decadent.org.uk Git - dak.git/commitdiff
Merge branch 'master' into content_generation
authorMichael Casadevall <sonicmctails@gmail.com>
Fri, 2 Jan 2009 22:02:03 +0000 (17:02 -0500)
committerMichael Casadevall <sonicmctails@gmail.com>
Fri, 2 Jan 2009 22:29:55 +0000 (17:29 -0500)
ChangeLog
dak/queue_report.py
daklib/database.py
src/Makefile
src/sql-aptvc.cpp

index 946cf32a3caa4a8a6da3801a4c5222d4d39d38aa..f86cf42f0ef852241b3356e4707a06c6fb158f7c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-30  Michael Casadevall  <sonicmctails@gmail.com>
+
+       * src/sql-aptvc.cpp     - Fixed to work on modern postgresql version
+
+       * src/Makefile          - Gave it a brain on finding postgres headers
+
+        * queue-report.py      - Added changes file to the 822 output for QA team
+
 2008-12-30  Joerg Jaspert  <joerg@debian.org>
 
        * config/debian/cron.hourly: Generate the 822 format for accepted,
index 9e73d1c3e5b26a4773f07727560492bd31764dfa..dfd2861627dd467d7d16496f77d72e1e828d87ec 100755 (executable)
@@ -400,7 +400,7 @@ def process_changes_files(changes_files, type, log):
             note = " | [N]"
         else:
             note = ""
-        entries.append([source, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby])
+        entries.append([source, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, cache[filename]["filename"]])
 
     # direction entry consists of "Which field, which direction, time-consider" where
     # time-consider says how we should treat last_modified. Thats all.
@@ -442,7 +442,7 @@ def process_changes_files(changes_files, type, log):
     if Cnf.has_key("Queue-Report::Options::822"):
         # print stuff out in 822 format
         for entry in entries:
-            (source, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby) = entry
+            (source, version_list, arch_list, note, last_modified, maint, distribution, closes, fingerprint, sponsor, changedby, changes_file) = entry
 
             # We'll always have Source, Version, Arch, Mantainer, and Dist
             # For the rest, check to see if we have them, then print them out
@@ -471,6 +471,7 @@ def process_changes_files(changes_files, type, log):
                 for bugs in closes:
                     bug_string += "#"+bugs+", "
                 log.write("Closes: " + bug_string[:-2] + "\n")
+            log.write("Changes-File: " + os.path.basename(changes_file) + "\n")
             log.write("\n")
 
     if Cnf.has_key("Queue-Report::Options::New"):
index b9bb29dd9a639c68e79a4bc16a4dc35fef53a54d..1f659606b667f3238a6fb169f8228b4e934f01e0 100755 (executable)
@@ -19,7 +19,7 @@
 
 ################################################################################
 
-import os, sys, time, types
+import os, sys, time, types, apt_pkg
 
 ################################################################################
 
@@ -42,6 +42,7 @@ fingerprint_id_cache = {}
 queue_id_cache = {}
 uid_id_cache = {}
 suite_version_cache = {}
+suite_bin_version_cache = {}
 content_path_id_cache = {}
 content_file_id_cache = {}
 
@@ -226,7 +227,7 @@ def get_source_id (source, version):
 
     return source_id
 
-def get_suite_version(source, suite):
+def get_suite_version(source, suite, arch):
     global suite_version_cache
     cache_key = "%s_%s" % (source, suite)
 
@@ -249,25 +250,23 @@ def get_suite_version(source, suite):
 
     return version
 
-def get_latest_binary_version_id(binary, suite):
-    global suite_version_cache
+def get_latest_binary_version_id(binary, suite, arch):
+    global suite_bin_version_cache
     cache_key = "%s_%s" % (binary, suite)
 
+    if suite_bin_version_cache.has_key(cache_key):
+        return suite_bin_version_cache[cache_key]
 
-    if suite_version_cache.has_key(cache_key):
-        return suite_version_cache[cache_key]
-
-        #print "SELECT b.id, b.version FROM binaries b JOIN bin_associations ba ON (b.id = ba.bin) WHERE b.package = '%s AND ba.suite = '%d'" % (binary, int(suite))
-        q = projectB.query("SELECT b.id, b.version FROM binaries b JOIN bin_associations ba ON (b.id = ba.bin) WHERE b.package = '%s AND ba.suite = '%d'" % (binary, int(suite)))
+    q = projectB.query("SELECT b.id, b.version FROM binaries b JOIN bin_associations ba ON (b.id = ba.bin) WHERE b.package = '%s' AND b.architecture = '%d' AND ba.suite = '%d'" % (binary, int(arch), int(suite)))
 
-        highest_bid, highest_version = None, None
+    highest_bid, highest_version = None, None
 
-        for bi in q.getresult():
-            if highest_version == None or apt_pkg.VersionCompare(bi[1], highest_version) == 1:
-                 highest_bid = bi[0]
-                 highest_version = bi[1]
+    for bi in q.getresult():
+        if highest_version == None or apt_pkg.VersionCompare(bi[1], highest_version) == 1:
+             highest_bid = bi[0]
+             highest_version = bi[1]
 
-        return highest_bid
+    return highest_bid
 
 ################################################################################
 
index b45b07d8a3a762450441b2d1f0ff4c302d53911a..206f320bbc9559b38b108791f17d120eb6037347 100644 (file)
@@ -1,9 +1,9 @@
 #!/usr/bin/make -f
 
-CXXFLAGS       = -I/usr/include/postgresql/ -I/usr/include/postgresql/server/ -fPIC -Wall
-CFLAGS         = -fPIC -Wall
-LDFLAGS                = -fPIC
-LIBS           = -lapt-pkg
+CXXFLAGS       = -I/usr/include/postgresql/ -I`pg_config --includedir-server` -fPIC -Wall
+CFLAGS         = -fFIC -Wall `pg_config --cflags`
+LDFLAGS                = `pg_config --ldflags`
+LIBS           = -lapt-pkg `pg_config --libs`
 
 C++            = g++
 
index 54ba9e92f60fdf470b872131cf3d09b2be599db2..a9c3e53e0deee24df0fce7c0fb2fc1bee7ce2617 100644 (file)
@@ -26,6 +26,11 @@ extern "C"
 {
 
 #include <postgres.h>
+#include <fmgr.h>
+
+#ifdef PG_MODULE_MAGIC
+PG_MODULE_MAGIC;
+#endif
 
   int versioncmp(text *A, text *B);