Changeset 3501


Ignore:
Timestamp:
Feb 9, 2016, 12:59:53 PM (20 months ago)
Author:
bruno
Message:
  • mr-label now works with UUID having a "-" and checked also for LABEL
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/MondoRescue/bin/mr-label

    r3496 r3501  
    116116die "Unable no label/uuid defined" if ((not defined $label) && (not defined $uuid));
    117117
    118 my($inputfh, $buffer, $offset, $length, $hexlabel, $newbuf);
     118my $inputf  = $ARGV[0];
     119die "$0: no input file defined" if (not defined $inputf);
    119120
    120 $inputf  = $ARGV[0];
    121 die "$0: no input file defined" if (not defined $inputf);
     121my($inputfh, $buffer, $offset, $length, $hexlabel);
    122122
    123123open($inputfh,  "+< $inputf") || die "$0: cannot open $inputf for reading/writing: $!";
     
    132132    $offset = 39;
    133133    $length = 4;
    134     $newbuf = "";
    135134} else {
    136135    die "Nothing to do no label/uuid defined";
     
    150149} elsif (defined $uuid) {
    151150    my ($hex) = unpack( 'H*', $buffer );
    152     #for my $d (split('',$buffer)) {
    153     #pb_log(1,"Char analyzed: ".hex($d)."\n");
    154     #$newbuf = $d.$newbuf;
    155     #}
    156151    pb_log(1,"Previous hex was ***$hex***\n");
    157152    my @loc = ($hex =~ m/../g);
     
    167162    pb_log(1,"New label is ***$hexlabel***\n");
    168163} elsif (defined $uuid) {
     164    # Remove separator
     165    $uuid =~ s/-//;
    169166    pb_log(1,"New uuid is ***$uuid***\n");
    170167    my @loc = ($uuid =~ m/../g);
Note: See TracChangeset for help on using the changeset viewer.