doesnt randomly error even if package is not in overrides and prints proper package when adding to database

i18n
Amy 3 years ago
parent 94af1ffe75
commit 9537dee253
No known key found for this signature in database
GPG Key ID: 6672E6DD65BEA50B

@ -100,7 +100,7 @@ pub fn add_pkg(from_repo: bool, pkgs: &[&str]) {
package_name = res.name.clone(); package_name = res.name.clone();
package_version = res.version.clone(); package_version = res.version.clone();
} }
if !from_repo { if !from_repo{
let result = connection.execute(format!( let result = connection.execute(format!(
" "
INSERT INTO pkgs (name, version) VALUES (\"{}\", \"{}\"); INSERT INTO pkgs (name, version) VALUES (\"{}\", \"{}\");
@ -119,8 +119,8 @@ pub fn add_pkg(from_repo: bool, pkgs: &[&str]) {
pkg, "from_repo" pkg, "from_repo"
)); ));
match result { match result {
Ok(_) => inf(format!("Added {} to database", package_name)), Ok(_) => inf(format!("Added {} to database", pkg)),
Err(_) => err_unrec(format!("Couldn't add {} to database", package_name)), Err(_) => err_unrec(format!("Couldn't add {} to database", pkg)),
} }
} }
} }

@ -46,7 +46,9 @@ pub fn uninstall(noconfirm: bool, pkgs: Vec<String>) {
} }
} }
} }
err_unrec(format!("The action you called for tries to uninstall packages: {} . This is disallowed by default as these are important system packages. If you fully know what you are doing and would like to uninstall these, please create an override in /etc/ame/overrides.conf.", matches.join(" "))); if !matches.is_empty() {
err_unrec(format!("The action you called for tries to uninstall packages: {} . This is disallowed by default as these are important system packages. If you fully know what you are doing and would like to uninstall these, please create an override in /etc/ame/overrides.conf.", matches.join(" ")));
}
if noconfirm { if noconfirm {
let result = Command::new("pacman") let result = Command::new("pacman")

Loading…
Cancel
Save