~ehbello/gcs/trunk

« back to all changes in this revision

Viewing changes to builder.py

  • Committer: Enrique Hernández Bello
  • Date: 2010-11-15 20:52:54 UTC
  • Revision ID: quique@osl.ull.es-20101115205254-l26r0ti3d155sy31
Resulting files are now deleted before a new build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    def make_package(self):
39
39
        """ Make the package. Use ScriptGenerator objects for this propouse.
40
40
        """
 
41
        self.__delete_outputfiles()
 
42
 
41
43
        try:
42
44
            os.mkdir(config['source_path'] + '/debian')
43
45
        except OSError:
59
61
        TemplatesGenerator().activate()
60
62
        CopyrightGenerator().activate()
61
63
 
62
 
        # FIXME: At the moment we need to keep the configuration files because
63
 
        # the conversion doesn't transparently (dh_install rename problem)
64
 
        #self.__delete_tmpfiles()
65
 
 
66
 
 
67
 
 
68
64
 
69
65
    def build_package(self):
70
 
        """ Build the package. Use a simply debuild for this propouse.
 
66
        """ Build the package. Use a simply debuild for this purpose.
71
67
        """
72
68
        try:
73
69
            os.system('debuild -us -uc')
93
89
                copy_file, None)
94
90
 
95
91
 
96
 
    def __delete_tmpfiles(self):
97
 
        """ Add .gcs extension at all conffiles (making a copy)
 
92
    def __delete_outputfiles(self):
 
93
        """ Delete all files of conffiles with .gcs extension
 
94
        and Debian directory if it exists.
98
95
        """
99
96
        def delete_file(arg, dirname, file_names):
100
97
 
106
103
 
107
104
        os.path.walk(config['source_path'] + '/gcs/conffiles_skel/',
108
105
                delete_file, None)
 
106
        shutil.rmtree(config['source_path'] + '/debian', True)
109
107