Raise DistroUnsupported for unsupported distros
This commit is contained in:
7
pkgsync
7
pkgsync
@@ -535,6 +535,8 @@ def list_packages(distro):
|
||||
raise HistoryFileNotFoundError()
|
||||
elif distro in DEB_FAMILY:
|
||||
packages = list_packages_dpkg()
|
||||
else:
|
||||
raise DistroUnsupported(distro)
|
||||
|
||||
return packages
|
||||
|
||||
@@ -559,7 +561,8 @@ def package_full(d, distro):
|
||||
if release:
|
||||
package.extend(['-', release])
|
||||
return ''.join(package)
|
||||
return '{name}'.format(**d) # need a better default
|
||||
raise DistroUnsupported(distro)
|
||||
|
||||
|
||||
|
||||
def package_name(d, distro):
|
||||
@@ -568,7 +571,7 @@ def package_name(d, distro):
|
||||
return '{name}.{arch}'.format(**d)
|
||||
elif distro in DEB_FAMILY:
|
||||
return '{name}:{arch}'.format(**d)
|
||||
return '{name}'.format(**d)
|
||||
raise DistroUnsupported(distro)
|
||||
|
||||
|
||||
def is_valid_input(d):
|
||||
|
||||
Reference in New Issue
Block a user