summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakbackup
diff options
context:
space:
mode:
authorYves Duret <yduret@mandriva.com>2002-03-30 10:21:18 +0000
committerYves Duret <yduret@mandriva.com>2002-03-30 10:21:18 +0000
commit06edf44669168d733e87aaf77a2d6d2ae98b622f (patch)
treeffd1bb4854ff6f0e5c2c292f80e902eaeeab01fa /perl-install/standalone/drakbackup
parent7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f (diff)
downloaddrakx-backup-do-not-use-06edf44669168d733e87aaf77a2d6d2ae98b622f.tar
drakx-backup-do-not-use-06edf44669168d733e87aaf77a2d6d2ae98b622f.tar.gz
drakx-backup-do-not-use-06edf44669168d733e87aaf77a2d6d2ae98b622f.tar.bz2
drakx-backup-do-not-use-06edf44669168d733e87aaf77a2d6d2ae98b622f.tar.xz
drakx-backup-do-not-use-06edf44669168d733e87aaf77a2d6d2ae98b622f.zip
bugs fixes, code clean up, more mdkish..
Diffstat (limited to 'perl-install/standalone/drakbackup')
-rwxr-xr-xperl-install/standalone/drakbackup76
1 files changed, 32 insertions, 44 deletions
diff --git a/perl-install/standalone/drakbackup b/perl-install/standalone/drakbackup
index 05a2ad165..bc7528b8d 100755
--- a/perl-install/standalone/drakbackup
+++ b/perl-install/standalone/drakbackup
@@ -272,26 +272,14 @@ sub daemon_mode {
interactive_mode();
sub all_user_list {
- my ($username) = @_;
- my $passwdfile = "/etc/passwd";
- my $user;
- my $uid;
+ my ($uname, $uid);
@all_user_list = ();
-
- open (PASSWD, $passwdfile) or exit 1;
- while (defined(my $line = <PASSWD>)) {
- chomp($line);
- ($user, $uid) = (split(/:/, $line))[0, 2];
- if ($uid >= 500 || $uid == 0 ) {
- push @all_user_list, $user;
- }
- }
- close (PASSWD);
- if ($DEBUG) {
- print "/-- User list --/ \n";
- print " -> $_\n" foreach (@all_user_list);
- print "\n";
- }
+ setpwent();
+ do {
+ @user_info = getpwent();
+ ($uname, $uid) = @user_info[0,2];
+ push (@all_user_list, $uname) if ($uid > 500) and !($uname eq "nobody");
+ } while (@user_info);
}
sub the_time {
@@ -959,31 +947,31 @@ sub advanced_where_net_ftp {
my $box_where_net;
gtkpack($advanced_box,
- $box_where_net = gtkpack_(new Gtk::VBox(0, 15),
- 0, new Gtk::HSeparator,
- 0, my $check_where_net_ftp = new Gtk::CheckButton( _("Use FTP connection to backup") ),
- 0, new Gtk::HSeparator,
- 0, gtkpack_(new Gtk::HBox(0,10),
+ $box_where_net = gtkpack__(new Gtk::VBox(0, 15),
+ new Gtk::HSeparator,
+ my $check_where_net_ftp = new Gtk::CheckButton( _("Use FTP connection to backup") ),
+ new Gtk::HSeparator,
+ gtkpack_(new Gtk::HBox(0,10),
0, gtkset_sensitive(new Gtk::Label(_("Please enter the host name or IP.")), $where_net_ftp),
1, new Gtk::HBox(0,10),
0, gtkset_sensitive(my $host_name_entry = new Gtk::Entry(), $where_net_ftp),
),
- 0, gtkpack_(new Gtk::HBox(0,10),
- 0, gtkset_sensitive(new Gtk::Label(_("Please enter the directory to\n put the backup on this host.")), $where_net_ftp),
+ gtkpack_(new Gtk::HBox(0,10),
+ gtkset_sensitive(new Gtk::Label(_("Please enter the directory to\n put the backup on this host.")), $where_net_ftp),
1, new Gtk::HBox(0,10),
0, gtkset_sensitive(my $host_path_entry = new Gtk::Entry(), $where_net_ftp),
),
- 0, gtkpack_(new Gtk::HBox(0,10),
+ gtkpack_(new Gtk::HBox(0,10),
0, gtkset_sensitive(new Gtk::Label(_("Please enter your login")), $where_net_ftp),
1, new Gtk::HBox(0,10),
0, gtkset_sensitive(my $login_user_entry = new Gtk::Entry(), $where_net_ftp),
),
- 0, gtkpack_(new Gtk::HBox(0,10),
+ gtkpack_(new Gtk::HBox(0,10),
0, gtkset_sensitive(new Gtk::Label(_("Please enter your password")), $where_net_ftp),
1, new Gtk::HBox(0,10),
0, gtkset_sensitive(my $passwd_user_entry = new Gtk::Entry(), $where_net_ftp),
- ),
- 0, gtkpack_(new Gtk::HBox(0,10),
+ ),
+ gtkpack_(new Gtk::HBox(0,10),
1, new Gtk::HBox(0,10),
0, gtkset_sensitive(my $check_remember_pass = new Gtk::CheckButton( _("Remember this password")), $where_net_ftp),
),
@@ -1244,15 +1232,15 @@ sub advanced_where{
1, gtksignal_connect(my $button_where_net = new Gtk::Button(), clicked => sub {
# $box_where->destroy(); advanced_where_net(); }),
$box_where->destroy(); advanced_where_net_ftp(); }),
-# 1, gtksignal_connect(my $button_where_cd = new Gtk::Button(), clicked => sub {
-# ${$central_widget}->destroy();
-# if (require_rpm("mkisofs", "cdrecord", "toto")) { advanced_where_cd(); }
-# else {
-# print "have to install @list_of_rpm_to_install...\n";
-# ${$central_widget}->destroy();
-# install_rpm(\&advanced_where);
-# }
-# }),
+ 1, gtksignal_connect(my $button_where_cd = new Gtk::Button(), clicked => sub {
+ ${$central_widget}->destroy();
+ if (require_rpm("mkisofs", "cdrecord", "toto")) { advanced_where_cd(); }
+ else {
+ print "have to install @list_of_rpm_to_install...\n";
+ ${$central_widget}->destroy();
+ install_rpm(\&advanced_where);
+ }
+ }),
1, gtksignal_connect(my $button_where_hd = new Gtk::Button(), clicked => sub {
${$central_widget}->destroy(); advanced_where_hd(); }),
# 1, gtksignal_connect(my $button_where_tape = new Gtk::Button(), clicked => sub {
@@ -1267,11 +1255,11 @@ sub advanced_where{
new Gtk::Label(_("Network")),
new Gtk::HBox(0, 5)
));
-# $button_where_cd->add(gtkpack(new Gtk::HBox(0,10),
-# new Gtk::Pixmap($pix_cd_map, $pix_cd_mask),
-# new Gtk::Label(_("CDROM / DVDROM")),
-# new Gtk::HBox(0, 5)
-# ));
+ $button_where_cd->add(gtkpack(new Gtk::HBox(0,10),
+ new Gtk::Pixmap($pix_cd_map, $pix_cd_mask),
+ new Gtk::Label(_("CDROM / DVDROM")),
+ new Gtk::HBox(0, 5)
+ ));
$button_where_hd->add(gtkpack(new Gtk::HBox(0,10),
new Gtk::Pixmap($pix_hd_map, $pix_hd_mask),
new Gtk::Label(_("HardDrive / NFS")),