Re: text login as default?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> "RRS" == Ritesh Raj Sarraf <riteshsarraf@xxxxxxxxxxxxxxxxxxxxx> writes:

RRS> Coming from the Debian world I wanted to ask one
RRS> question. Doesn't the FC package manager allow you to have a look
RRS> at the diff of your present config and the newconfig before the
RRS> packages' installation?

That would be somewhat antithetical to the concept of automatic
updates, wouldn't it?

I put this in ~/bin/rpmchanges and run it when I want to see what's
changed.  I was trying to copy functionality I found useful in IRIX.

 - J<

#!/usr/bin/perl
use Getopt::Std;
getopts('dq');

$| = 1;
@DIFF = qw(/usr/bin/diff -u);
@LS   = qw(/bin/ls -l);

@configfiles = `rpm -qac`;

for $i (@configfiles) {
  chomp $i;
  $old = -f "$i.rpmsave";
  $new = -f "$i.rpmnew";
  if ($old || $new) {

    # If running quietly, we can just exit the first time we see a difference
    if ($opt_q) {
      exit 1;
    }

    $package = `rpm -qf $i`;
    chomp $package;

    push @{$updates{$package}}, {file => $i,
				 old  => $old,
				 new  => $new,
				};
  }
}

exit 0 unless %updates;

for $package (sort keys %updates) {
  print "Updated files in package $package:\n";

  for $i (@{$updates{$package}}) {
    if ($i->{old}) {
      show ($i->{file}, "$i->{file}.rpmsave");
    }
    if ($i->{new}) {
      show ($i->{file}, "$i->{file}.rpmnew");
    }
  }
  print "\n";
}

exit 1;

sub show {
  my($old, $new) = @_;

  print "    " if $opt_d;
  system(@LS, $old);
  print "    " if $opt_d;
  system(@LS, $new);

  if ($opt_d) {
    print "Differences:\n", "="x40, "\n";
    system(@DIFF, $old, $new);
    print "="x40, "\n";
  }
}



[Index of Archives]     [Fedora Desktop]     [Fedora SELinux]     [Photo Sharing]     [Yosemite Forum]     [KDE Users]