summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/remote.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
commit126777bc019a54afb4ec51299f2cf9d2841698aa (patch)
tree97f76e571902ead55ba138f1156a4b4f00b9b779 /perl-install/fs/remote.pm
parentf1f67448efc714873378dfeb8279fae68054a90a (diff)
downloaddrakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.gz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.bz2
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.xz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.zip
re-sync after the big svn loss
Diffstat (limited to 'perl-install/fs/remote.pm')
-rw-r--r--perl-install/fs/remote.pm45
1 files changed, 45 insertions, 0 deletions
diff --git a/perl-install/fs/remote.pm b/perl-install/fs/remote.pm
new file mode 100644
index 000000000..ea22a04af
--- /dev/null
+++ b/perl-install/fs/remote.pm
@@ -0,0 +1,45 @@
+package fs::remote; # $Id$
+
+use strict;
+use diagnostics;
+
+use fs::mount_options;
+
+
+sub new {
+ my ($class, $o_v) = @_;
+ bless($o_v || {}, $class);
+}
+
+sub server_to_string {
+ my ($_class, $server) = @_;
+ $server->{name} || $server->{ip};
+}
+sub comment_to_string {
+ my ($_class, $comment) = @_;
+ $comment;
+}
+sub to_dev {
+ my ($class, $e) = @_;
+ $class->to_dev_raw($class->server_to_string($e->{server}), $e->{name} || $e->{ip});
+}
+sub to_string {
+ my ($class, $e) = @_;
+ my $comment = $class->comment_to_string($e->{comment});
+ ($e->{name} || $e->{ip}) . ($comment ? " ($comment)" : '');
+}
+
+sub to_fullstring {
+ my ($class, $e) = @_;
+ my $comment = $class->comment_to_string($e->{comment});
+ $class->to_dev($e) . ($comment ? " ($comment)" : '');
+}
+sub to_fstab_entry_raw {
+ my ($class, $e, $fs_type) = @_;
+ my $fs_entry = { device => $class->to_dev($e), fs_type => $fs_type };
+ fs::mount_options::set_default($fs_entry);
+ $fs_entry;
+}
+
+1;
+