PackageInfo: apt-file returns exit code 1 on nothing found now.

This commit is contained in:
Krytarik Raido 2021-06-16 21:04:04 +02:00
parent e3614f3256
commit 5cc19abfcc
2 changed files with 4 additions and 2 deletions

View File

@ -22,7 +22,7 @@ import supybot
import supybot.world as world
from importlib import reload
__version__ = "2.2.0"
__version__ = "2.3.0"
__author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@gmail.com")
__contributors__ = {
supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Concept'],

View File

@ -86,7 +86,9 @@ class Apt:
if filelookup:
try:
data = self.apt_file(distro, pkg).split()
except subprocess.CalledProcessError:
except subprocess.CalledProcessError as e:
if e.returncode == 1:
return 'Package/file %s does not exist in %s' % (pkg, distro)
self.log.error("PackageInfo/packages: Please update the cache for %s" % distro)
return "Cache out of date, please contact the administrator"
except OSError: