]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/INotify.pm
remove PVE::Subscription and friends
[pve-common.git] / src / PVE / INotify.pm
index 5f82d7bf42811a07658c1c0324e5e99311713aa1..661eaf1563a056b719f7a6297a8aa82b0608cf31 100644 (file)
@@ -1772,82 +1772,4 @@ sub read_iscsi_initiatorname {
 register_file('initiatorname', "/etc/iscsi/initiatorname.iscsi",
              \&read_iscsi_initiatorname);
 
-sub read_apt_auth {
-    my ($filename, $fd) = @_;
-
-    local $/;
-
-    my $raw = defined($fd) ? <$fd> : '';
-
-    $raw =~ s/^\s+//;
-
-
-    my @tokens = split(/\s+/, $raw);
-
-    my $data = {};
-
-    my $machine;
-    while (defined(my $tok = shift @tokens)) {
-
-       $machine = shift @tokens if $tok eq 'machine';
-       next if !$machine;
-       $data->{$machine} = {} if !$data->{$machine};
-
-       $data->{$machine}->{login} = shift @tokens if $tok eq 'login';
-       $data->{$machine}->{password} = shift @tokens if $tok eq 'password';
-    };
-
-    return $data;
-}
-
-my $format_apt_auth_data = sub {
-    my $data = shift;
-
-    my $raw = '';
-
-    # sort longer entries first, so machine definitions with higher granularity are preferred
-    for my $machine (sort { length($b) <=> length($a) || $a cmp $b} keys %$data) {
-       my $d = $data->{$machine};
-       next if !defined($d); # allow "deleting" set entries
-
-       $raw .= "machine $machine\n";
-       $raw .= " login $d->{login}\n" if $d->{login};
-       $raw .= " password $d->{password}\n" if $d->{password};
-       $raw .= "\n";
-    }
-
-    return $raw;
-};
-
-sub write_apt_auth {
-    my ($filename, $fh, $data) = @_;
-
-    my $raw = $format_apt_auth_data->($data);
-
-    die "write failed: $!" unless print $fh "$raw\n";
-
-    return $data;
-}
-
-sub update_apt_auth {
-    my ($filename, $fh, $data) = @_;
-
-    my $orig = read_apt_auth($filename, $fh);
-
-    foreach my $machine (keys %$data) {
-       $orig->{$machine} = $data->{$machine};
-    }
-
-    return $format_apt_auth_data->($orig);
-}
-
-register_file(
-    'apt-auth',
-    "/etc/apt/auth.conf",
-    \&read_apt_auth,
-    \&write_apt_auth,
-    \&update_apt_auth,
-    perm => 0640,
-);
-
 1;