diff options
Diffstat (limited to 'perl-install/resize_fat')
| -rwxr-xr-x[-rw-r--r--] | perl-install/resize_fat/Makefile.PL | 0 | ||||
| -rw-r--r-- | perl-install/resize_fat/README | 2 | ||||
| -rw-r--r-- | perl-install/resize_fat/any.pm | 12 | ||||
| -rw-r--r-- | perl-install/resize_fat/boot_sector.pm | 4 | ||||
| -rw-r--r-- | perl-install/resize_fat/c_rewritten.pm | 2 | ||||
| -rw-r--r-- | perl-install/resize_fat/dir_entry.pm | 2 | ||||
| -rw-r--r-- | perl-install/resize_fat/directory.pm | 2 | ||||
| -rw-r--r-- | perl-install/resize_fat/fat.pm | 2 | ||||
| -rw-r--r-- | perl-install/resize_fat/info_sector.pm | 2 | ||||
| -rw-r--r-- | perl-install/resize_fat/io.pm | 2 | ||||
| -rw-r--r-- | perl-install/resize_fat/main.pm | 4 |
11 files changed, 21 insertions, 13 deletions
diff --git a/perl-install/resize_fat/Makefile.PL b/perl-install/resize_fat/Makefile.PL index 712f4e395..712f4e395 100644..100755 --- a/perl-install/resize_fat/Makefile.PL +++ b/perl-install/resize_fat/Makefile.PL diff --git a/perl-install/resize_fat/README b/perl-install/resize_fat/README index 12b64dea9..ad5656f0b 100644 --- a/perl-install/resize_fat/README +++ b/perl-install/resize_fat/README @@ -5,4 +5,4 @@ resize_fat::fat::update($fs) should be called before doing undoable things BUGS: no known bugs :) -if you found one, please mail pixel@mandrakesoft.com !! +if you found one, please mail pixel !! diff --git a/perl-install/resize_fat/any.pm b/perl-install/resize_fat/any.pm index 59ec02098..fc3c438eb 100644 --- a/perl-install/resize_fat/any.pm +++ b/perl-install/resize_fat/any.pm @@ -1,4 +1,4 @@ -package resize_fat::any; # $Id$ +package resize_fat::any; use diagnostics; use strict; @@ -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); diff --git a/perl-install/resize_fat/boot_sector.pm b/perl-install/resize_fat/boot_sector.pm index dd09755cc..f93647579 100644 --- a/perl-install/resize_fat/boot_sector.pm +++ b/perl-install/resize_fat/boot_sector.pm @@ -1,4 +1,4 @@ -package resize_fat::boot_sector; # $Id$ +package resize_fat::boot_sector; use diagnostics; use strict; @@ -57,7 +57,7 @@ sub read($) { $fs->{cluster_size} = $fs->{cluster_size_in_sectors} * $fs->{sector_size}; $fs->{boot_sign} == 0xAA55 or die "Invalid signature for a MS-based filesystem.\n"; - $fs->{nb_sectors} < 32 and die "Too few sectors for viable file system\n"; + $fs->{nb_sectors} < 32 and die "Too few sectors for viable filesystem\n"; $fs->{nb_fats} == 2 or cdie "Weird number of FATs: $fs->{nb_fats}, not 2.\n"; $fs->{sector_size} == 512 or cdie "Strange sector_size != 512\n"; diff --git a/perl-install/resize_fat/c_rewritten.pm b/perl-install/resize_fat/c_rewritten.pm index bc0548314..39ba9253f 100644 --- a/perl-install/resize_fat/c_rewritten.pm +++ b/perl-install/resize_fat/c_rewritten.pm @@ -1,4 +1,4 @@ -package resize_fat::c_rewritten; # $Id$ +package resize_fat::c_rewritten; use strict; diff --git a/perl-install/resize_fat/dir_entry.pm b/perl-install/resize_fat/dir_entry.pm index 130bac7c8..27d2ea33f 100644 --- a/perl-install/resize_fat/dir_entry.pm +++ b/perl-install/resize_fat/dir_entry.pm @@ -1,4 +1,4 @@ -package resize_fat::dir_entry; # $Id$ +package resize_fat::dir_entry; use diagnostics; use strict; diff --git a/perl-install/resize_fat/directory.pm b/perl-install/resize_fat/directory.pm index 6f8ae9445..9c04fb62b 100644 --- a/perl-install/resize_fat/directory.pm +++ b/perl-install/resize_fat/directory.pm @@ -1,4 +1,4 @@ -package resize_fat::directory; # $Id$ +package resize_fat::directory; use diagnostics; use strict; diff --git a/perl-install/resize_fat/fat.pm b/perl-install/resize_fat/fat.pm index 2bceb129d..20145982b 100644 --- a/perl-install/resize_fat/fat.pm +++ b/perl-install/resize_fat/fat.pm @@ -1,4 +1,4 @@ -package resize_fat::fat; # $Id$ +package resize_fat::fat; use diagnostics; use strict; diff --git a/perl-install/resize_fat/info_sector.pm b/perl-install/resize_fat/info_sector.pm index 11aa7f153..47de2db1c 100644 --- a/perl-install/resize_fat/info_sector.pm +++ b/perl-install/resize_fat/info_sector.pm @@ -1,4 +1,4 @@ -package resize_fat::info_sector; # $Id$ +package resize_fat::info_sector; use diagnostics; use strict; diff --git a/perl-install/resize_fat/io.pm b/perl-install/resize_fat/io.pm index 020cb61f5..78e3a3724 100644 --- a/perl-install/resize_fat/io.pm +++ b/perl-install/resize_fat/io.pm @@ -1,4 +1,4 @@ -package resize_fat::io; # $Id$ +package resize_fat::io; use diagnostics; use strict; diff --git a/perl-install/resize_fat/main.pm b/perl-install/resize_fat/main.pm index ed81363b7..681aec756 100644 --- a/perl-install/resize_fat/main.pm +++ b/perl-install/resize_fat/main.pm @@ -1,4 +1,4 @@ -package resize_fat::main; # $Id$ +package resize_fat::main; # This is mainly a perl rewrite of the work of Andrew Clausen (libresize) @@ -44,7 +44,7 @@ sub DESTROY { #- copy all clusters >= <start_cluster> to a new place on the partition, less #- than <start_cluster>. Only copies files, not directories. -#- (use of buffer needed because the seeks slow like hell the hard drive) +#- (use of buffer needed because the seeks slow like hell the hard disk drive) sub copy_clusters { my ($fs, $cluster) = @_; my @buffer; |
