aboutsummaryrefslogtreecommitdiff
path: root/sbofixinfo
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-07-05 16:11:39 -0400
committerB. Watson <urchlay@slackware.uk>2022-07-07 00:33:02 -0400
commit6e9420dd60bd92af61a943066246fe88a8f5bba7 (patch)
tree2ed1bf37ebb99e9b751666cb68ef5c2387b04231 /sbofixinfo
parent02909612d07fc52ce09bf5f2bd3a0c46d7d8340a (diff)
downloadsbo-maintainer-tools-6e9420dd60bd92af61a943066246fe88a8f5bba7.tar.gz
sbofixinfo: fix stupidity from last commit
Diffstat (limited to 'sbofixinfo')
-rwxr-xr-xsbofixinfo10
1 files changed, 9 insertions, 1 deletions
diff --git a/sbofixinfo b/sbofixinfo
index c4ba522..eeba16e 100755
--- a/sbofixinfo
+++ b/sbofixinfo
@@ -150,6 +150,12 @@ $errcnt = 0;
fix_info($_) for @ARGV;
exit $errcnt;
+sub fix_key {
+ my $key = shift;
+ $key =~ tr/-a-wyz/_A-WYZ/; # leave "x" lowercase!
+ return $key;
+}
+
sub fix_info {
my $file = shift;
if(-d $file) {
@@ -180,11 +186,13 @@ sub fix_info {
s/^(\w+)\s*=\s*/$1=/; # remove spaces around =
if(/^(\w+)=(.*)$/) {
- $key = uc $1;
+ $key = $1;
$val = $2;
$val =~ s,(?:^['"]|['"]$),,g; # remove quotes around value
$val =~ s,[\s\\]*$,,; # remove any line-continuation backslash
+ $key = fix_key($key);
+
if($key =~ /^MD5SUM/) {
$val =~ tr/A-Z/a-z/;
}