aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qarepo.pl13
1 files changed, 8 insertions, 5 deletions
diff --git a/qarepo.pl b/qarepo.pl
index 5ce5714..6444253 100644
--- a/qarepo.pl
+++ b/qarepo.pl
@@ -46,8 +46,8 @@ my $state;
my $home = $ENV{HOME} || './';
-# Only use sudo if not run by root.
-my $sudo = $> ? 'sudo' : '';
+# Only use pkexec if not run by root.
+my $pkexec = $> ? 'pkexec' : '';
my %config;
@@ -426,7 +426,8 @@ sub get_existing_rpms {
}
sub disable_repo {
- if (system("$sudo urpmi.removemedia '$qa_repo_name'") == 0) {
+ my $arch_type = $arch eq 'x86_64' ? '64' : '32';
+ if (system("$pkexec /usr/libexec/qarepo-helper disable $arch_type") == 0) {
$active_qa_repo = '';
} else {
my $message = "couldn't disable the $qa_repo_name media";
@@ -436,7 +437,8 @@ sub disable_repo {
}
sub enable_repo {
- if (system("$sudo urpmi.addmedia --update '$qa_repo_name' $qa_repo/$arch") == 0) {
+ my $arch_type = $arch eq 'x86_64' ? '64' : '32';
+ if (system("$pkexec /usr/libexec/qarepo-helper enable $arch_type $qa_repo/$arch") == 0) {
$active_qa_repo = $qa_repo;
} else {
my $message = "couldn't enable the $qa_repo_name media";
@@ -447,7 +449,8 @@ sub enable_repo {
}
sub update_repo {
- if (system("$sudo urpmi.update '$qa_repo_name'") != 0) {
+ my $arch_type = $arch eq 'x86_64' ? '64' : '32';
+ if (system("$pkexec /usr/libexec/qarepo-helper update $arch_type") != 0) {
my $message = "couldn't update the $qa_repo_name media";
show_error_dialogue($message);
print_error($message);