~philip-peitsch/quickly/multiple-distros

« back to all changes in this revision

Viewing changes to data/templates/ubuntu-application/upgrade.py

  • Committer: Didier Roche
  • Date: 2010-02-15 20:38:30 UTC
  • mfrom: (414.1.4 fix-errors)
  • Revision ID: didrocks@ubuntu.com-20100215203830-q0fj37um5annlff0
Some fixes in share/transition/competion. Kudos to v0xel

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
 
44
44
##### 0.4 update
45
 
# transition to 0.3.1: new licensing format
46
 
if project_version < '0.3.1':
47
 
    # don't handle error in upgrade (maybe the file doesn't exist)
 
45
if project_version < '0.4':
 
46
    ## new licensing format
48
47
    bzr_instance = subprocess.Popen(["bzr", "mv", "LICENSE", "COPYING"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
49
 
    # if file not versionned, try traditional move, (bzr returncode is None if dir not writable ??)
 
48
    # if file not versionned, try traditional move, (bzr returncode is None if dir not writable)
50
49
    if bzr_instance.returncode == 3 or bzr_instance.returncode is None:
51
50
        try:
52
51
            os.rename('LICENSE', 'COPYING')
94
93
        os.rename(fout.name, fin.name)
95
94
    except (OSError, IOError), e:
96
95
        pass
97
 
 
 
96
    ## new ~public becomes -public
 
97
    try:
 
98
        version = quicklyutils.get_setup_value('version')
 
99
        if "~public" in version:
 
100
            quicklyutils.set_setup_value('version', version.replace("~public", "-public"))
 
101
    except quicklyutils.cant_deal_with_setup_value:
 
102
        pass
98
103
 
99
104
sys.exit(0)