This commit is contained in:
Spitap
2023-10-15 12:22:57 +02:00
committed by Antoine Nguyen
parent 6771ea0028
commit e7e5dce778
2 changed files with 5 additions and 1 deletions

View File

@@ -2,6 +2,8 @@
import re
from os.path import isfile as file_exists
from . import utils
@@ -68,7 +70,8 @@ class DEBPackage(Package):
f"{url} {codename} main"
)
target_file = f"/etc/apt/source.list.d/{name}.list"
utils.exec_cmd(f'echo "{line} | sude tee {target_file}')
tee_option = "-a" if file_exists(target_file) else ""
utils.exec_cmd(f'echo "{line}" | sude tee {tee_option} {target_file}')
self.index_updated = False
def update(self):