Exemple #1
0
    def run(self):
        if not os.path.isdir("doc/fragment"):
            mkpath("doc/fragment")

        with open("doc/fragment/date", "w"):
            pass
        with open("doc/fragment/version", "w") as f:
            f.write("<releaseinfo>%s</releaseinfo>" % self.distribution.get_version())

        for f in self.doc_formats:
            print("Building docs in %s format..." % f)
            subprocess.check_call(
                ["xmlto", "-o", "doc", "-m", "doc/custom.xsl", f, "doc/portage.docbook"]
            )
Exemple #2
0
    def run(self):
        for d, files in self.distribution.data_files:
            if not d.startswith("$mandir/"):
                continue

            for source in files:
                target = os.path.join(self.build_base, source)
                mkpath(os.path.dirname(target))

                if not newer(source, target) and not newer(__file__, target):
                    continue

                print("copying and updating %s -> %s" % (source, target))

                with codecs.open(source, "r", "utf8") as f:
                    data = f.readlines()
                data[0] = data[0].replace("VERSION", self.distribution.get_version())
                with codecs.open(target, "w", "utf8") as f:
                    f.writelines(data)