def merge_dir(self, src_dir, dst_dir): """Copy the downloaded files into the target path""" self.log.info("merging new files...") if not exists(dst_dir): sh.mkdir(dst_dir, log=self.log) sh.cp(join(src_dir, '*'), dstdir=dst_dir, recursive=True, log=self.log.info)
def get_wc(self, tmp_dir, repo_type, repo_url, repo_rev=None): """Get local working copy of the repo.""" if not exists(tmp_dir): sh.mkdir(tmp_dir) wc_dir = join(tmp_dir, "wc") if repo_type == "hg": if exists(wc_dir): sh.run_in_dir("hg fetch", wc_dir, logstream=self.log.info) else: sh.run_in_dir("hg clone %s wc" % repo_url, tmp_dir, logstream=self.log.info) if repo_rev: sh.run_in_dir("hg up %s" % repo_rev, wc_dir, logstream=self.log.info) elif repo_type == "git": if exists(wc_dir): sh.run_in_dir("git checkout %s" % repo_rev, wc_dir, logstream=self.log.info) sh.run_in_dir("git pull", wc_dir, logstream=self.log.info) else: sh.run_in_dir("git clone %s wc" % repo_url, tmp_dir, logstream=self.log.info) if repo_rev: sh.run_in_dir("git checkout %s" % repo_rev, wc_dir, logstream=self.log.info)
def make(self): sh.mkdir(self.cfg.ashelp_dir, log=self.log) sh.cp(join(self.htdocs_dir, "*"), dstdir=self.cfg.ashelp_dir, recursive=True, log=self.log.info) junk = [ join(self.cfg.ashelp_dir, "komodo-js-api.toc"), join(self.cfg.ashelp_dir, "manifest.ini"), join(self.cfg.ashelp_dir, "aux_search.rdf"), ] for path in junk: if exists(path): sh.rm(path, log=self.log)
def make(self): # Determine which release notes document to use. filters = self.cfg.filters or set([]) if "edit" in filters and "ide" not in filters: # Use "releases/ide.html" for the Komodo Edit release # notes -- at least for now. filters.add("ide") candidates = [] for filter in filters: path = join(self.htdocs_dir, "releases", filter + ".html") if exists(path): candidates.append(path) if len(candidates) == 1: relnotes_src_path = candidates[0] else: raise MkError( "Ambiguity in which `releases/*.html' to use " "for `relnotes.html'. This target can only be used when " "filtering for a specific Komodo flavor (see --filter " "configure.py option).") # CSS css_dir = join(self.cfg.miniset_dir, ".css") sh.mkdir(css_dir, log=self.log) sh.cp(join(self.htdocs_dir, "css", "screen.css"), dstdir=css_dir, log=self.log.info) # License text. sh.cp(self.cfg.license_text_path, join(self.cfg.miniset_dir, "license.txt"), log=self.log.info) # Release notes and install notes. # These are more difficult, because we need to update some of # the links in these files. manifest = [ (relnotes_src_path, join(self.cfg.miniset_dir, "relnotes.html")), (join(self.htdocs_dir, "install.html"), join(self.cfg.miniset_dir, "install.html")), ] # - Bunch 'o imports. for src, dst in manifest: independentize_html_path(src, dst, css_dir=".css", log=self.log)
def make(self): # komododoc.manifest defines = {"LANG": self.cfg.lang} src = join("mozhelp", "chrome.manifest") dst = join(self.cfg.chrome_dir, "komododoc.manifest") sh.mkdir(dirname(dst), log=self.log) self.log.info("preprocess %s %s", src, dst) preprocess.preprocess(src, dst, defines, contentType="Text", substitute=True) # content content_dir = join(self.cfg.chrome_dir, "komododoc", "content") sh.mkdir(content_dir, log=self.log) sh.cp(join("mozhelp", "helpOverlay.xul"), dstdir=content_dir, log=self.log.info) # locale sh.mkdir(self.locale_dir, log=self.log) sh.cp(join("mozhelp", "help_help.xhtml"), dstdir=self.locale_dir, log=self.log.info) sh.cp(join("mozhelp", "komodohelp.rdf"), dstdir=self.locale_dir, log=self.log.info) sh.cp(join(self.htdocs_dir, "*"), dstdir=self.locale_dir, recursive=True, log=self.log.info) junk = [ join(self.locale_dir, "komodo-js-api.toc"), join(self.locale_dir, "manifest.ini"), join(self.locale_dir, "toc.xml") ] for path in junk: if exists(path): sh.rm(path, log=self.log) help_toc_rdf = join(self.locale_dir, "help-toc.rdf") try: sh.run( "python support/tocxml2helptocrdf.py %s > %s" % (join(self.htdocs_dir, "toc.xml"), help_toc_rdf), self.log.info) except: if exists(help_toc_rdf): sh.rm(help_toc_rdf) raise
def make(self): dst = self.results[0].relpath sh.mkdir(dirname(dst), log=self.log) sh.cp(self.deps[0].relpath, dst, log=self.log.info)