For SVN, the version must be manually specified
authorRalf Jung <post@ralfj.de>
Fri, 27 Jul 2012 13:39:29 +0000 (15:39 +0200)
committerRalf Jung <ralfjung-e@gmx.de>
Fri, 27 Jul 2012 14:24:35 +0000 (16:24 +0200)
build_system.py
kdebuildpy.py
vcs.py

index d74689ffd734fb82f3e220adbfda1c9d8b208c3e..9a646538f321c1e739777dccd3a2c784c13e2b8a 100644 (file)
@@ -52,7 +52,7 @@ try:
                        }
                        self.copyFromModule(module, 'buildDepends')
                        self.copyFromModule(module, 'binaryDepends')
                        }
                        self.copyFromModule(module, 'buildDepends')
                        self.copyFromModule(module, 'binaryDepends')
-                       if buildSystem == 'cmakeParameters':
+                       if buildSystem == 'cmake':
                                self.copyFromModule(module, 'cmakeParameters')
                        self.vcs = vcs
                        self.configured = False # make sure configure is called before build/install
                                self.copyFromModule(module, 'cmakeParameters')
                        self.vcs = vcs
                        self.configured = False # make sure configure is called before build/install
@@ -63,6 +63,8 @@ try:
 
                def configure(self, force=False): # force is ignored
                        self.autoDebuildConfig['version'] = self.vcs.version() # by now, data has been fetched, so this is possible
 
                def configure(self, force=False): # force is ignored
                        self.autoDebuildConfig['version'] = self.vcs.version() # by now, data has been fetched, so this is possible
+                       if self.autoDebuildConfig['version'] is None:
+                               raise Exception("VCS did not provide us with a proper version, please fix this")
                        self.vcs.ignore('/debian/') # make sure the debian folder is ignored
                        os.chdir(self.sourceFolder)
                        #print self.autoDebuildConfig
                        self.vcs.ignore('/debian/') # make sure the debian folder is ignored
                        os.chdir(self.sourceFolder)
                        #print self.autoDebuildConfig
index b56eb86b5d932f72333eac60d97f5d4dbe1156bb..696c76f1e223e9cbb8b4b5b87779ff827371b77d 100755 (executable)
@@ -37,7 +37,7 @@ class Project:
                if vcsName == 'kde+git':
                        self.vcs = vcs.KDEGit(self.sourceFolder(), module['name'], module['version'])
                elif vcsName == 'kde+svn':
                if vcsName == 'kde+git':
                        self.vcs = vcs.KDEGit(self.sourceFolder(), module['name'], module['version'])
                elif vcsName == 'kde+svn':
-                       self.vcs = vcs.KDESVN(self.sourceFolder(), module['svn-path'])
+                       self.vcs = vcs.KDESVN(self.sourceFolder(), module['svn-path'], module.get('versionName'))
                else:
                        raise Exception("Unknown VCS type "+vcsName)
                # build system
                else:
                        raise Exception("Unknown VCS type "+vcsName)
                # build system
diff --git a/vcs.py b/vcs.py
index c63b2b955985d6e5e76b2c755f2b32f688bad275..b700b6e22c8e027d42825a207885bb728a67bcfc 100644 (file)
--- a/vcs.py
+++ b/vcs.py
@@ -65,10 +65,11 @@ class KDEGit(Git):
 
 # Fetch updates via SVN
 class SVN:
 
 # Fetch updates via SVN
 class SVN:
-       def __init__(self, folder, svnPath):
+       def __init__(self, folder, svnPath, versionName):
                self.folder = os.path.abspath(folder)
                self.svnPath = svnPath
                self.folder = os.path.abspath(folder)
                self.svnPath = svnPath
-       
+               self.versionName = versionName
+
        def update(self):
                if os.path.exists(self.folder):
                        os.chdir(self.folder) # go into repository
        def update(self):
                if os.path.exists(self.folder):
                        os.chdir(self.folder) # go into repository
@@ -76,6 +77,12 @@ class SVN:
                else:
                        subprocess.check_call(['svn', 'co', self.svnPath, self.folder])# just download it
 
                else:
                        subprocess.check_call(['svn', 'co', self.svnPath, self.folder])# just download it
 
+       def version(self):
+               return self.versionName
+
+       def ignore(self, name):
+               pass
+
 class KDESVN(SVN):
 class KDESVN(SVN):
-       def __init__(self, folder, svnPath):
-               SVN.__init__(self, folder, 'svn://svn.kde.org/home/kde/'+svnPath)
+       def __init__(self, folder, svnPath, version):
+               SVN.__init__(self, folder, 'svn://svn.kde.org/home/kde/'+svnPath, version)