Support extra flags for package installer

This commit is contained in:
heliguy4599
2024-10-10 22:59:48 -04:00
parent 30d6042e56
commit 12b9483362
3 changed files with 4 additions and 1 deletions

View File

@@ -50,6 +50,7 @@ class AttemptInstallDialog(Adw.AlertDialog):
"remote": row.remote_name,
"installation": row.remote_installation,
"package_names": self.package_names,
"extra_flags": [],
}])
elif not self.callback is None:
self.callback(False)

View File

@@ -45,6 +45,7 @@ class SelectPage(Adw.NavigationPage):
"remote": "local_file",
"installation": installation,
"package_names": [file.get_path()],
"extra_flags": [],
})
install_page.install_packages(requests)

View File

@@ -8,6 +8,7 @@ class PackageInstallWorker:
"remote": "<remote name>" or "local_file",
"installation": "<installation name>",
"package_names": ["<pkg id 1>", "<pkg id 2>", ...],
"extra_flags": ["<flag 1>", "<flag 2>", ...],
},
{
...
@@ -56,7 +57,7 @@ class PackageInstallWorker:
if group['remote'] != "local_file":
cmd.append(group['remote'])
cmd += [real_installation] + group['package_names']
cmd += [real_installation] + group['package_names'] + group['extra_flags']
this.process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
percent_pattern = r'\d{1,3}%'
amount_pattern = r'(\d+)/(\d+)'