Commit 1b19ad66 authored by fun's avatar fun
Browse files

upkg: 0.60

parent fe312e7d
untrusted comment: verify with /etc/ports/therealfun.pub
RWTcI5d5qAlZ8goYBKQd732ow79ddqNGmIrhKlCTgUSv58QVhFEhh/RmbHHKBHYUioDSadyjn5ohQJbQDNcnHHIw93qZvrhzGwI=
SHA256 (Pkgfile) = 9d9850c425c985184e8313f95884b6699896db0c7c9aae11a34845f91c9d8a87
RWTcI5d5qAlZ8mPLAIpK38u7FPep2fwcNOPpSEV/4pTuVuEFE9NOjQezHwdWfG1FXP8lh3vP0HIMoB2Dl5O9zwi9RKr5CaY9IQ8=
SHA256 (Pkgfile) = 1dc32d4e62e7034c5b1606cb0703be094ec666b0e48bc2e3a123d6ab11fc6e35
SHA256 (.footprint) = ade57b967b42ebe104c55062314fceda4576ce0b86d97650b0440c219df69653
SHA256 (uports) = 22fca3d02c5cc1262c1617ba5b00aaf9440edc71ec142f97639a83876118c877
SHA256 (uports-init) = 6175bc20baac6941aaf20f8986801da1726f6bd0f3b58e60502d46867c55bc0d
......@@ -16,7 +16,7 @@ SHA256 (upkg-deporder) = bf6de34918066aa1d59e23597ee5be8ff2ceefbe105237ed9919f07
SHA256 (upkg-depsearch) = c6f270183a9fc94f5e5c8391adafd2c7f31abab6fd4d086934b8b3aa9e242f4b
SHA256 (upkg-deptree) = 211ea5553a9ee6ccbeff7a9b2d6f53b947a299b894379b2518182e9ddbcf2647
SHA256 (upkg-diff) = ed5f230b72de52bbd914334d0e41022de4f3e7d170d0937f594deeefd5de8648
SHA256 (upkg-dl-list) = 9f9f8d73aa426f5cb0f6e805e0308deaa42ab7409e190cab60c9e702594431f5
SHA256 (upkg-dl-list) = ab8002b96ef90d344cc74c1958556460017f4cb3f02cb37e4260fdb67ba748f8
SHA256 (upkg-dsearch) = 374ed7b79d255dabd7435ceb5aa5524ddcea01aa6d8b27a1dc097a0af6d7d88c
SHA256 (upkg-fsearch) = 2cae0e4d72b86c68e43bf92f1180163aae507bafc262f91c0589e7f8045300e4
SHA256 (upkg-info) = fc84efa42ab8eddebf5687939cc54f0dd7a60b7845754b978b0a4791c0234d7f
......
......@@ -5,7 +5,7 @@
# Nice to have: pkgmk.conf
name=upkg
version=0.59
version=0.60
release=1
source=(
uports uports-init uports.1.pod
......
......@@ -18,7 +18,8 @@ sub main
my @url;
my %vars;
eval {
@url = map { expand_url($_, \$content, \%vars) } @raw
@url = map { expand_url($_, \$content, \%vars) }
@raw
};
if ($@) {
......@@ -78,8 +79,11 @@ sub expand_string
for my $p (@pieces) {
my ($expr, $clear) = ($p =~ /^ { (.+?) } (.*) $/x);
($expr, $clear) = ($p =~ /^ (\w+) (.*) $/x) if not $expr;
die "Can't handle $raw" if not $expr and not $clear;
$clear =~ s/\\([_-])/$1/g if $clear; # $name\_$var
push @url, eval_expr($expr, $content, $vars), $clear;
}
return join '', @url;
......@@ -264,16 +268,36 @@ sub eval_expr
}
}
sub hack_vars
{
my ($name, $content, $vars) = @_;
if (
$$content =~ / ^ $name =
\$\(printf \s+ "%i%.2i%.2i%.2i" \s+ \$\{version\/\/\.\/\s\}\) /xm
) {
my $v = expand_var('version', $content, $vars);
my @v = split /\./, $v;
push @v, 0;
return sprintf "%i%.2i%.2i%.2i", @v;
}
return undef;
}
sub expand_var
{
my ($name, $content, $vars) = @_;
if (not exists $vars->{$name}) {
$$content =~ / ^ $name = ([^\s]+) /xm
or die "unknown variable: $name";
my $value = $1;
$value =~ s/^"(.+)"$/$1/;
my $v = expand_string($value, $content, $vars);
my $v = hack_vars(@_);
if (not $v) {
$$content =~ / ^ $name = ([^\s]+) /xm
or die "unknown variable: $name";
my $value = $1;
$value =~ s/^"(.+)"$/$1/;
$v = expand_string($value, $content, $vars);
}
$vars->{$name} = $v;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment