mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
upgrades: Don't enable backports on Debian derivatives
- Avoid introducing dependency on dpkg-vendor. Tested: - Install a base-files package from Ubuntu. Change /etc/dpkg/origins/default to point to it. Running the setup-repositories action does not create the backports list in apt sources. Closes: #1654. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
ac103d7132
commit
848845c432
@ -184,6 +184,21 @@ def _check_and_backports_sources():
|
||||
print('Repositories list up-to-date. Skipping update.')
|
||||
return
|
||||
|
||||
try:
|
||||
with open('/etc/dpkg/origins/default', 'r') as default_origin:
|
||||
matches = [
|
||||
re.match(r'Vendor:\s+Debian', line, flags=re.IGNORECASE)
|
||||
for line in default_origin.readlines()
|
||||
]
|
||||
except FileNotFoundError:
|
||||
print('Could not open /etc/dpkg/origins/default')
|
||||
return
|
||||
|
||||
if not any(matches):
|
||||
print('System is running a derivative of Debian. Skip enabling '
|
||||
'backports.')
|
||||
return
|
||||
|
||||
protocol = _get_protocol()
|
||||
if protocol == 'tor+http':
|
||||
print('Package download over Tor is enabled.')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user