TT#60670 Use dpkg-query -W instead of -s to fetch the Version field value

The dpkg-query command already has an interface to fetch the field
value, so there is no need to use --status, grep and then parse the
output.

Change-Id: I13a2f601bde4ca01bfbd7db35f8a1ff11175fba3
changes/03/30803/3
Guillem Jover 7 years ago
parent 580d7531c8
commit 7131b2891c

@ -208,14 +208,13 @@ sub sync_db_timezones {
}
my ($tzinfo_version, undef, undef) = capture {
system('dpkg -s tzdata | grep Version:');
system('dpkg-query -f "\${Version}" -W tzdata');
};
unless ($tzinfo_version && $tzinfo_version =~ /Version:\s*(\S+)/) {
unless ($tzinfo_version) {
print "Error: Could not retrieve tzdata package version\n";
return;
}
$tzinfo_version = $1;
chomp $tzinfo_version;
my $pe = $dbh->{PrintError};
$dbh->{PrintError} = 0;

Loading…
Cancel
Save