mirror of
https://github.com/fspc/dswim.git
synced 2025-02-22 16:43:23 -05:00
Added more STDERR to print, which is important to make debconf happy ..
plus is nice when doing a less.
This commit is contained in:
parent
43fe9b20bf
commit
d9c40d068b
45
SWIM/DB.pm
45
SWIM/DB.pm
@ -89,7 +89,7 @@ sub db {
|
|||||||
|
|
||||||
dbi(\%commands); ib(\%commands); sb(\%commands);
|
dbi(\%commands); ib(\%commands); sb(\%commands);
|
||||||
# Check differences now.
|
# Check differences now.
|
||||||
print "checking for new, changed, and removed packages\n";
|
print STDERR "checking for new, changed, and removed packages\n";
|
||||||
if (($commands->{"dbpath"} && $commands->{"root"}) ||
|
if (($commands->{"dbpath"} && $commands->{"root"}) ||
|
||||||
($commands->{"dbpath"} && !$commands->{"root"}) ||
|
($commands->{"dbpath"} && !$commands->{"root"}) ||
|
||||||
(!$commands->{"dbpath"} && !$commands->{"root"})) {
|
(!$commands->{"dbpath"} && !$commands->{"root"})) {
|
||||||
@ -180,21 +180,21 @@ sub db {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "swim: missing important database\n"; return "missing";
|
print STDERR "swim: missing important database\n"; return "missing";
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (@GONE) {
|
foreach (@GONE) {
|
||||||
print "GONE $_\n";
|
print STDERR "GONE $_\n";
|
||||||
}
|
}
|
||||||
foreach (@CHANGED) {
|
foreach (@CHANGED) {
|
||||||
print "CHANGED $_\n";
|
print STDERR "CHANGED $_\n";
|
||||||
}
|
}
|
||||||
foreach (@changed_packages) {
|
foreach (@changed_packages) {
|
||||||
push(@CHANGED,$_);
|
push(@CHANGED,$_);
|
||||||
print "CHANGED STATUS $_\n";
|
print STDERR "CHANGED STATUS $_\n";
|
||||||
}
|
}
|
||||||
foreach (@NEW) {
|
foreach (@NEW) {
|
||||||
print "NEW $_\n";
|
print STDERR "NEW $_\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $new=$#NEW + 1; my $cr=$#changed_packages + 1;
|
my $new=$#NEW + 1; my $cr=$#changed_packages + 1;
|
||||||
@ -202,14 +202,14 @@ sub db {
|
|||||||
|
|
||||||
|
|
||||||
if ($commands->{"check"}) {
|
if ($commands->{"check"}) {
|
||||||
print "\n TOTAL\n -----\n";
|
print STDERR "\n TOTAL\n -----\n";
|
||||||
print "NEW $new\n"; print "GONE $gon\n";
|
print STDERR "NEW $new\n"; print "GONE $gon\n";
|
||||||
print "CHANGED $ch\n"; print "CHANGED STATUS $cr\n";
|
print STDERR "CHANGED $ch\n"; print "CHANGED STATUS $cr\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
print "\n TOTAL\n -----\n";
|
print STDERR "\n TOTAL\n -----\n";
|
||||||
print "NEW $new\n"; print "GONE $gon\n";
|
print STDERR "NEW $new\n"; print "GONE $gon\n";
|
||||||
print "CHANGED $ch\n"; print "CHANGED STATUS $cr\n";
|
print STDERR "CHANGED $ch\n"; print "CHANGED STATUS $cr\n";
|
||||||
|
|
||||||
|
|
||||||
@GONE = (@GONE,@CHANGED);
|
@GONE = (@GONE,@CHANGED);
|
||||||
@ -291,7 +291,7 @@ sub db {
|
|||||||
|
|
||||||
$| = 1; my $x = 1;
|
$| = 1; my $x = 1;
|
||||||
foreach (@GONE) {
|
foreach (@GONE) {
|
||||||
print "G|C|CS $x $_.list\r";
|
print STDERR "G|C|CS $x $_.list\r";
|
||||||
$x++;
|
$x++;
|
||||||
#first delete keys from package.deb
|
#first delete keys from package.deb
|
||||||
# If I kept this the name_version would be remembered.
|
# If I kept this the name_version would be remembered.
|
||||||
@ -399,7 +399,7 @@ sub db {
|
|||||||
|
|
||||||
} # end foreach OLD
|
} # end foreach OLD
|
||||||
|
|
||||||
print "\n" if $#GONE != -1 && $#NEW == -1;
|
print STDERR "\n" if $#GONE != -1 && $#NEW == -1;
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# #
|
# #
|
||||||
@ -410,12 +410,12 @@ sub db {
|
|||||||
$the_status = "$parent$base/status";
|
$the_status = "$parent$base/status";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "swim: crucial file(s)/directories are missing in $parent\n";
|
print STDERR "swim: crucial file(s)/directories are missing in $parent\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
my %exacts;
|
my %exacts;
|
||||||
my $goon;
|
my $goon;
|
||||||
print "\n" if $#NEW != -1; $x = 1;
|
print STDERR "\n" if $#NEW != -1; $x = 1;
|
||||||
foreach (@NEW) {
|
foreach (@NEW) {
|
||||||
$exacts{$_} = "yes";
|
$exacts{$_} = "yes";
|
||||||
}
|
}
|
||||||
@ -434,7 +434,7 @@ sub db {
|
|||||||
@package = split(/: /,$_);
|
@package = split(/: /,$_);
|
||||||
chomp $package[1];
|
chomp $package[1];
|
||||||
if (defined $exacts{$package[1]}) {
|
if (defined $exacts{$package[1]}) {
|
||||||
print "N|C|CS $x\r"; $x++;
|
print STDERR "N|C|CS $x\r"; $x++;
|
||||||
$goon = "yes";
|
$goon = "yes";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -794,7 +794,7 @@ sub db {
|
|||||||
if (!-d "$parent$base/info/backup") {
|
if (!-d "$parent$base/info/backup") {
|
||||||
mkdir("$parent$base/info/backup",0666);
|
mkdir("$parent$base/info/backup",0666);
|
||||||
}
|
}
|
||||||
print "\n" if $#NEW != -1; $x = 1;
|
print STDERR "\n" if $#NEW != -1; $x = 1;
|
||||||
|
|
||||||
foreach $package_name (@NEW) {
|
foreach $package_name (@NEW) {
|
||||||
open(FILENAME,"$parent$base/info/$package_name.list");
|
open(FILENAME,"$parent$base/info/$package_name.list");
|
||||||
@ -806,7 +806,7 @@ sub db {
|
|||||||
close(CP);
|
close(CP);
|
||||||
|
|
||||||
my $file = "$parent$base/info/backup/$package_name.list.bk";
|
my $file = "$parent$base/info/backup/$package_name.list.bk";
|
||||||
print "#$x"; print " N|C $package_name.list \r";
|
print STDERR "#$x"; print STDERR " N|C $package_name.list \r";
|
||||||
$x++;
|
$x++;
|
||||||
open(LIST,"$file");
|
open(LIST,"$file");
|
||||||
while (<LIST>) {
|
while (<LIST>) {
|
||||||
@ -867,7 +867,7 @@ sub db {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} # end foreach NEW
|
} # end foreach NEW
|
||||||
print "\n" if $#NEW != -1;
|
print STDERR "\n" if $#NEW != -1;
|
||||||
|
|
||||||
} # end sub db
|
} # end sub db
|
||||||
|
|
||||||
@ -901,7 +901,7 @@ sub rebuildflatdb {
|
|||||||
unlink("$dir.gz") if -e "$dir.gz";
|
unlink("$dir.gz") if -e "$dir.gz";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "swim: operation only implemented for installed system\n";
|
print STDERR "swim: operation only implemented for installed system\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -915,12 +915,11 @@ sub rebuildflatdb {
|
|||||||
unlink("$dir.gz") if -e "$dir.gz";
|
unlink("$dir.gz") if -e "$dir.gz";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "swim: operation only implemented for installed system\n";
|
print STDERR "swim: operation only implemented for installed system\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open(DIR,">$dir");
|
open(DIR,">$dir");
|
||||||
open(FILE,">$file");
|
open(FILE,">$file");
|
||||||
# We need to reconstruct long.debian & DEBIAN*, but can't take into account
|
# We need to reconstruct long.debian & DEBIAN*, but can't take into account
|
||||||
|
Loading…
x
Reference in New Issue
Block a user