Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 116510
Collapse All | Expand All

(-)flexbackup (-3 / +24 lines)
Lines 269-274 Link Here
269
    untie(%::index);
269
    untie(%::index);
270
}
270
}
271
271
272
system ('rm', '-rf', $cfg::tmpdir);
272
exit(0);
273
exit(0);
273
274
274
######################################################################
275
######################################################################
Lines 811-816 Link Here
811
	($remove, @cmds) = &backup_filelist($label, $localdir, $title, $level, $remote);
812
	($remove, @cmds) = &backup_filelist($label, $localdir, $title, $level, $remote);
812
    }
813
    }
813
814
815
	if(defined($remote)) {
816
		# create our temporary directory as first remote command
817
		unshift(@cmds, &maybe_remote_cmd("$::path{mkdir} -p $cfg::tmpdir", $remote));
818
	}
819
814
    # Nuke any tmp files used in the above routines
820
    # Nuke any tmp files used in the above routines
815
    if ($remove ne '') {
821
    if ($remove ne '') {
816
	push(@cmds, &maybe_remote_cmd("$::path{rm} -f $remove", $remote));
822
	push(@cmds, &maybe_remote_cmd("$::path{rm} -f $remove", $remote));
Lines 827-832 Link Here
827
	    push(@cmds, &maybe_remote_cmd("$::path{rm} -f $pkglist", $remote));
833
	    push(@cmds, &maybe_remote_cmd("$::path{rm} -f $pkglist", $remote));
828
	}
834
	}
829
    }
835
    }
836
	
837
	if(defined($remote)) {
838
		# remove temporary directory as our last remote command
839
		push(@cmds, &maybe_remote_cmd("$::path{rm} -rf $cfg::tmpdir", $remote));
840
	}
830
841
831
    # Strip multiple spaces
842
    # Strip multiple spaces
832
    foreach my $cmd (@cmds) {
843
    foreach my $cmd (@cmds) {
Lines 2750-2757 Link Here
2750
    $::path{'find'} = &checkinpath('find');
2761
    $::path{'find'} = &checkinpath('find');
2751
    $::path{'dd'} = &checkinpath('dd');
2762
    $::path{'dd'} = &checkinpath('dd');
2752
    $::path{'printf'} = &checkinpath('printf');
2763
    $::path{'printf'} = &checkinpath('printf');
2764
    $::path{'mkdir'} = &checkinpath('mkdir');
2753
2765
2754
    push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'}));
2766
    push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'},$::path{'mkdir'}));
2755
2767
2756
    # Check device (or dir)
2768
    # Check device (or dir)
2757
    $::ftape = 0;
2769
    $::ftape = 0;
Lines 3442-3447 Link Here
3442
	push(@::errors,"\$tmpdir $cfg::tmpdir is not writable");
3454
	push(@::errors,"\$tmpdir $cfg::tmpdir is not writable");
3443
    }
3455
    }
3444
3456
3457
	$cfg::hostname = `hostname`;
3458
	chomp($cfg::hostname);
3459
3460
	# Use a subdirectory of the user-specified directory as our tmpdir
3461
	# Also note that we make it closer to globally unique as we sometimes
3462
	# use this variable for remote systems, so PID isn't enough
3463
    $cfg::tmpdir = $cfg::tmpdir .'/flexbackup.'.$$.'.'.$cfg::hostname;
3464
    mkdir ($cfg::tmpdir) || die "Can't create temporary directory, $!";
3465
3445
    # Levels
3466
    # Levels
3446
    if (defined($::opt{'level'}) and
3467
    if (defined($::opt{'level'}) and
3447
	(defined($::opt{'incremental'}) or
3468
	(defined($::opt{'incremental'}) or
Lines 5236-5243 Link Here
5236
    # Create a script which tests the buffer program
5257
    # Create a script which tests the buffer program
5237
    open(SCR,"> $tmp_script") || die;
5258
    open(SCR,"> $tmp_script") || die;
5238
    print SCR "#!/bin/sh\n";
5259
    print SCR "#!/bin/sh\n";
5239
    print SCR "tmp_data=/tmp/bufftest\$\$.txt\n";
5260
    print SCR "tmp_data=\`tempfile\`\n";
5240
    print SCR "tmp_err=/tmp/bufftest\$\$.err\n";
5261
    print SCR "tmp_err=\`tempfile\`\n";
5241
    print SCR "echo testme > \$tmp_data\n";
5262
    print SCR "echo testme > \$tmp_data\n";
5242
    print SCR "$buffer_cmd > /dev/null 2> \$tmp_err < \$tmp_data\n";
5263
    print SCR "$buffer_cmd > /dev/null 2> \$tmp_err < \$tmp_data\n";
5243
    print SCR "res=\$?\n";
5264
    print SCR "res=\$?\n";

Return to bug 116510