diff --git a/docs/usage.rst b/docs/usage.rst index 03772aa..73f6503 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -621,7 +621,7 @@ This enables you to track the update of an arbitary APT repository, without need pkg Name of the APT binary package. -source_pkg +srcpkg Name of the APT source package. mirror @@ -639,7 +639,7 @@ arch strip_release Strip the release part. -Note that either pkg or source_pkg needs to be specified (but not both) or the item name will be used as package. +Note that either pkg or srcpkg needs to be specified (but not both) or the item name will be used as pkg. Manually updating ~~~~~~~~~~~~~~~~~ diff --git a/nvchecker_source/apt.py b/nvchecker_source/apt.py index 20d40c4..b03bba9 100644 --- a/nvchecker_source/apt.py +++ b/nvchecker_source/apt.py @@ -22,7 +22,7 @@ async def get_url(url): return data.decode('utf-8') async def get_version(name, conf, *, cache, **kwargs): - source_pkg = conf.get('source_pkg') + srcpkg = conf.get('srcpkg') pkg = conf.get('pkg') mirror = conf.get('mirror', "http://deb.debian.org/debian/") suite = conf.get('suite', 'sid') @@ -30,9 +30,9 @@ async def get_version(name, conf, *, cache, **kwargs): arch = conf.get('arch', 'amd64') strip_release = conf.get('strip_release', False) - if source_pkg and pkg: - raise GetVersionError('Setting both source_pkg and pkg is ambigious') - elif not source_pkg and not pkg: + if srcpkg and pkg: + raise GetVersionError('Setting both srcpkg and pkg is ambigious') + elif not srcpkg and not pkg: pkg = name apt_release = await cache.get(APT_RELEASE_URL % (mirror, suite), get_url) @@ -49,7 +49,7 @@ async def get_version(name, conf, *, cache, **kwargs): for line in apt_packages.split("\n"): if pkg and line == "Package: " + pkg: pkg_found = True - if source_pkg and line == "Source: " + source_pkg: + if srcpkg and line == "Source: " + srcpkg: pkg_found = True if pkg_found and line.startswith("Version: "): version = line[9:]