mirror of
https://github.com/fspc/dswim.git
synced 2025-02-22 08:33:24 -05:00
Makes sure these programs do backups for info in the right place.
This commit is contained in:
parent
948c04b550
commit
4fc38f64a1
@ -47,7 +47,6 @@ my $temp;
|
|||||||
my %HL;
|
my %HL;
|
||||||
my @name;
|
my @name;
|
||||||
my %version;
|
my %version;
|
||||||
my $home = $ENV{'HOME'} . "/";
|
|
||||||
|
|
||||||
#$| = 1;
|
#$| = 1;
|
||||||
#$#name = 2000;
|
#$#name = 2000;
|
||||||
@ -115,9 +114,10 @@ my $home = $ENV{'HOME'} . "/";
|
|||||||
# humm let's rebuild the offending backup list, this
|
# humm let's rebuild the offending backup list, this
|
||||||
# is important for --db.
|
# is important for --db.
|
||||||
unshift(@redolist,"/.");
|
unshift(@redolist,"/.");
|
||||||
open(REDOLIST, ">$home$ARGV[1]/backup/$thingy.bk.bk")
|
open(REDOLIST, ">$ARGV[3]/$ARGV[1]/backup/$thingy.bk.bk")
|
||||||
or warn "needed to edit $thingy because it lacked /.,
|
or warn "needed to edit $thingy because it lacked /.,
|
||||||
but could not open up a backup file\n";
|
but could not open up a backup file
|
||||||
|
$ARGV[3]/$ARGV[1]/backup/$thingy.bk.bk\n";
|
||||||
my $rd;
|
my $rd;
|
||||||
foreach $rd (@redolist) {
|
foreach $rd (@redolist) {
|
||||||
chomp $rd;
|
chomp $rd;
|
||||||
@ -125,7 +125,7 @@ my $home = $ENV{'HOME'} . "/";
|
|||||||
}
|
}
|
||||||
close(REDOLIST);
|
close(REDOLIST);
|
||||||
rename
|
rename
|
||||||
("$ARGV[1]/backup/$thingy.bk.bk","$ARGV[1]/backup/$thingy.bk");
|
("$ARGV[3]/$ARGV[1]/backup/$thingy.bk.bk","$ARGV[3]/$ARGV[1]/backup/$thingy.bk");
|
||||||
$_ = "/.";
|
$_ = "/.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
bin/imswim
10
bin/imswim
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
#use diagnostics;
|
|
||||||
require 5.004;
|
require 5.004;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
@ -48,8 +48,6 @@ line.
|
|||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
my $home = $ENV{'HOME'} . "/";
|
|
||||||
|
|
||||||
if ($#ARGV == -1) {
|
if ($#ARGV == -1) {
|
||||||
print STDERR "swim: imswim requires arguments, see program for instructions\n";
|
print STDERR "swim: imswim requires arguments, see program for instructions\n";
|
||||||
exit;
|
exit;
|
||||||
@ -84,7 +82,7 @@ line.
|
|||||||
# humm let's rebuild the offending backup list, this
|
# humm let's rebuild the offending backup list, this
|
||||||
# is important for --db.
|
# is important for --db.
|
||||||
unshift(@redolist,"/.");
|
unshift(@redolist,"/.");
|
||||||
open(REDOLIST, ">$home$ARGV[0]/backup/$the[0].list.bk.bk")
|
open(REDOLIST, ">$ARGV[2]/$ARGV[0]/backup/$the[0].list.bk.bk")
|
||||||
or warn "needed to edit $the[0].list because it lacked /.,
|
or warn "needed to edit $the[0].list because it lacked /.,
|
||||||
but could not open up a backup file\n";
|
but could not open up a backup file\n";
|
||||||
my $rd;
|
my $rd;
|
||||||
@ -93,8 +91,8 @@ line.
|
|||||||
print REDOLIST "$rd\n";
|
print REDOLIST "$rd\n";
|
||||||
}
|
}
|
||||||
close(REDOLIST);
|
close(REDOLIST);
|
||||||
rename("$ARGV[0]/backup/$the[0].list.bk.bk",
|
rename("$ARGV[2]/$ARGV[0]/backup/$the[0].list.bk.bk",
|
||||||
"$ARGV[0]/backup/$the[0].list.bk");
|
"$ARGV[2]/$ARGV[0]/backup/$the[0].list.bk");
|
||||||
$_ = "/.";
|
$_ = "/.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user