[kernel] r11324 - people/waldi/scripts/snapshot

Bastian Blank waldi at alioth.debian.org
Wed May 7 20:04:59 UTC 2008


Author: waldi
Date: Wed May  7 20:04:58 2008
New Revision: 11324

Log:
snapshot/package.py: Update.


Modified:
   people/waldi/scripts/snapshot/package.py

Modified: people/waldi/scripts/snapshot/package.py
==============================================================================
--- people/waldi/scripts/snapshot/package.py	(original)
+++ people/waldi/scripts/snapshot/package.py	Wed May  7 20:04:58 2008
@@ -163,9 +163,11 @@
         last_file = os.path.join(base, "last-" + path.replace('/', '_'))
 
         checkout_storage = repository_svn(checkout_dir, "%s/%s" % (entry['repository'], path))
-        changelog_entry = debian_linux.debian.Changelog(checkout_dir)[0]
-        package_name = changelog_entry.source
-        package_version = changelog_entry.version.upstream
+
+        self.changelog = debian_linux.debian.Changelog(checkout_dir)[0]
+
+        package_name = self.changelog.source
+        package_version = self.changelog.version.upstream
         package = "%s-%s" % (package_name, package_version)
         package_dir = os.path.join(gen_dir, package)
         package_orig = "%s_%s.orig.tar.gz" % (package_name, package_version)
@@ -183,15 +185,7 @@
         if not os.path.exists(out_dir):
             os.makedirs(out_dir , 0755)
 
-        version = changelog_entry.version
-        if changelog_entry.distribution in ('stable', 'testing', 'unstable', 'experimental'):
-            version_debian_delemiter = ''
-        elif changelog_entry.distribution in ('UNRELEASED',):
-            version_debian_delemiter = '~'
-        else:
-            raise "Unknown distribution"
-
-        version.debian += "%ssnapshot.%d" % (version_debian_delemiter, revision)
+        self.version(revision)
 
         package_storage = checkout_storage.copy(package_dir, storage)
 
@@ -217,7 +211,7 @@
  -- %s  %s
 
 """ % (
-        package_name, version, entry['dist'],
+        package_name, self.version, entry['dist'],
         entry['changelog_text'], entry['changelog_maintainer'],
         time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()),
     )
@@ -262,6 +256,18 @@
 
         package_storage.remove()
 
+    def version(self, revision):
+        c = self.changelog
+        version = c.version
+        if c.distribution in ('stable', 'testing', 'unstable', 'experimental'):
+            delemiter = ''
+        elif c.distribution in ('UNRELEASED',):
+            delemiter = '~'
+        else:
+            raise "Unknown distribution"
+
+        version.debian += "%ssnapshot.%d" % (delemiter, revision)
+
 if __name__ == '__main__':
     config = Config(sys.argv[1])
     if len(sys.argv) > 2:



More information about the Kernel-svn-changes mailing list