diff options
Diffstat (limited to 'perl-install/resize_fat')
| -rw-r--r-- | perl-install/resize_fat/.cvsignore | 5 | ||||
| -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/c_rewritten.xs | 7 | ||||
| -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 | 5 | 
13 files changed, 26 insertions, 21 deletions
| diff --git a/perl-install/resize_fat/.cvsignore b/perl-install/resize_fat/.cvsignore deleted file mode 100644 index 3001c7424..000000000 --- a/perl-install/resize_fat/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -blib -pm_to_blib -Makefile_c -c_rewritten.c -c_rewritten.bs 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/c_rewritten.xs b/perl-install/resize_fat/c_rewritten.xs index 89be89826..2bca483c0 100644 --- a/perl-install/resize_fat/c_rewritten.xs +++ b/perl-install/resize_fat/c_rewritten.xs @@ -40,7 +40,10 @@ void set_next(unsigned int cluster, unsigned int val) {      free_all();      croak("fat::set_next: cluster %d outside filesystem", cluster);    } -  type_size == 1 ? *p : *((unsigned int *) p) = val; +  if (type_size == 1) +    *p = val; +  else +    *((unsigned int *) p) = val;  }  MODULE = resize_fat::c_rewritten PACKAGE = resize_fat::c_rewritten @@ -48,7 +51,7 @@ MODULE = resize_fat::c_rewritten PACKAGE = resize_fat::c_rewritten  PROTOTYPES: DISABLE -void  +void  read_fat(fd, offset, size, magic)    int fd    int offset 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 726875837..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) @@ -7,7 +7,6 @@ use strict;  use log;  use common; -use MDK::Common::System;  use resize_fat::boot_sector;  use resize_fat::info_sector;  use resize_fat::directory; @@ -45,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; | 
