~mysql/mysql-utilities/1.5

« back to all changes in this revision

Viewing changes to support/distribution/commands/sdist.py

  • Committer: Israel Gomez
  • Date: 2014-07-25 15:49:36 UTC
  • Revision ID: israel.gomez@oracle.com-20140725154936-qq2v9ndmdsle4lec
Tags: release-1.5.1rc1
BUG#19262669 : fixes to Package mechanisms regarding release-1.5.1rc

The release-1.5.1rc will be a standalone release, meaning it Utilities will
no longer be a subproduct of Workbench. As a result we need to fix some of
the Package mechanism.

This patch fixes the Package mechanism to remove the references to Workbench,
in addition adds the functionality to package additional info files from
Fabric proyect.

This patch also fixes the shortcuts to the online documentation installed by
the Windows MSI package.

v3

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
         "Owner name used when creating a tar file [default: current user]"),
62
62
        ('group=', 'g',
63
63
         "Group name used when creating a tar file [default: current group]"),
64
 
        ('tag=', 't',
 
64
        ('tag=', 't',
65
65
         "Adds a tag name after the release version"),
66
66
        ]
67
67
 
82
82
 
83
83
    def copy_extra_files(self, base_dir):
84
84
        extra_files = [
85
 
           
86
85
        ]
87
86
        for src, dest in extra_files:
88
87
            self.copy_file(src, dest)
89
88
 
 
89
    def rename_info_files(self, base_dir):
 
90
        info_files = [
 
91
            ('README.txt', 'README_Utilities.txt'),
 
92
            ('CHANGES.txt', 'CHANGES_Utilities.txt')
 
93
        ]
 
94
        for src, dest in info_files:
 
95
            self.move_file(os.path.join(base_dir, src),
 
96
                           os.path.join(base_dir, dest))
 
97
 
90
98
    def make_release_tree(self, base_dir, files):
91
99
        self.mkpath(base_dir)
92
100
        create_tree(base_dir, files, dry_run=self.dry_run)
106
114
 
107
115
        self.copy_extra_files(base_dir)
108
116
 
 
117
        self.rename_info_files(base_dir)
 
118
 
109
119
        self.distribution.metadata.write_pkg_info(base_dir)
110
120
 
111
121
    def make_distribution(self):
261
271
        
262
272
        # create distribution
263
273
        info_files = [
264
 
            ('README.txt', 'README.txt'),
265
 
            ('LICENSE.txt', 'LICENSE.txt')
 
274
            ('README.txt', 'README_Utilities.txt'),
 
275
            ('LICENSE.txt', 'LICENSE.txt'),
 
276
            ('CHANGES.txt', 'CHANGES_Utilities.txt'),
 
277
            ('README_fabric.txt', 'README_fabric.txt'),
 
278
            ('CHANGES_fabric.txt', 'CHANGES_fabric.txt')
266
279
        ]
267
280
        copy_tree(self.bdist_dir, self.dist_target)
268
281
        pkg_info = mkpath(os.path.join(self.dist_target))
269
282
        for src, dst in info_files:
270
 
            if dst is None:
271
 
                copy_file(src, self.dist_target)
 
283
            if os.path.exists(src):
 
284
                if dst is None:
 
285
                    copy_file(src, self.dist_target)
 
286
                else:
 
287
                    copy_file(src, os.path.join(self.dist_target, dst))
272
288
            else:
273
 
                copy_file(src, os.path.join(self.dist_target, dst))
 
289
                log.info("File not found: {0}".format(src))
274
290
 
275
291
        if not self.keep_temp:
276
292
            remove_tree(self.build_base, dry_run=self.dry_run)
277
293
 
 
294
 
278
295
class SourceCommercial(sdist):
279
296
    """Create commercial source distribution
280
297
    """