summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakbackup
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/drakbackup')
-rwxr-xr-xperl-install/standalone/drakbackup33
1 files changed, 28 insertions, 5 deletions
diff --git a/perl-install/standalone/drakbackup b/perl-install/standalone/drakbackup
index 0922f8d2c..7f403a246 100755
--- a/perl-install/standalone/drakbackup
+++ b/perl-install/standalone/drakbackup
@@ -119,7 +119,7 @@ my @list_of_rpm_to_install;
my @other_files;
my @sys_files = "/etc";
my $host_passwd;
-my $untar_prefix;
+my $untar_prefix = "tar -C $restore_path -x";
# allow not-root user with own config
if ($ENV{USER} ne 'root' && $ENV{HOME} ne '/root') {
@@ -147,6 +147,20 @@ foreach (@ARGV) {
/--debug/ and $DEBUG = 1, next;
}
+sub getVarsFromSh {
+ my %l;
+ open(my $F, $_[0]) or return;
+ local $_;
+ while (<$F>) {
+ s/#.*//; # remove comments
+ s/^\s*//; # leading space
+ my ($v, $val) = /^(\w+)=(.*)/ or next;
+ $val = $1 if $val =~ /^"(.*)"$/ || $val =~ /^'(.*)'$/;
+ $l{$v} = $val;
+ }
+ %l;
+}
+
sub setup_tooltips() {
%help = (
'use_expect' => N("Expect is an extension to the Tcl scripting language that allows interactive sessions without user intervention."),
@@ -2878,6 +2892,7 @@ sub restore_do() {
}
sub restore_do2() {
+ destroy_widget();
my $do_restore;
my $text = new Gtk2::TextView;
restore_state();
@@ -3182,7 +3197,8 @@ sub find_files_to_restore() {
my @files_to_restore;
my $cat_entry;
my @catalog = cat_("$cfg_dir/drakbackup_catalog");
-
+ destroy_widget();
+
#- file info in tree view
my $model = Gtk2::TreeStore->new("Glib::String", "Gtk2::Gdk::Pixbuf", "Glib::Int");
my $file_list = Gtk2::TreeView->new_with_model($model);
@@ -3690,9 +3706,12 @@ sub wildcard_to_tarfile {
sub file_to_tarfile {
my ($restore_file, $wildcard) = @_;
+ #- remove leading "/"
+ $restore_file = substr($restore_file, 1);
+ #- filename with spaces
+ $restore_file = "'" . $restore_file . "'" if $restore_file =~ / /;
my $tarfile = `grep -l $restore_file $conf{PATH_TO_SAVE}/*$wildcard.txt`;
chop $tarfile;
- $restore_file = substr($restore_file, 1);
$tarfile = basename($tarfile);
$tarfile =~ s/txt/$conf{OPTION_COMP}/;
$tarfile =~ s/list/backup/;
@@ -3871,6 +3890,10 @@ sub cbutton() {
0, gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => \&interactive_mode_box);
}
+sub cbuttonr() {
+ 0, gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => \&restore_box);
+}
+
sub ibutton {
my ($msg) = @_;
0, gtksignal_connect(Gtk2::Button->new($msg), clicked => \&interactive_mode_box);
@@ -3980,7 +4003,7 @@ sub button_box_restore_end() {
$button_box_tmp->destroy;
gtkpack($button_box,
$button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
- cbutton(),
+ cbuttonr(),
hbutton(),
hspace(),
pbutton(),
@@ -4007,7 +4030,7 @@ sub button_box_restore() {
$button_box_tmp->destroy;
gtkpack($button_box,
$button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
- cbutton(),
+ cbuttonr(),
hbutton(),
hspace(),
pbutton(),