diff options
author | kyechou | 2019-04-09 18:01:49 -0500 |
---|---|---|
committer | kyechou | 2019-04-09 18:01:49 -0500 |
commit | 1bc7d460a9c26c8fcb08805cfa2c3a17354f4c6d (patch) | |
tree | 34d642931550b8e0fe281ba953f6fc4f705ebdce | |
parent | b72291578ea32158bcf7621ead953325b1c61ee0 (diff) | |
download | aur-1bc7d460a9c26c8fcb08805cfa2c3a17354f4c6d.tar.gz |
Update and apply the patch of #815
See https://github.com/mininet/mininet/pull/815
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | 815.patch | 69 | ||||
-rw-r--r-- | PKGBUILD | 60 |
3 files changed, 117 insertions, 37 deletions
@@ -1,25 +1,19 @@ pkgbase = mininet-git pkgdesc = Emulator for rapid prototyping of Software Defined Networks - pkgver = 20180911 + pkgver = 2.3.0d5.r3.g38e1985 pkgrel = 1 url = https://github.com/mininet/mininet install = mininet.install arch = x86_64 license = custom + makedepends = git makedepends = gcc makedepends = make - makedepends = socat - makedepends = psmisc - makedepends = automake makedepends = autoconf + makedepends = automake makedepends = libtool - makedepends = git makedepends = help2man makedepends = python-setuptools - makedepends = python-pyflakes - makedepends = python-pylint - makedepends = autopep8 - makedepends = python-pexpect depends = python depends = iproute2 depends = net-tools @@ -29,14 +23,17 @@ pkgbase = mininet-git depends = ethtool depends = libcgroup depends = openvswitch - optdepends = xorg-xhost - optdepends = xterm - optdepends = openssh - optdepends = oflops + depends = psmisc + optdepends = xorg-xhost: for X11 forwarding + optdepends = socat: for X11 forwarding + optdepends = xterm: terminal emulator for X11 provides = mininet conflicts = mininet - source = git+https://github.com/mininet/mininet.git + replaces = mininet + source = 815.patch + source = mininet-git::git+https://github.com/mininet/mininet.git source = git+https://github.com/mininet/openflow.git + sha256sums = 50e3afe543ac54553383a3c8e98b2a4ff99c58e468e30d7dd3222c8a7a902890 sha256sums = SKIP sha256sums = SKIP diff --git a/815.patch b/815.patch new file mode 100644 index 000000000000..1566c6581b2c --- /dev/null +++ b/815.patch @@ -0,0 +1,69 @@ +From a73e7766952759e7eebb656e553008f07b16a209 Mon Sep 17 00:00:00 2001 +From: Matthieu Coudron <mattator@gmail.com> +Date: Tue, 10 Jul 2018 17:47:49 +0900 +Subject: [PATCH] fix "which" calls always returning true + +The redirection of stderr towards stdout means calls to "which program" +always return something even when "program" is not installed. + +This patch checks for the return value instead before returning the +value. + +See #814. +--- + mininet/node.py | 10 +++++----- + mininet/util.py | 5 +++++ + 2 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/mininet/node.py b/mininet/node.py +index 7429b0b6f..4423cce7c 100644 +--- a/mininet/node.py ++++ b/mininet/node.py +@@ -63,7 +63,7 @@ + from mininet.log import info, error, warn, debug + from mininet.util import ( quietRun, errRun, errFail, moveIntf, isShellBuiltin, + numCores, retry, mountCgroups, BaseString, decode, +- encode, Python3 ) ++ encode, Python3, which ) + from mininet.moduledeps import moduleDeps, pathCheck, TUN + from mininet.link import Link, Intf, TCIntf, OVSIntf + from re import findall +@@ -1447,7 +1447,7 @@ def __repr__( self ): + @classmethod + def isAvailable( cls ): + "Is controller available?" +- return quietRun( 'which controller' ) ++ return which( 'controller' ) + + + class OVSController( Controller ): +@@ -1459,9 +1459,9 @@ def __init__( self, name, **kwargs ): + + @classmethod + def isAvailable( cls ): +- return ( quietRun( 'which ovs-controller' ) or +- quietRun( 'which test-controller' ) or +- quietRun( 'which ovs-testcontroller' ) ).strip() ++ return (which( 'ovs-controller' ) or ++ which( 'test-controller' ) or ++ which( 'ovs-testcontroller' )) + + class NOX( Controller ): + "Controller to run a NOX application." +diff --git a/mininet/util.py b/mininet/util.py +index 18813188f..9ce61db1e 100644 +--- a/mininet/util.py ++++ b/mininet/util.py +@@ -171,6 +171,11 @@ def quietRun( cmd, **kwargs ): + "Run a command and return merged stdout and stderr" + return errRun( cmd, stderr=STDOUT, **kwargs )[ 0 ] + ++def which(cmd, **kwargs ): ++ "Run a command and return merged stdout and stderr" ++ out, _, ret = errRun( ["which", cmd], stderr=STDOUT, **kwargs ) ++ return out.rstrip() if ret == 0 else None ++ + # pylint: enable=maybe-no-member + + def isShellBuiltin( cmd ): + @@ -1,48 +1,62 @@ # Maintainer: Kuan-Yen Chou <kuanyenchou@gmail.com> pkgname=mininet-git -pkgver=20180911 +pkgver=2.3.0d5.r3.g38e1985 pkgrel=1 pkgdesc='Emulator for rapid prototyping of Software Defined Networks' depends=('python' 'iproute2' 'net-tools' 'iputils' 'inetutils' 'iperf' 'ethtool' - 'libcgroup' 'openvswitch') -optdepends=('xorg-xhost' 'xterm' 'openssh' 'oflops') -makedepends=('gcc' 'make' 'socat' 'psmisc' 'automake' 'autoconf' 'libtool' 'git' - 'help2man' 'python-setuptools' 'python-pyflakes' 'python-pylint' - 'autopep8' 'python-pexpect') + 'libcgroup' 'openvswitch' 'psmisc') +optdepends=('xorg-xhost: for X11 forwarding' + 'socat: for X11 forwarding' + 'xterm: terminal emulator for X11') +makedepends=('git' 'gcc' 'make' 'autoconf' 'automake' 'libtool' 'help2man' + 'python-setuptools') arch=('x86_64') url='https://github.com/mininet/mininet' license=('custom') provides=('mininet') conflicts=('mininet') +replaces=('mininet') install='mininet.install' -source=('git+https://github.com/mininet/mininet.git' - 'git+https://github.com/mininet/openflow.git') -sha256sums=('SKIP' +source=('815.patch' + "$pkgname"::'git+https://github.com/mininet/mininet.git' + 'git+https://github.com/mininet/openflow.git') # for the UserSwitch +sha256sums=('50e3afe543ac54553383a3c8e98b2a4ff99c58e468e30d7dd3222c8a7a902890' + 'SKIP' 'SKIP') +pkgver() { + cd "$srcdir/$pkgname" + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + prepare() { - cd "$srcdir/openflow" - sed '/^include debian\/automake.mk/d' -i Makefile.am + cd "$srcdir/openflow" + sed '/^include debian\/automake.mk/d' -i Makefile.am - cd "$srcdir/mininet" - sed 's:PREFIX ?= /usr:PREFIX ?= "$(DESTDIR)"/usr:' -i Makefile - sed 's:$(PYTHON) setup.py install:$(PYTHON) setup.py install --prefix=/usr --root="$(DESTDIR)" --optimize=1:' -i Makefile + cd "$srcdir/$pkgname" + git am "$srcdir/815.patch" + sed 's:PREFIX ?= /usr:PREFIX ?= "$(DESTDIR)"/usr:' -i Makefile + sed 's:$(PYTHON) setup.py install:$(PYTHON) setup.py install --prefix=/usr --root="$(DESTDIR)" --optimize=1:' -i Makefile } build() { - cd "$srcdir/openflow" - autoreconf --install --force - ./configure --prefix=/usr --sbindir=/usr/bin - make + cd "$srcdir/openflow" + autoreconf --install --force + ./configure --prefix=/usr --sbindir=/usr/bin + make + + cd "$srcdir/$pkgname" + make mnexec man } package() { - cd "$srcdir/openflow" - make DESTDIR="${pkgdir}" install + cd "$srcdir/openflow" + make DESTDIR="${pkgdir}" install - cd "$srcdir/mininet" - make DESTDIR="${pkgdir}" install + cd "$srcdir/$pkgname" + make DESTDIR="${pkgdir}" install + install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/mininet/LICENSE" } -# vim: set sw=8 ts=8 et: +# vim: set sw=4 ts=4 et: |