~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to config/pandora-plugin

  • Committer: Monty Taylor
  • Date: 2010-03-23 08:23:32 UTC
  • mto: This revision was merged to the branch mainline in revision 1398.
  • Revision ID: mordred@inaugust.com-20100323082332-r8tktlbu82wlamzv
Set the default plugin version for plugins not specifying a version to be
tied to the actual server version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import ConfigParser, os, sys
22
22
import datetime, time
 
23
import subprocess
23
24
 
24
25
top_srcdir='.'
25
26
top_builddir='.'
35
36
root_plugin_dir='plugin'
36
37
pkgplugindir='$(libdir)/drizzle'
37
38
default_install='True'
 
39
default_plugin_version=''
38
40
 
39
41
class ChangeProtectedFile(object):
40
42
 
383
385
        print "External Plugins are required to specifiy a version"
384
386
        sys.exit(1)
385
387
    if not plugin.has_key('version'):
386
 
      plugin['version']=datetime.date.fromtimestamp(time.time()).isoformat()
 
388
      plugin['version'] = default_plugin_version
387
389
   
388
390
    if plugin.has_key('load_by_default'):
389
391
      plugin['load_by_default']=parser.getboolean('plugin','load_by_default')
480
482
 
481
483
#MAIN STARTS HERE:
482
484
 
 
485
#@TODO replace this with a modular bit
 
486
if not os.path.exists('config/pandora_vc_revno'):
 
487
  # I'm 3 seconds away from writing a comprehensive build solution
 
488
  bzr_revno= subprocess.Popen(["bzr", "revno"], stdout=subprocess.PIPE).communicate()[0].strip()
 
489
  rev_date= datetime.date.fromtimestamp(time.time())
 
490
  default_plugin_version = "%d.%02d.%s" % (rev_date.year, rev_date.month, bzr_revno)
 
491
else:
 
492
  # need to read config/pandora_vc_revno
 
493
  default_plugin_version = datetime.date.fromtimestamp(time.time()).isoformat()
483
494
actions=[]
484
495
for arg in sys.argv:
485
496
  if arg.startswith('--top_srcdir='):