Esempio n. 1
0
    def make_distribution(self):
        # standard stuff
        _sdist.make_distribution(self)

        # extra: copies tar.gz file over to software web pages, updates link
        # and the index.html file
        if 'WEB_PATH' in os.environ:
            dest_dir = os.path.join(os.environ['WEB_PATH'], 'software')
            if os.path.isdir(dest_dir):
                # name of tar file with version number
                full_name = self.distribution.get_fullname() + '.tar.gz'

                # tar file with version number and directory added
                base_name = os.path.join(self.dist_dir, full_name)

                if os.path.isfile(base_name):
                    # name without version number
                    oname = self.distribution.get_name()
                    name = oname + '.tar.gz'

                    # name with version number in web page directory
                    dest_name = os.path.join(dest_dir, full_name)
                    print 'copying', base_name, '->', dest_name
                    shutil.copy(base_name, dest_name)

                    # soft link
                    link_name = os.path.join(dest_dir, name)
                    print 'soft linking', dest_name, '->', link_name
                    if os.path.islink(link_name):
                        os.remove(link_name)
                    if os.path.exists(link_name):
                        print link_name, 'exists but should not; please fix.'
                        exit(1)
                    os.symlink(dest_name, link_name)

                    # html file
                    index_file = os.path.join(dest_dir, 'index.html')
                    if os.path.isfile(index_file):
                        print 'updating', index_file
                        fin = open(index_file)
                        version = self.distribution.get_version()
                        lines = []
                        now = datetime.datetime.now()
                        for line in fin:
                            if line.find(oname + ' version') > -1:
                                line = '<!-- ' + oname + ' version --><td>' + version + '</td>\n'
                            if line.find(oname + ' date') > -1:
                                line = '<!-- ' + oname + ' date --><td>' + now.ctime(
                                ) + '</td>\n'
                            lines.append(line)
                        fin.close()

                        fout = open(index_file, 'w')
                        for line in lines:
                            fout.write(line)
                        fout.close()
Esempio n. 2
0
    def make_distribution(self):
        # standard stuff
        _sdist.make_distribution(self)

        # extra: copies tar.gz file over to software web pages, updates link
        # and the index.html file
        if 'WEB_PATH' in os.environ:
            dest_dir = os.path.join(os.environ['WEB_PATH'], 'software')
            if os.path.isdir(dest_dir):
                # name of tar file with version number
                full_name = self.distribution.get_fullname() + '.tar.gz'

                # tar file with version number and directory added
                base_name = os.path.join(self.dist_dir, full_name)

                if os.path.isfile(base_name):
                    # name without version number
                    oname = self.distribution.get_name()
                    name  = oname + '.tar.gz'

                    # name with version number in web page directory
                    dest_name = os.path.join(dest_dir, full_name)
                    print 'copying',base_name,'->',dest_name
                    shutil.copy(base_name, dest_name)

                    # soft link
                    link_name = os.path.join(dest_dir, name)
                    print 'soft linking',dest_name,'->',link_name
                    if os.path.islink(link_name):
                        os.remove(link_name)
                    if os.path.exists(link_name):
                        print link_name,'exists but should not; please fix.'
                        exit(1)
                    os.symlink(dest_name, link_name)


                    # html file
                    index_file = os.path.join(dest_dir, 'index.html')
                    if os.path.isfile(index_file):
                        print 'updating',index_file
                        fin = open(index_file)
                        version = self.distribution.get_version()
                        lines = []
                        now = datetime.datetime.now()
                        for line in fin:
                            if line.find(oname + ' version') > -1:
                                line = '<!-- ' + oname + ' version --><td>' + version + '</td>\n'
                            if line.find(oname + ' date') > -1:
                                line = '<!-- ' + oname + ' date --><td>' + now.ctime() + '</td>\n'
                            lines.append(line)
                        fin.close()

                        fout = open(index_file, 'w')
                        for line in lines:
                            fout.write(line)
                        fout.close()
