src/Pure/System/components.scala
changeset 69398 0698ded5caf1
parent 69395 d1c4a1dee9e7
child 69401 7a1b7b737c02
equal deleted inserted replaced
69397:df7d7477284b 69398:0698ded5caf1
    14   def admin(dir: Path): Path = dir + Path.explode("Admin/components")
    14   def admin(dir: Path): Path = dir + Path.explode("Admin/components")
    15 
    15 
    16   def contrib(dir: Path = Path.current, name: String = ""): Path =
    16   def contrib(dir: Path = Path.current, name: String = ""): Path =
    17     dir + Path.explode("contrib") + Path.explode(name)
    17     dir + Path.explode("contrib") + Path.explode(name)
    18 
    18 
       
    19   def download(dir: Path, names: List[String], progress: Progress = No_Progress)
       
    20   {
       
    21     Isabelle_System.mkdirs(dir)
       
    22     for (name <- names) {
       
    23       val archive = name + ".tar.gz"
       
    24       val target = dir + Path.explode(archive)
       
    25       if (!target.is_file) {
       
    26         val remote = Isabelle_System.getenv("ISABELLE_COMPONENT_REPOSITORY") + "/" + archive
       
    27         progress.echo("Getting " + quote(remote))
       
    28         Bytes.write(target, Url.read_bytes(Url(remote)))
       
    29       }
       
    30     }
       
    31   }
       
    32 
    19 
    33 
    20   /* component directory content */
    34   /* component directory content */
    21 
    35 
    22   def settings(dir: Path): Path = dir + Path.explode("etc/settings")
    36   def settings(dir: Path): Path = dir + Path.explode("etc/settings")
    23   def components(dir: Path): Path = dir + Path.explode("etc/components")
    37   def components(dir: Path): Path = dir + Path.explode("etc/components")