apparmor/apparmor-remove-repo

57 lines
1.7 KiB
Plaintext

From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor-utils: Allow repository to be completely disabled
This patch allows the repository to be completely disabled. It's been
subject to massive bitrot and isn't really maintained.
It will only confuse the user if they are asked for repository information
and it doesn't work.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
utils/SubDomain.pm | 5 +++++
utils/logprof.conf | 4 ++++
2 files changed, 9 insertions(+)
--- a/utils/SubDomain.pm
+++ b/utils/SubDomain.pm
@@ -3107,6 +3107,8 @@ sub UI_repo_signup {
sub UI_ask_to_enable_repo {
my $q = { };
+ return if (defined $cfg->{settings}{allow_repository} &&
+ $cfg->{settings}{allow_repository} eq "no");
return if ( not defined $cfg->{repository}{url} );
$q->{headers} = [
gettext("Repository"), $cfg->{repository}{url},
@@ -3231,6 +3233,8 @@ sub get_preferred_user ($) {
sub repo_is_enabled () {
my $enabled;
+ return 0 if defined($cfg->{settings}{allow_repository}) &&
+ $cfg->{settings}{allow_repository} eq "no";
if ($cfg->{repository}{url} &&
$repo_cfg &&
$repo_cfg->{repository}{enabled} &&
@@ -3244,6 +3248,7 @@ sub repo_is_enabled () {
sub update_repo_profile {
my $profile = shift;
+ return undef if not repo_is_enabled();
return undef if ( not is_repo_profile($profile) );
my $distro = $cfg->{repository}{distro};
my $url = $profile->{repo}{url};
--- a/utils/logprof.conf
+++ b/utils/logprof.conf
@@ -35,6 +35,10 @@
# files.
custom_includes =
+ # whether to prompt to enable repositories (values: yes/no)
+ # This feature has fallen to bitrot and should not be used.
+ allow_repository = no
+
[repository]
distro = ubuntu-intrepid