Changeset 3689


Ignore:
Timestamp:
Oct 2, 2017, 12:35:02 PM (2 weeks ago)
Author:
bruno
Message:

Revert a modification on what I thought was useless code !!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi/mr-parted2fdisk

    r3687 r3689  
    196196# util-linux/fdisk version
    197197my $fdisk = pb_check_req("fdisk",0);
    198 #open(CMD,"$fdisk -v |") || die "Unable to execute $fdisk";
    199 #my $version = <CMD>;
    200 #close(CMD);
    201 #chomp($version);
    202 ## RHEL 5 has fdisk from util-linux 2.13-pre7
    203 ## Mageia 4 has fdisk from util-linux 2.24.2
    204 #$version =~ s/[^0-9\.]*([0-9a-z\.-]+)[\)]*$/$1/;
    205 #my ($v,$maj,$min) = split(/\./,$version);
    206 
    207 ## Consider pre version the same as the following for formats
    208 #if ((defined $maj) && ($maj =~ /-pre/)) {
    209 #$maj =~ s/-pre.*$//;
    210 #$maj++;
    211 #}
    212 ## Remove potential remaining letters
    213 #$maj =~ s/[a-z]+//;
    214 #
    215 #if ((defined $min) && ($min =~ /-pre/)) {
    216 #$min =~ s/-pre.*$//;
    217 #$min++;
    218 #}
    219 #$min =~ s/[a-z]+// if (defined $min);
     198open(CMD,"$fdisk -v |") || die "Unable to execute $fdisk";
     199my $version = <CMD>;
     200close(CMD);
     201chomp($version);
     202# RHEL 5 has fdisk from util-linux 2.13-pre7
     203# Mageia 4 has fdisk from util-linux 2.24.2
     204$version =~ s/[^0-9\.]*([0-9a-z\.-]+)[\)]*$/$1/;
     205my ($v,$maj,$min) = split(/\./,$version);
     206
     207# Consider pre version the same as the following for formats
     208if ((defined $maj) && ($maj =~ /-pre/)) {
     209    $maj =~ s/-pre.*$//;
     210    $maj++;
     211}
     212# Remove potential remaining letters
     213$maj =~ s/[a-z]+//;
     214
     215if ((defined $min) && ($min =~ /-pre/)) {
     216    $min =~ s/-pre.*$//;
     217    $min++;
     218}
     219$min =~ s/[a-z]+// if (defined $min);
    220220
    221221my %pid = ( "FAT" => "6",
Note: See TracChangeset for help on using the changeset viewer.