[Extras-cauldron-commits] r150 - trunk/buildme/buildlib

ed_ at garage.maemo.org ed_ at garage.maemo.org
Sun Sep 6 22:39:02 EEST 2009


Author: ed_
Date: 2009-09-06 22:39:00 +0300 (Sun, 06 Sep 2009)
New Revision: 150

Removed:
   trunk/buildme/buildlib/dsc.py
Log:
removed dsc.py

Deleted: trunk/buildme/buildlib/dsc.py
===================================================================
--- trunk/buildme/buildlib/dsc.py	2009-09-06 19:37:46 UTC (rev 149)
+++ trunk/buildme/buildlib/dsc.py	2009-09-06 19:39:00 UTC (rev 150)
@@ -1,122 +0,0 @@
-#!/usr/bin/python -tt
-# vim: sw=4 ts=4 expandtab ai
-#
-# Dsc API
-#
-# Copyright (C) 2008 Ed Bartosh <bartosh at gmail.com>
-#
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License version 2 as published by the
-# Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 51
-# Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# $Id$
-
-"""
-Dsc extention of minideblib's ChangeFile
-"""
-
-__revision__ = "r"+"$Revision$".split(' ')[1]
-
-import os, shutil
-
-from commands import getstatusoutput
-
-from buildlib.lock import Lockf
-from minideblib.ChangeFile import ChangeFile, ChangeFileException
-from minideblib.SignedFile import SignedFile
-
-class DscException(Exception): pass
-class LockException(Exception): pass
-
-class Dsc(ChangeFile):
-    """ .dsc file with locking and some extra functionality """
-
-    _lockdir = "/var/tmp/"
-
-    def __init__(self, fname, exclude=None, mustbesigned=True):
-        """ Init """
-
-        name = os.path.basename(fname)
-
-        # try to lock the file
-        self.lock = Lockf(os.path.join(self._lockdir, name + '.lock'))
-        if not self.lock.lock():
-            raise LockException("%s is locked" % name)
-
-        ChangeFile.__init__(self)
-
-        try:
-            self.load_from_file(fname)
-        except IOError, exobj:
-            raise DscException("Error: Can't read from dsc file '%s'" % name)
-
-        fptr = open(fname)
-        self.signed = SignedFile(fptr).getSigned()
-        fptr.close()
-
-        if mustbesigned and not self.signed:
-            raise DscException("Error: file %s isn't signed" % name)
-
-        if not exclude:
-            exclude = []
-
-        self.exclude = exclude
-        self.dir = os.path.dirname(fname)
-        self.fname = fname
-        self.name = os.path.basename(os.path.splitext(fname)[0])
-
-    def verify(self, directory = None):
-        """ the same as parent's method, but doesn't require directory """
-
-        if not directory:
-            directory = self.dir
-
-        ChangeFile.verify(self, directory)
-
-        # Check gpg signature if file is signed
-        if self.signed:
-            self._logger.debug("'%s' is signed, checking" % self.fname)
-            (rcode, out) = getstatusoutput("gpg --verify %s" % self.fname)
-            if rcode:
-                raise DscException("GPG verification of '%s' failed. gpg returned %s, output: %s" \
-                                          % (os.path.basename(self.fname), rcode, out))
-
-    def getFiles(self):
-        """ Wrapper around parent's method. Understands excludes """
-
-        return [finfo for finfo in ChangeFile.getFiles(self) if os.path.splitext(finfo[4])[1] not in self.exclude]
-
-    def getpaths(self):
-        """ Return list of file paths including .changes file itself """
-
-        return [self.fname] + [os.path.join(self.dir, finfo[4]) for finfo in self.getFiles()]
-
-    def movefiles(self, dest):
-        """ Move files to dest dir """
-
-        for fname in self.getpaths():
-            shutil.move(fname, dest)
-
-        self.dir = dest
-        self.fname = os.path.join(dest, os.path.basename(self.fname))
-
-
-if __name__ == '__main__':
-    raise NotImplemented
-
-# Local Variables:
-# mode: python
-# py-indent-offset: 4
-# indent-tabs-mode nil
-# tab-width 4
-# End:
-



More information about the Extras-cauldron-commits mailing list