From d84aceb0853f5918c0cbb5a2ad45b85c5acadbc8 Mon Sep 17 00:00:00 2001 From: Mathieu Jadin Date: Sun, 27 Mar 2022 17:40:59 +0200 Subject: [PATCH] Fetch a working url for mininet setup Github does not allow git:// link anymore. This was fixed by commit c3ba039a but there is no new release of mininet. Thus, we need to use the script of this commit. --- ipmininet/install/install.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ipmininet/install/install.py b/ipmininet/install/install.py index fdf48e85..f6901116 100644 --- a/ipmininet/install/install.py +++ b/ipmininet/install/install.py @@ -12,6 +12,10 @@ LibyangVersion = "v1.0.215" ExaBGPVersion = "4.2.11" +# XXX: We need the explicit script until the following issue is fixed: +# https://github.com/mininet/mininet/issues/1120 +MininetInstallCommit = "c3ba039a9781c6c5f475b7c88ff577185747a1da" + os.environ["PATH"] = "%s:/sbin:/usr/sbin/:/usr/local/sbin" % os.environ["PATH"] @@ -65,10 +69,18 @@ def install_mininet(output_dir: str, pip_install=True): mininet_opts = "-a" sh("git clone https://github.com/mininet/mininet.git", cwd=output_dir) + # Save valid version of mininet install script + sh("git checkout %s" % MininetInstallCommit, + cwd=os.path.join(output_dir, "mininet/util")) + sh("cp install.sh install.tmp.sh", + cwd=os.path.join(output_dir, "mininet/util")) + # Use it in the fixed version of Mininet sh("git checkout %s" % MininetVersion, - cwd=os.path.join(output_dir, "mininet")) - sh("mininet/util/install.sh %s -s ." % mininet_opts, - cwd=output_dir) + cwd=os.path.join(output_dir, "mininet/util")) + sh("mv install.tmp.sh install.sh", + cwd=os.path.join(output_dir, "mininet/util")) + sh("./install.sh %s -s ." % mininet_opts, + cwd=os.path.join(output_dir, "mininet/util")) if pip_install: dist.pip_install("mininet/", cwd=output_dir)