src/hg/encode/encodeMkChangeNotes/encodeMkChangeNotes 1.11

1.11 2010/04/12 17:22:43 krish
now show full filename (not just extention) on warning
Index: src/hg/encode/encodeMkChangeNotes/encodeMkChangeNotes
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/encode/encodeMkChangeNotes/encodeMkChangeNotes,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -B -U 4 -r1.10 -r1.11
--- src/hg/encode/encodeMkChangeNotes/encodeMkChangeNotes	8 Apr 2010 00:06:54 -0000	1.10
+++ src/hg/encode/encodeMkChangeNotes/encodeMkChangeNotes	12 Apr 2010 17:22:43 -0000	1.11
@@ -144,8 +144,12 @@
         path_prefix = "/usr/local/apache/htdocs/goldenPath/%s/encodeDCC/%s/%s/" \
             % (database, options.composite_name, current_release_dir)
 
     # generate the list of files
+    if os.path.exists("gbdb"):
+        gbdb_files  = get_file_set("gbdb", ".*")
+    else:
+        gbdb_files = set()
     current_files = get_file_set(current_release_dir, ".*\.gz$")
     if prev_release_dir == "-":
         prev_files = set()
         prev_release_dir = ""
@@ -193,8 +197,9 @@
                 unchanged_tables_list.append(name)
                 gbdb_path = get_gbdb_pathname(database, name)
                 if gbdb_path != None and os.path.exists(gbdb_path):
                     unchanged_gbdbs_list.append(gbdb_path)
+                    gbdb_files.remove(os.path.basename(gbdb_path))
                 else:
                     warn = "could not find %s file for %s" % (gbdb_path, f)
                     warnings.append(warn)
                     print >>sys.stderr, warn
@@ -259,8 +264,9 @@
                 new_tables_list.append(name)
                 gbdb_path = get_gbdb_pathname(database, name)
                 if gbdb_path != None and os.path.exists(gbdb_path):
                     new_gbdbs_list.append(gbdb_path)
+                    gbdb_files.remove(os.path.basename(gbdb_path))
                 else:
                     warn = "could not find %s file for %s" % (gbdb_path, f)
                     warnings.append(warn)
                     print >>sys.stderr, warn
@@ -289,8 +295,33 @@
             warn = "addition file %s not found" % f
             warnings.append(warn)
             print >>sys.stderr, warn
 
+    # check remaining files from gbdb
+    for f in gbdb_files:
+        if '.' in f:
+            file, extension = f.split(".", 1)
+        else:
+            file = f
+        if table_exists(database, file):
+            new_tables_list.append(file)
+            gbdb_path = get_gbdb_pathname(database, file)
+            if gbdb_path != None and os.path.exists(gbdb_path):
+                new_gbdbs_list.append(gbdb_path)
+                
+                warn = "file %s in ./gbdb/ found with coresponding table and gbdb file but no download file" % f
+                warnings.append(warn)
+                print >>sys.stderr, warn
+            else:
+                warn = "file %s in ./gbdb/ found with coresponding table but no download file" % f
+                warnings.append(warn)
+                print >>sys.stderr, warn
+        else:
+            warn = "file %s in ./gbdb/ found with no coresponding table or download file found" % f
+            warnings.append(warn)
+            print >>sys.stderr, warn
+            
+
     # output some basic stats
     if options.verbose:
         print >>sys.stderr, "Counts:"
         print >>sys.stderr, "  unchanged tables: %d" % len(unchanged_tables_list)