Compare commits
2 Commits
6ab9b48579
...
1b2ecf10fd
Author | SHA1 | Date | |
---|---|---|---|
|
1b2ecf10fd | ||
|
db5dd9a843 |
7
data/move_repo.sh
Normal file
7
data/move_repo.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#! /bin/bash
|
||||
if [[ "$1" == "deb822" ]]
|
||||
then
|
||||
mv -vf "/tmp/"$2".sources" "/etc/apt/sources.list.d/"$2".sources"
|
||||
else
|
||||
mv -vf "/tmp/"$2".list" "/etc/apt/sources.list.d/"$2".list"
|
||||
fi
|
@ -117,6 +117,7 @@ pub fn apt_manage_page(
|
||||
}
|
||||
|
||||
for deb822_source in unofficial_deb822_sources {
|
||||
dbg!(&deb822_source);
|
||||
unofficial_sources_list_store.append(&BoxedAnyObject::new(AptSourceConfig::DEB822(deb822_source)));
|
||||
};
|
||||
|
||||
@ -615,10 +616,38 @@ pub fn apt_manage_page(
|
||||
..Default::default()
|
||||
};
|
||||
if sign_method == 2 {
|
||||
let key_download_cmd = duct::cmd!("pkexec", "/usr/lib/pika/pikman-update-manager/scripts/wget.sh", &unofficial_source_add_signed_entry.text().to_string(), &format!("/etc/apt/keyrings/{}.gpg.key", repo_file_name))
|
||||
.run();
|
||||
match key_download_cmd {
|
||||
Ok(_) => {}
|
||||
match duct::cmd!("pkexec", "/usr/lib/pika/pikman-update-manager/scripts/wget.sh", &unofficial_source_add_signed_entry.text().to_string(), &format!("/etc/apt/keyrings/{}.gpg.key", repo_file_name)).run() {
|
||||
Ok(_) => {
|
||||
match Deb822Repository::write_to_file(new_repo.clone(), format!("/tmp/{}.sources", repo_file_name).into()) {
|
||||
Ok(_) => {
|
||||
match duct::cmd!("pkexec", "/usr/lib/pika/pikman-update-manager/scripts/move_repo.sh", "deb822", repo_file_name).run() {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
let apt_src_create_error_dialog = adw::MessageDialog::builder()
|
||||
.heading(t!("apt_src_create_error_dialog_heading"))
|
||||
.body(e.to_string())
|
||||
.build();
|
||||
apt_src_create_error_dialog.add_response(
|
||||
"apt_src_create_error_dialog_ok",
|
||||
&t!("apt_src_create_error_dialog_ok_label").to_string(),
|
||||
);
|
||||
apt_src_create_error_dialog.present();
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
let apt_src_create_error_dialog = adw::MessageDialog::builder()
|
||||
.heading(t!("apt_src_create_error_dialog_heading"))
|
||||
.body(e.to_string())
|
||||
.build();
|
||||
apt_src_create_error_dialog.add_response(
|
||||
"apt_src_create_error_dialog_ok",
|
||||
&t!("apt_src_create_error_dialog_ok_label").to_string(),
|
||||
);
|
||||
apt_src_create_error_dialog.present();
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
let key_download_error_dialog = adw::MessageDialog::builder()
|
||||
.heading(t!("key_download_error_dialog_heading"))
|
||||
@ -631,6 +660,36 @@ pub fn apt_manage_page(
|
||||
key_download_error_dialog.present();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
match Deb822Repository::write_to_file(new_repo.clone(), format!("/tmp/{}.sources", repo_file_name).into()) {
|
||||
Ok(_) => {
|
||||
match duct::cmd!("pkexec", "/usr/lib/pika/pikman-update-manager/scripts/move_repo.sh", "deb822", repo_file_name).run() {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
let apt_src_create_error_dialog = adw::MessageDialog::builder()
|
||||
.heading(t!("apt_src_create_error_dialog_heading"))
|
||||
.body(e.to_string())
|
||||
.build();
|
||||
apt_src_create_error_dialog.add_response(
|
||||
"apt_src_create_error_dialog_ok",
|
||||
&t!("apt_src_create_error_dialog_ok_label").to_string(),
|
||||
);
|
||||
apt_src_create_error_dialog.present();
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
let apt_src_create_error_dialog = adw::MessageDialog::builder()
|
||||
.heading(t!("apt_src_create_error_dialog_heading"))
|
||||
.body(e.to_string())
|
||||
.build();
|
||||
apt_src_create_error_dialog.add_response(
|
||||
"apt_src_create_error_dialog_ok",
|
||||
&t!("apt_src_create_error_dialog_ok_label").to_string(),
|
||||
);
|
||||
apt_src_create_error_dialog.present();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"apt_update_dialog_ignore" => {
|
||||
|
Loading…
Reference in New Issue
Block a user