Short question: see subject.
Long:
I am new to fink packaging, and it took me 2 years to sort out (I
hope!) dependencies for "solfege". The problem was the following.
In the process of checking/satisfying dependencies for a new package,
it is often needed to try and install package foo, which installs
bar1, bar2, ... barN, with as large as 123 when you start from
scratch. If it doesn't help, you remove 'foo', leaving the bars
installed. And in fact, a denpendency on 'bar3' is needed in the
end, but you fail to see it because you forgot it was installed
automatically.
Hence the question: how do I undo a particular install? The only way
I found is
1) "save" the current fink status before the install with
$ dpkg --get-selections > saved.sels
2) $ fink install foo
3) grep/diff the resulting selections to form an unsinstall command
like in the tentative script below
(anyone knows how to get interactive commands into a perl script?)
whose output can be pasted on the command line.
This worked for me, but I can't imagine someone has not come out with
a simpler solution to this probably common problem. And there might
be loopholes.
Sincerely,
Jean Orloff
#!/usr/bin/perl
# Version 0.1
$help1=<<'END_HELP';
Usage: finkback2sels starting.sels
DESCRIPTION
Weak attempt to implementing an "undo" for fink install.
Before installing packages you might want to uninstall, do
$ dpkg --get-selections > starting.sels
to get a list of installed packages before your new install. This
should be like a
"Save" for your fink system.
When you are done playing with fink for installing (or removing?)
packages,
$ finkback2sels starting.sels
is supposed to bring you back where you started.
END_HELP
$startfile=shift @ARGV || die $help1;
$purge_command="fink purge ";
$install_command="fink install ";
open STARTFILE, "dpkg --get-selections | diff -w - $startfile |";
while (<STARTFILE>){
if (/^< (\S*)\s*install/) {
$purge_command.= "\\\n$1 ";
} elsif (/> (\S*)\s*install/) {
$install_command.= "\\\n$1 ";
};
}
close STARTFILE;
print "Should now run:\n$purge_command\n";
#Following fails: you need to have interactive cli...
#`$purge_command`;
print "These are now the differences with the original state:\n";
`dpkg --get-selections | diff -w - $startfile`;
print "Maybe you want to manually run: \n$install_command\n";
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Fink-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-devel