Isabelle/Phabricator supports Ubuntu 20.04 LTS;
authorwenzelm
Fri, 30 Oct 2020 22:56:15 +0100
changeset 72521 354bfab78cbf
parent 72520 581d9d74e1e4
child 72522 6e27af808c17
Isabelle/Phabricator supports Ubuntu 20.04 LTS;
NEWS
src/Doc/System/Phabricator.thy
src/Pure/System/linux.scala
src/Pure/Tools/phabricator.scala
--- a/NEWS	Fri Oct 30 21:10:18 2020 +0100
+++ b/NEWS	Fri Oct 30 22:56:15 2020 +0100
@@ -244,6 +244,8 @@
 * Isabelle server allows user-defined commands via
 isabelle_scala_service.
 
+* Isabelle/Phabricator supports Ubuntu 20.04 LTS.
+
 * Isabelle/Phabricator setup has been updated to follow ongoing
 development: libphutil has been discontinued. Minor INCOMPATIBILITY:
 existing server installations should remove libphutil from
--- a/src/Doc/System/Phabricator.thy	Fri Oct 30 21:10:18 2020 +0100
+++ b/src/Doc/System/Phabricator.thy	Fri Oct 30 22:56:15 2020 +0100
@@ -63,7 +63,7 @@
 section \<open>Quick start\<close>
 
 text \<open>
-  The starting point is a fresh installation of \<^bold>\<open>Ubuntu 18.04
+  The starting point is a fresh installation of \<^bold>\<open>Ubuntu 18.04 or 20.04
   LTS\<close>\<^footnote>\<open>\<^url>\<open>https://ubuntu.com/download\<close>\<close>: this version is mandatory due to
   subtle dependencies on system packages and configuration that is assumed by
   the Isabelle setup tool.
@@ -233,7 +233,7 @@
     @{verbatim [display] \<open>  systemctl reload apache2\<close>}
 
     \<^item> Install \<^verbatim>\<open>certbot\<close> from \<^url>\<open>https://certbot.eff.org\<close> following the
-    description for Apache and Ubuntu 18.04 on
+    description for Apache and Ubuntu 18.04 or 20.04 on
     \<^url>\<open>https://certbot.eff.org/lets-encrypt/ubuntubionic-apache\<close>. Run
     \<^verbatim>\<open>certbot\<close> interactively and let it operate on the domain
     \<^verbatim>\<open>vcs.example.org\<close>.
@@ -390,7 +390,7 @@
 
 text \<open>
   The @{tool_def phabricator_setup} tool installs a fresh Phabricator instance
-  on Ubuntu 18.04 LTS:
+  on Ubuntu 18.04 or 20.04 LTS:
   @{verbatim [display] \<open>Usage: isabelle phabricator_setup [OPTIONS]
 
   Options are:
@@ -428,9 +428,9 @@
   Option \<^verbatim>\<open>-M:\<close> installs a standard Mercurial release from source --- the one
   that is used by the Phabricator hosting service
   \<^url>\<open>https://admin.phacility.com\<close>. This avoids various problems with the
-  package provided by Ubuntu 18.04. Alternatively, an explicit file path or
-  URL the source archive (\<^verbatim>\<open>.tar.gz\<close>) may be given here. This option is
-  recommended for production use, but it requires to \<^emph>\<open>uninstall\<close> existing
+  package provided by Ubuntu 18.04 or 20.04. Alternatively, an explicit file
+  path or URL the source archive (\<^verbatim>\<open>.tar.gz\<close>) may be given here. This option
+  is recommended for production use, but it requires to \<^emph>\<open>uninstall\<close> existing
   Mercurial packages provided by the operating system.
 
   Option \<^verbatim>\<open>-n\<close> provides an alternative installation name. The default name
--- a/src/Pure/System/linux.scala	Fri Oct 30 21:10:18 2020 +0100
+++ b/src/Pure/System/linux.scala	Fri Oct 30 22:56:15 2020 +0100
@@ -46,6 +46,7 @@
 
     def is_ubuntu: Boolean = id == "Ubuntu"
     def is_ubuntu_18_04: Boolean = is_ubuntu && release == "18.04"
+    def is_ubuntu_20_04: Boolean = is_ubuntu && release == "20.04"
   }
 
 
--- a/src/Pure/Tools/phabricator.scala	Fri Oct 30 21:10:18 2020 +0100
+++ b/src/Pure/Tools/phabricator.scala	Fri Oct 30 22:56:15 2020 +0100
@@ -21,7 +21,7 @@
 
   /* required packages */
 
-  val packages: List[String] =
+  val packages_ubuntu_18_04: List[String] =
     Build_Docker.packages :::
     List(
       // https://secure.phabricator.com/source/phabricator/browse/master/scripts/install/install_ubuntu.sh 15e6e2adea61
@@ -32,6 +32,18 @@
       // mercurial build packages
       "make", "gcc", "python", "python-dev", "python-docutils", "python-pygments", "python-openssl")
 
+  val packages_ubuntu_20_04: List[String] =
+    packages_ubuntu_18_04.map((name: String) =>
+      if (name.startsWith("python")) name.replace("python", "python3") else name)
+
+  def packages: List[String] =
+  {
+    val release = Linux.Release()
+    if (release.is_ubuntu_18_04) packages_ubuntu_18_04
+    else if (release.is_ubuntu_20_04) packages_ubuntu_20_04
+    else error("Bad Linux version: expected Ubuntu 18.04 or 20.04 LTS")
+  }
+
 
   /* global system resources */
 
@@ -557,9 +569,6 @@
 
       val progress = new Console_Progress
 
-      val release = Linux.Release()
-      if (!release.is_ubuntu_18_04) error("Bad Linux version: Ubuntu 18.04 LTS required")
-
       phabricator_setup(options, name = name, root = root, repo = repo,
         package_update = package_update, mercurial_source = mercurial_source, progress = progress)
     })