Commits

Martin von Löwis  committed 88709fc Merge

Merged

  • Participants
  • Parent commits ab6d5a7, c38e581

Comments (0)

Files changed (2)

File pep381client/__init__.py

         if self.last_started == 0:
             # no synchronization in progress. Fetch changelog
             self.last_started = now()
-            changes = xmlrpc.changelog(self.last_completed-1)
+            changes = xmlrpc().changelog(self.last_completed-1)
             if not changes:
                 return
             for change in changes:
             self.projects_to_do.remove(project)
             self.store()
         with open(self.homedir+"/web/last-modified", "wb") as f:
-            f.write(time.strftime("%Y%m%dT%H:%M:%S\n", time.gmtime(now)))
+            f.write(time.strftime("%Y%m%dT%H:%M:%S\n", time.gmtime(self.last_started)))
+        self.last_completed = self.last_started
+        self.last_started = 0
+        self.store()
 
     def copy_simple_page(self, project):
         project = project.encode('utf-8')
         html = r.read()
         if r.status == 404:
             return None
+        if r.status == 301:
+            # package not existant anymore, however, similarly-spelled
+            # package exists
+            return None
         if r.status != 200:
             raise ValueError, "Status %d on %s" % (r.status, project)
         if not os.path.exists(self.homedir+'/web/simple/'+project):
 # convert all files in a directory to directories with an index.html
 for a in $1/*
 do
-  mv $a $a.bak
-  mkdir $a
-  mv $a.bak $a/index.html
-done
+  if [ -f "$a" ]
+  then
+      mv "$a" "$a.bak"
+      mkdir "$a"
+      mv "$a.bak" "$a/index.html"
+  fi
+done