fixing repo bits
authorPaul J R <me@pjr.cc>
Tue, 25 Jun 2013 22:49:06 +0000 (08:49 +1000)
committerPaul J R <me@pjr.cc>
Tue, 25 Jun 2013 22:49:06 +0000 (08:49 +1000)
lib/repo-yum.js

index 57741ba..38a8f87 100644 (file)
@@ -84,6 +84,16 @@ function maintain(name, repoinfo, files) {
                                })
                        }
                        
+                       
+                       // make sure we have a metadata file for our file
+                       fs.stat(metafile, function(err, stats)) {
+                               if(err) {
+                                       log.debug("file (%s) has no metadata file - moving for cleanup");
+                                       cache.moveToCleanup(files[i]);
+                                       cache.moveToCleanup(metafile);
+                               }
+                       }
+                       
                        // check meta data
                        fs.stat(files[i], function(err, stats) {
                                var fsize = stats.size;
@@ -103,7 +113,8 @@ function maintain(name, repoinfo, files) {
                                        }
                                });
 
-                       })
+                       });
+                       
                } else {
                        log.debug("file %s was ignored as its in download", files[i]);
                }