src/Pure/Admin/other_isabelle.scala
changeset 69404 de88761edbe2
parent 69401 7a1b7b737c02
child 69408 fb26935838c7
equal deleted inserted replaced
69403:258740767dc9 69404:de88761edbe2
    11 {
    11 {
    12   def apply(isabelle_home: Path,
    12   def apply(isabelle_home: Path,
    13       isabelle_identifier: String = "",
    13       isabelle_identifier: String = "",
    14       user_home: Path = Path.explode("$USER_HOME"),
    14       user_home: Path = Path.explode("$USER_HOME"),
    15       progress: Progress = No_Progress): Other_Isabelle =
    15       progress: Progress = No_Progress): Other_Isabelle =
    16     new Other_Isabelle(isabelle_home, isabelle_identifier, user_home, progress)
    16     new Other_Isabelle(isabelle_home.absolute, isabelle_identifier, user_home, progress)
    17 }
    17 }
    18 
    18 
    19 class Other_Isabelle(
    19 class Other_Isabelle(
    20   val isabelle_home: Path,
    20   val isabelle_home: Path,
    21   val isabelle_identifier: String,
    21   val isabelle_identifier: String,
    22   user_home: Path,
    22   user_home: Path,
    23   progress: Progress)
    23   progress: Progress)
    24 {
    24 {
    25   other_isabelle =>
    25   other_isabelle =>
    26 
    26 
    27   override def toString: String = isabelle_home.absolute.toString
    27   override def toString: String = isabelle_home.toString
    28 
    28 
    29   if (proper_string(System.getenv("ISABELLE_SETTINGS_PRESENT")).isDefined)
    29   if (proper_string(System.getenv("ISABELLE_SETTINGS_PRESENT")).isDefined)
    30     error("Cannot initialize with enclosing ISABELLE_SETTINGS_PRESENT")
    30     error("Cannot initialize with enclosing ISABELLE_SETTINGS_PRESENT")
    31 
    31 
    32 
    32 
    67 
    67 
    68 
    68 
    69   /* components */
    69   /* components */
    70 
    70 
    71   def components_base(base: Option[Path]): Path =
    71   def components_base(base: Option[Path]): Path =
    72     base getOrElse Components.contrib(isabelle_home_user.absolute.dir)
    72     base getOrElse Components.contrib(isabelle_home_user.dir)
    73 
    73 
    74   def init_components(
    74   def init_components(
    75     base: Option[Path] = None,
    75     base: Option[Path] = None,
    76     catalogs: List[String] = Nil,
    76     catalogs: List[String] = Nil,
    77     components: List[String] = Nil): List[String] =
    77     components: List[String] = Nil): List[String] =
    78   {
    78   {
    79     val base_dir = components_base(base)
    79     val base_dir = components_base(base)
    80     val dir = Components.admin(isabelle_home.absolute)
    80     val dir = Components.admin(isabelle_home)
    81     catalogs.map(name =>
    81     catalogs.map(name =>
    82       "init_components " + File.bash_path(base_dir) + " " + File.bash_path(dir + Path.basic(name))) :::
    82       "init_components " + File.bash_path(base_dir) + " " + File.bash_path(dir + Path.basic(name))) :::
    83     components.map(name =>
    83     components.map(name =>
    84       "init_component " + File.bash_path(base_dir + Path.basic(name)))
    84       "init_component " + File.bash_path(base_dir + Path.basic(name)))
    85   }
    85   }