Axel Beckert pushed to branch salsa-debug at lintian / lintian
Commits:
- 
287d4230
by Axel Beckert at 2023-01-02T14:23:18+01:00
1 changed file:
Changes:
| ... | ... | @@ -83,15 +83,20 @@ sub version_from_git { | 
| 83 | 83 |      return $EMPTY
 | 
| 84 | 84 |        unless -d $git_path;
 | 
| 85 | 85 | |
| 86 | +    # Example outputs:
 | |
| 87 | +    # 2.115.3-49-g086a9a113
 | |
| 88 | +    # 2.115.3-49-g086a9a113-dirty
 | |
| 86 | 89 |      my $describe
 | 
| 87 | -      = decode_utf8(safe_qx('git', "--git-dir=$git_path", 'describe'));
 | |
| 90 | +      = decode_utf8(safe_qx('git', "--git-dir=$git_path", 'describe', '--dirty'));
 | |
| 88 | 91 |      chomp $describe;
 | 
| 89 | 92 | |
| 90 | -    my ($guess, $step, $commit) = split(/-/, $describe);
 | |
| 91 | -    return $EMPTY
 | |
| 92 | -      unless defined $step;
 | |
| 93 | - | |
| 94 | -    $guess =~ s/ [.] 0 $/.$step/sx;
 | |
| 93 | +    # Modify it to make it a valid native version number and make it
 | |
| 94 | +    # look more debianish like these:
 | |
| 95 | +    # 2.115.3+49commits+git086a9a113
 | |
| 96 | +    # 2.115.3+49commits+git086a9a113+dirty
 | |
| 97 | +    my $guess = $describe;
 | |
| 98 | +    $guess =~ s/ - ( \d+ ) -g /+${1}commits+git/sx;
 | |
| 99 | +    $guess =~ s/ - /+/sxg;
 | |
| 95 | 100 | |
| 96 | 101 |      return ($guess // $EMPTY);
 | 
| 97 | 102 |  }
 |