diff options
author | Pascal Terjan <pterjan@mandriva.org> | 2010-04-15 12:45:18 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mandriva.org> | 2010-04-15 12:45:18 +0000 |
commit | 1b1814210966f20efdf911da57c5d15a282112a5 (patch) | |
tree | fb76ef2bbccd96a28b38c5893617bf643d4b18a9 | |
parent | a22bff84cec0dd4346b3ab714e242b7eaf12e5f5 (diff) | |
download | drakx-1b1814210966f20efdf911da57c5d15a282112a5.tar drakx-1b1814210966f20efdf911da57c5d15a282112a5.tar.gz drakx-1b1814210966f20efdf911da57c5d15a282112a5.tar.bz2 drakx-1b1814210966f20efdf911da57c5d15a282112a5.tar.xz drakx-1b1814210966f20efdf911da57c5d15a282112a5.zip |
- Allow resizing empty FAT (#58770)
-rw-r--r-- | perl-install/NEWS | 5 | ||||
-rw-r--r-- | perl-install/install/NEWS | 2 | ||||
-rw-r--r-- | perl-install/resize_fat/any.pm | 10 |
3 files changed, 16 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index f0f58b92f..4372d45dc 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,8 @@ +- diskdrake: + o allow resizing empty FAT (#58770) + +Version 13.19 - 13 April 2010 + - service_harddrake: o remove 'Disable "dri"' from xorg.conf if nouveau is being used - drakxservices: diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 706d63faf..03e236a43 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,5 @@ +- allow resizing empty FAT (#58770) + Version 13.19 - 14 April 2010 - detect "Rack Mount" Chassis as server diff --git a/perl-install/resize_fat/any.pm b/perl-install/resize_fat/any.pm index 59ec02098..99478661a 100644 --- a/perl-install/resize_fat/any.pm +++ b/perl-install/resize_fat/any.pm @@ -86,7 +86,15 @@ sub max_size($) { sub used_size($) { my ($fs) = @_; - my $used_cluster_count = max(last_used($fs), min_cluster_count($fs)); + my $last_used; + my $used_cluster_count; + + eval { $last_used = last_used($fs) }; + if ($@) { + # Empty FAT + $last_used = 0; + } + $used_cluster_count = max($last_used, min_cluster_count($fs)); $used_cluster_count * divide($fs->{cluster_size}, $SECTORSIZE) + divide($fs->{cluster_offset}, $SECTORSIZE); |