Ignore:
Timestamp:
Jan 18, 2013 10:06:54 AM (12 years ago)
Author:
Ted Faber <faber@…>
Branches:
master
Children:
8f654de
Parents:
950b55e
Message:

Fix fedkit to work on Ubuntu 12.04

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedkit/gateway_lib.pm

    r950b55e r5e71d34  
    4444    $t = new File::Temp() || die "Can't open tempfile: $!\n";
    4545
     46    # If the parameter is in the file (even in a comment) update the line to
     47    # have the new parameter.
     48    my %updated;
    4649    while (<$f>) {
    4750        foreach my $k (keys %{$keys}) {
    48             s/^\s*#?\s*$k.*/$k $keys->{$k}/;
     51            if (s/^\s*#?\s*$k.*/$k $keys->{$k}/) { $updated{$k}++; }
    4952        }
    5053        print $t $_;
     54    }
     55    # Any parameters not found above are output directly.
     56    foreach my $k (keys %{$keys}) {
     57        print $t "$k " . $keys->{$k} . "\n" unless $updated{$k};
    5158    }
    5259    $f->close();
Note: See TracChangeset for help on using the changeset viewer.