--- /dev/null
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1
+
+DESCRIPTION="the sysadmin's rolling upgrade tool"
+HOMEPAGE="http://arcdraco.net/checkrestart"
+SRC_URI="http://arcdraco.net/~dragon/${P}-sep.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~x86"
+IUSE=""
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ sys-apps/lsb-release
+ app-portage/portage-utils
+ sys-process/lsof
+"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+S=${WORKDIR}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-list-comprehension-fix.patch
+ epatch "${FILESDIR}"/${P}-cwd.patch
+ python_fix_shebang ${PN}
+}
+
+src_install() {
+ dosbin ${PN}
+}
--- /dev/null
+--- /usr/sbin/checkrestart 2016-02-22 08:08:34.000000000 -0800
++++ /usr/sbin/checkrestarta 2016-02-22 08:19:16.013507231 -0800
+@@ -114,7 +114,7 @@
+ def portage_fQuery(programs, packages):
+
+ dpkgQuery = ["qfile", "-C"] + programs.keys()
+- dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE)
++ dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, cwd='/')
+ for line in dpkgProc.stdout.readlines():
+ packagename, program = line[:-1].split(' ')
+ program = re.match('\((.*)\)', program).group(1)