From: Ralf Jung Date: Fri, 27 Jul 2012 13:39:29 +0000 (+0200) Subject: For SVN, the version must be manually specified X-Git-Url: https://git.ralfj.de/mass-build.git/commitdiff_plain/1c7ec34aa2c1faefe2cc96df094e427e3ef83376?ds=inline For SVN, the version must be manually specified --- diff --git a/build_system.py b/build_system.py index d74689f..9a64653 100644 --- a/build_system.py +++ b/build_system.py @@ -52,7 +52,7 @@ try: } 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 @@ -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 + 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 diff --git a/kdebuildpy.py b/kdebuildpy.py index b56eb86..696c76f 100755 --- a/kdebuildpy.py +++ b/kdebuildpy.py @@ -37,7 +37,7 @@ class Project: 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 diff --git a/vcs.py b/vcs.py index c63b2b9..b700b6e 100644 --- a/vcs.py +++ b/vcs.py @@ -65,10 +65,11 @@ class KDEGit(Git): # 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.versionName = versionName + 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 + def version(self): + return self.versionName + + def ignore(self, name): + pass + 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)