aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-10-01 16:17:05 +0000
committerThierry Vignaud <tv@mageia.org>2012-10-01 16:17:05 +0000
commita19ee1313d2e05bb0d334ef2c5912bf98489ea31 (patch)
treef7d2528aea80ae43f356cb0e2ec1069e8ab23ffb
parent0d4f995750dc61413421bf2f6ac6651f4e2abc8e (diff)
downloadperl-Hal-Cdroms-a19ee1313d2e05bb0d334ef2c5912bf98489ea31.tar
perl-Hal-Cdroms-a19ee1313d2e05bb0d334ef2c5912bf98489ea31.tar.gz
perl-Hal-Cdroms-a19ee1313d2e05bb0d334ef2c5912bf98489ea31.tar.bz2
perl-Hal-Cdroms-a19ee1313d2e05bb0d334ef2c5912bf98489ea31.tar.xz
perl-Hal-Cdroms-a19ee1313d2e05bb0d334ef2c5912bf98489ea31.zip
rename 'hal_cdroms' as 'cdroms' since we no longuer use Hal
-rw-r--r--lib/Hal/Cdroms.pm42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/Hal/Cdroms.pm b/lib/Hal/Cdroms.pm
index 454a67e..17fbc9e 100644
--- a/lib/Hal/Cdroms.pm
+++ b/lib/Hal/Cdroms.pm
@@ -26,15 +26,15 @@ Hal::Cdroms - access cdroms through HAL and D-Bus
use Hal::Cdroms;
- my $hal_cdroms = Hal::Cdroms->new;
+ my $cdroms = Hal::Cdroms->new;
- foreach my $hal_path ($hal_cdroms->list) {
- my $m = $hal_cdroms->get_mount_point($hal_path);
+ foreach my $hal_path ($cdroms->list) {
+ my $m = $cdroms->get_mount_point($hal_path);
print "$hal_path ", $m ? "is mounted in $m" : "is not mounted", "\n";
}
- my $hal_path = $hal_cdroms->wait_for_insert;
- my $m = $hal_cdroms->mount($hal_path);
+ my $hal_path = $cdroms->wait_for_insert;
+ my $m = $cdroms->mount($hal_path);
print "$hal_path is now mounted in $m\n";
=head1 DESCRIPTION
@@ -64,7 +64,7 @@ sub new {
bless { dbus => $dbus, service => $service }, $class;
}
-=head2 $hal_cdroms->list
+=head2 $cdroms->list
Returns the list of C<hal_path> of the cdroms (mounted or not).
@@ -80,7 +80,7 @@ sub list {
grep { _GetProperty(_get_device($o, $_), 'DeviceIsOpticalDisc') } @{$manager->EnumerateDevices};
}
-=head2 $hal_cdroms->get_mount_point($hal_path)
+=head2 $cdroms->get_mount_point($hal_path)
Return the mount point associated to the C<hal_path>, or undef it is not mounted.
@@ -125,10 +125,10 @@ sub _try {
}
}
-=head2 $hal_cdroms->ensure_mounted($hal_path)
+=head2 $cdroms->ensure_mounted($hal_path)
Mount the C<hal_path> if not already mounted.
-Return the mount point associated to the C<hal_path>, or undef it cannot be mounted successfully (see $hal_cdroms->{error}).
+Return the mount point associated to the C<hal_path>, or undef it cannot be mounted successfully (see $cdroms->{error}).
=cut
@@ -141,10 +141,10 @@ sub ensure_mounted {
}
-=head2 $hal_cdroms->mount_through_hal($hal_path)
+=head2 $cdroms->mount_through_hal($hal_path)
Mount the C<hal_path> through HAL
-Return the mount point associated to the C<hal_path>, or undef it cannot be mounted successfully (see $hal_cdroms->{error}).
+Return the mount point associated to the C<hal_path>, or undef it cannot be mounted successfully (see $cdroms->{error}).
If the cdrom is listed in fstab, HAL will refuse to mount it.
=cut
@@ -159,10 +159,10 @@ sub mount_hal {
$mountpoint;
}
-=head2 $hal_cdroms->mount($hal_path)
+=head2 $cdroms->mount($hal_path)
Mount the C<hal_path> through HAL or fallback to plain mount(8).
-Return the mount point associated to the C<hal_path>, or undef it cannot be mounted successfully (see $hal_cdroms->{error})
+Return the mount point associated to the C<hal_path>, or undef it cannot be mounted successfully (see $cdroms->{error})
=cut
@@ -193,9 +193,9 @@ sub _fstab_devices() {
map { /(\S+)/ } <$F>;
}
-=head2 $hal_cdroms->unmount($hal_path)
+=head2 $cdroms->unmount($hal_path)
-Unmount the C<hal_path>. Return true on success (see $hal_cdroms->{error} on failure)
+Unmount the C<hal_path>. Return true on success (see $cdroms->{error} on failure)
If the cdrom is listed in not mounted by HAL, HAL will refuse to unmount it.
=cut
@@ -207,10 +207,10 @@ sub unmount_hal {
_try($o, sub { $volume->FilesystemUnmount([]) });
}
-=head2 $hal_cdroms->unmount($hal_path)
+=head2 $cdroms->unmount($hal_path)
Unmount the C<hal_path> through HAL or fallback on umount(8).
-Return true on success (see $hal_cdroms->{error} on failure)
+Return true on success (see $cdroms->{error} on failure)
=cut
@@ -222,9 +222,9 @@ sub unmount {
system('umount', get_mount_point($o, $hal_path)) == 0;
}
-=head2 $hal_cdroms->eject($hal_path)
+=head2 $cdroms->eject($hal_path)
-Ejects the C<hal_path>. Return true on success (see $hal_cdroms->{error} on failure)
+Ejects the C<hal_path>. Return true on success (see $cdroms->{error} on failure)
=cut
@@ -235,7 +235,7 @@ sub eject {
_try($o, sub { $volume->FilesystemUnmount([]); $volume->DriveEject([]) });
}
-=head2 $hal_cdroms->wait_for_insert([$timeout])
+=head2 $cdroms->wait_for_insert([$timeout])
Waits until a cdrom is inserted.
Returns the inserted C<hal_path> on success. Otherwise returns undef.
@@ -257,7 +257,7 @@ sub wait_for_insert {
});
}
-=head2 $hal_cdroms->wait_for_mounted([$timeout])
+=head2 $cdroms->wait_for_mounted([$timeout])
Waits until a cdrom is inserted and mounted by a volume manager (eg: gnome-volume-manager).
Returns the mounted C<hal_path> on success. Otherwise returns undef.