Esempio n. 3
0
    def make_distribution(self):
        self.prune_file_list()
        sdist.make_distribution(self)
        dest = self.archive_files[0]
        dirname, basename = os.path.split(dest)
        base, ext = os.path.splitext(basename)
        while ext in [".zip", ".tar", ".bz2", ".gz", ".Z", ".lz", ".orig"]:
            base, ext = os.path.splitext(base)

        debian_arch = os.path.join(dirname, self.get_debian_name() + ".orig.tar.gz")
        os.rename(self.archive_files[0], debian_arch)
        self.archive_files = [debian_arch]
        print("Building debian .orig.tar.gz in %s" % self.archive_files[0])
Esempio n. 4
0
    def make_distribution(self):
        self.prune_file_list()
        sdist.make_distribution(self)
        dest = self.archive_files[0]
        dirname, basename = os.path.split(dest)
        base, ext = os.path.splitext(basename)
        while ext in [".zip", ".tar", ".bz2", ".gz", ".Z", ".lz", ".orig"]:
            base, ext = os.path.splitext(base)

        debian_arch = os.path.join(dirname, self.get_debian_name() + ".orig.tar.gz")
        os.rename(self.archive_files[0], debian_arch)
        self.archive_files = [debian_arch]
        print("Building debian .orig.tar.gz in %s" % self.archive_files[0])
Esempio n. 5
0
File: setup.py Progetto: ddale/fabio
 def make_distribution(self):
     sdist.make_distribution(self)
     dest = self.archive_files[0]
     dirname, basename = op.split(dest)
     base, ext = op.splitext(basename)
     while ext in [".zip", ".tar", ".bz2", ".gz", ".Z", ".lz", ".orig"]:
         base, ext = op.splitext(base)
     if ext:
         dest = "".join((base, ext))
     else:
         dest = base
     sp = dest.split("-")
     base = sp[:-1]
     nr = sp[-1]
     debian_arch = op.join(dirname, "-".join(base) + "_" + nr + ".orig.tar.gz")
     os.rename(self.archive_files[0], debian_arch)
     self.archive_files = [debian_arch]
     print("Building debian .orig.tar.gz in %s" % self.archive_files[0])
Esempio n. 6
0
 def make_distribution(self):
     sdist.make_distribution(self)
     dest = self.archive_files[0]
     dirname, basename = op.split(dest)
     base, ext = op.splitext(basename)
     while ext in [".zip", ".tar", ".bz2", ".gz", ".Z", ".lz", ".orig"]:
         base, ext = op.splitext(base)
     if ext:
         dest = "".join((base, ext))
     else:
         dest = base
     sp = dest.split("-")
     base = sp[:-1]
     nr = sp[-1]
     debian_arch = op.join(dirname,
                           "-".join(base) + "_" + nr + ".orig.tar.gz")
     os.rename(self.archive_files[0], debian_arch)
     self.archive_files = [debian_arch]
     print("Building debian .orig.tar.gz in %s" % self.archive_files[0])
Esempio n. 7
0
File: setup.py Progetto: iquaba/salt
 def make_distribution(self):
     sdist.make_distribution(self)
     if self.distribution.ssh_packaging:
         os.unlink(PACKAGED_FOR_SALT_SSH_FILE)
Esempio n. 8
0
 def make_distribution(self):
     sdist.make_distribution(self)
     if self.distribution.ssh_packaging:
         os.unlink(PACKAGED_FOR_SALT_SSH_FILE)
Esempio n. 9
0
 def make_distribution(self):
     # See https://github.com/skyfielders/python-skyfield/issues/378
     for path in self.filelist.files:
         os.chmod(path, 0o644)
     sdist.make_distribution(self)
Esempio n. 10
0
 def make_distribution(self):
     self.run_command('build_static')
     return sdist.make_distribution(self)