#!/bin/sh # This file is a part of Julia. License is MIT: https://julialang.org/license # build-time mini version of WinRPM, usage: # ./winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.2/ mingw64-zlib1 # depends on curl, xmllint, gunzip, sort -V, sha256sum, and p7zip set -e global url := $1 global toinstall := $2 for i in [curl xmllint gunzip sort sha256sum 7z] { if test -z $[which $i !2 >/dev/null] { echo "error: this script requires having $i installed" > !2 exit 1 } } # there is a curl --retry flag but it wasn't working here for some reason proc retry_curl { for i in [$[seq 10]] { curl -fLsS $1 && return #sleep 2 } echo "error: failed to download $1" > !2 exit 1 } global xp := '"xmllint --xpath'" # the local-name() complication here is due to xml namespaces global loc := '"local-name()='" eval $[retry_curl $url/repodata/repomd.xml | $xp "/*[$loc'repomd'] \ /*[$loc'data'][@type='primary']/*[$loc'location']/@href" -] matchstr $href { *.gz { global primary := $[retry_curl $url/$href | gunzip]} * { global primary := $[retry_curl $url/$href]} } # outputs xml string for newest version # don't include arch=src packages, those will list build-time dependencies proc rpm_select { global candidates := ""$[echo $primary | $xp "//*[$loc'package'] \ [./*[$loc'name' and .='$1']][./*[$loc'arch' and .='noarch']]" - \ !2 >/dev/null | sed -e 's|"" # remove rpm namespacing so output can be parsed by xmllint later if test $candidates = "" { echo "error: no package candidates found for $1" > !2 exit 1 } global epochs := ''"" for i in [$[echo $candidates | $xp "/c/package/version/@epoch" -]] { eval $i global epochs := ""$epochs $epoch"" } global maxepoch := $[echo $epochs | sed 's/ /\n/g' | sort -V -u | tail -n 1] global vers := ''"" for i in [$[echo $candidates | $xp "/c/package/version \ [@epoch='$maxepoch']/@ver" -]] { eval $i global vers := ""$vers $ver"" } global maxver := $[echo $vers | sed 's/ /\n/g' | sort -V -u | tail -n 1] global rels := ''"" for i in [$[echo $candidates | $xp "/c/package/version \ [@epoch='$maxepoch'][@ver='$maxver']/@rel" -]] { eval $i global rels := ""$rels $rel"" } global maxrel := $[echo $rels | sed 's/ /\n/g' | sort -V -u | tail -n 1] global repeats := $[echo $rels | sed 's/ /\n/g' | sort -V | uniq -d | tail -n 1] if test $repeats = $maxrel { echo "warning: multiple candidates found for $1 with same version:" > !2 echo "epoch $maxepoch, ver $maxver, rel $maxrel, picking at random" > !2 } echo $candidates | $xp "/c/package[version[@epoch='$maxepoch'] \ [@ver='$maxver'][@rel='$maxrel']][1]" - } for i in [$toinstall] { # fail if no available candidates for requested packages if test -z $[rpm_select $i] { exit 1 } } # outputs package and dll names, e.g. mingw64(zlib1.dll) proc rpm_requires { for i in [$[rpm_select $1 | \ $xp "/package/format/requires/entry/@name" - !2 >/dev/null]] { eval $i echo $name } } # outputs package name, warns if multiple providers with different names proc rpm_provides { global providers := $[echo $primary | $xp "//*[$loc'package'][./*[$loc'format'] \ /*[$loc'provides']/*[$loc'entry'][@name='$1']]/*[$loc'name']" - | \ sed -e 's|||g' -e 's||\n|g' | sort -u] if test $[echo $providers | wc -w] -gt 1 { echo "warning: found multiple providers $providers for $1, adding all" > !2 } echo $providers } global newpkgs := $toinstall global allrequires := ''"" while [ -n "$newpkgs" ] { global newrequires := ''"" for i in [$newpkgs] { for j in [$[rpm_requires $i]] { # leading and trailing spaces to ensure word match matchstr " $allrequires $newrequires " { *" $j "* { # already on list } * { global newrequires := ""$newrequires $j""} } } } global allrequires := ""$allrequires $newrequires"" global newpkgs := ''"" for i in [$newrequires] { global provides := $[rpm_provides $i] matchstr " $toinstall $newpkgs " { *" $provides "* { # already on list } * { global newpkgs := ""$newpkgs $provides""} } } global toinstall := ""$toinstall $newpkgs"" } mkdir -p noarch for i in [$toinstall] { global pkgi := $[rpm_select $i] global checksum := $[echo $pkgi | $xp "/package/checksum/text()" -] eval $[echo $pkgi | $xp "/package/location/@href" -] echo "downloading $href" $[dirname $0]/../../deps/tools/jldownload $href $url/$href echo "$checksum *$href" | sha256sum -c 7z x -y $href global cpiofile := $[basename $href | sed 's/.rpm$/.cpio/] rm $href 7z x -y $cpiofile rm $cpiofile } rmdir --ignore-fail-on-non-empty noarch (CommandList children: [ (C {(set)} {(-e)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:url) op:Equal rhs:{($ VSub_Number "$1")} spids:[21])] spids: [21] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:toinstall) op: Equal rhs: {($ VSub_Number "$2")} spids: [24] ) ] spids: [24] ) (ForEach iter_name: i iter_words: [{(curl)} {(xmllint)} {(gunzip)} {(sort)} {(sha256sum)} {(7z)}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} { (DQ (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(which)} {($ VSub_Name "$i")}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [62] ) ] ) ] ) left_token: spids: [57 64] ) ) } {(Lit_Other "]")} ) terminator: ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("error: this script requires having ") ($ VSub_Name "$i") (" installed")) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[81])] ) (C {(exit)} {(1)}) ] spids: [-1 70] ) ] spids: [-1 90] ) ] spids: [47 92] ) spids: [33 45] ) (FuncDef name: retry_curl body: (BraceGroup children: [ (ForEach iter_name: i iter_words: [ { (CommandSubPart command_list: (CommandList children:[(C {(seq)} {(10)})]) left_token: spids: [111 115] ) } ] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (C {(curl)} {(-fLsS)} {($ VSub_Number "$1")}) (ControlFlow token:) ] op_id: Op_DAmp ) ] spids: [118 136] ) spids: [110 116] ) (SimpleCommand words: [{(echo)} {(DQ ("error: failed to download ") ($ VSub_Number "$1"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[146])] ) (C {(exit)} {(1)}) ] spids: [102] ) spids: [98 101] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:xp) op:Equal rhs:{(DQ ("xmllint --xpath"))} spids:[157])] spids: [157] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:loc) op:Equal rhs:{(DQ ("local-name()="))} spids:[165])] spids: [165] ) (C {(eval)} { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(retry_curl)} {($ VSub_Name "$url") (/repodata/repomd.xml)}) (C {($ VSub_Name "$xp")} { (DQ ("/*[") ($ VSub_Name "$loc") ("'repomd'] ") (" /*[") ($ VSub_Name "$loc") ("'data'][@type='primary']/*[") ($ VSub_Name "$loc") ("'location']/@href") ) } {(-)} ) ] negated: False ) ] ) left_token: spids: [172 195] ) } ) (Case to_match: {($ VSub_Name "$href")} arms: [ (case_arm pat_list: [{(Lit_Other "*") (.gz)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:primary) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(retry_curl)} {($ VSub_Name "$url") (/) ($ VSub_Name "$href")}) (C {(gunzip)}) ] negated: False ) ] ) left_token: spids: [211 221] ) } spids: [210] ) ] spids: [210] ) ] spids: [205 207 222 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:primary) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(retry_curl)} {($ VSub_Name "$url") (/) ($ VSub_Name "$href")}) ] ) left_token: spids: [230 236] ) } spids: [229] ) ] spids: [229] ) ] spids: [225 226 237 -1] ) ] spids: [198 202 239] ) (FuncDef name: rpm_select body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:candidates) op: Equal rhs: { (DQ ("") (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$primary")}) (SimpleCommand words: [ {($ VSub_Name "$xp")} { (DQ ("//*[") ($ VSub_Name "$loc") ("'package'] ") (" [./*[") ($ VSub_Name "$loc") ("'name' and .='") ($ VSub_Number "$1") ("']][./*[") ($ VSub_Name "$loc") ("'arch' and .='noarch']]") ) } {(-)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [285] ) ] ) (C {(sed)} {(-e)} {(SQ <"s|)} {(-e)} {(SQ <"s|)} ) ] negated: False ) ] ) left_token: spids: [258 303] ) ("") ) } spids: [255] ) ] spids: [255] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$candidates"))} {(Lit_Other "=")} {(DQ (""))} {(Lit_Other "]")} ) terminator: ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ("error: no package candidates found for ") ($ VSub_Number "$1"))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[339])] ) (C {(exit)} {(1)}) ] spids: [-1 329] ) ] spids: [-1 348] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:epochs) op:Equal rhs:{(DQ )} spids:[351])] spids: [351] ) (ForEach iter_name: i iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$candidates")}) (C {($ VSub_Name "$xp")} {(DQ ("/c/package/version/@epoch"))} {(-)}) ] negated: False ) ] ) left_token: spids: [362 376] ) } ] do_arg_iter: False body: (DoGroup children: [ (C {(eval)} {($ VSub_Name "$i")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:epochs) op: Equal rhs: {(DQ ($ VSub_Name "$epochs") (" ") ($ VSub_Name "$epoch"))} spids: [387] ) ] spids: [387] ) ] spids: [379 395] ) spids: [361 377] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:maxepoch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$epochs")}) (C {(sed)} {(SQ <"s/ /\\n/g">)}) (C {(sort)} {(-V)} {(-u)}) (C {(tail)} {(-n)} {(1)}) ] negated: False ) ] ) left_token: spids: [399 427] ) } spids: [398] ) ] spids: [398] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:vers) op:Equal rhs:{(DQ )} spids:[430])] spids: [430] ) (ForEach iter_name: i iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$candidates")}) (C {($ VSub_Name "$xp")} { (DQ ("/c/package/version ") (" [@epoch='") ($ VSub_Name "$maxepoch") ("']/@ver") ) } {(-)} ) ] negated: False ) ] ) left_token: spids: [441 459] ) } ] do_arg_iter: False body: (DoGroup children: [ (C {(eval)} {($ VSub_Name "$i")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:vers) op: Equal rhs: {(DQ ($ VSub_Name "$vers") (" ") ($ VSub_Name "$ver"))} spids: [470] ) ] spids: [470] ) ] spids: [462 478] ) spids: [440 460] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:maxver) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$vers")}) (C {(sed)} {(SQ <"s/ /\\n/g">)}) (C {(sort)} {(-V)} {(-u)}) (C {(tail)} {(-n)} {(1)}) ] negated: False ) ] ) left_token: spids: [482 510] ) } spids: [481] ) ] spids: [481] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:rels) op:Equal rhs:{(DQ )} spids:[513])] spids: [513] ) (ForEach iter_name: i iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$candidates")}) (C {($ VSub_Name "$xp")} { (DQ ("/c/package/version ") (" [@epoch='") ($ VSub_Name "$maxepoch") ("'][@ver='") ($ VSub_Name "$maxver") ("']/@rel") ) } {(-)} ) ] negated: False ) ] ) left_token: spids: [524 544] ) } ] do_arg_iter: False body: (DoGroup children: [ (C {(eval)} {($ VSub_Name "$i")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rels) op: Equal rhs: {(DQ ($ VSub_Name "$rels") (" ") ($ VSub_Name "$rel"))} spids: [555] ) ] spids: [555] ) ] spids: [547 563] ) spids: [523 545] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:maxrel) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$rels")}) (C {(sed)} {(SQ <"s/ /\\n/g">)}) (C {(sort)} {(-V)} {(-u)}) (C {(tail)} {(-n)} {(1)}) ] negated: False ) ] ) left_token: spids: [567 595] ) } spids: [566] ) ] spids: [566] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repeats) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$rels")}) (C {(sed)} {(SQ <"s/ /\\n/g">)}) (C {(sort)} {(-V)}) (C {(uniq)} {(-d)}) (C {(tail)} {(-n)} {(1)}) ] negated: False ) ] ) left_token: spids: [599 631] ) } spids: [598] ) ] spids: [598] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$repeats"))} {(Lit_Other "=")} {(DQ ($ VSub_Name "$maxrel"))} {(Lit_Other "]")} ) terminator: ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("warning: multiple candidates found for ") ($ VSub_Number "$1") (" with same version:") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[662])] ) (SimpleCommand words: [ {(echo)} { (DQ ("epoch ") ($ VSub_Name "$maxepoch") (", ver ") ($ VSub_Name "$maxver") (", rel ") ($ VSub_Name "$maxrel") (", picking at random") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[678])] ) ] spids: [-1 651] ) ] spids: [-1 682] ) (Pipeline children: [ (C {(echo)} {($ VSub_Name "$candidates")}) (C {($ VSub_Name "$xp")} { (DQ ("/c/package[version[@epoch='") ($ VSub_Name "$maxepoch") ("'] ") (" [@ver='") ($ VSub_Name "$maxver") ("'][@rel='") ($ VSub_Name "$maxrel") ("']][1]") ) } {(-)} ) ] negated: False ) ] spids: [252] ) spids: [248 251] ) (ForEach iter_name: i iter_words: [{($ VSub_Name "$toinstall")}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(rpm_select)} {($ VSub_Name "$i")})] ) left_token: spids: [733 737] ) ) } {(Lit_Other "]")} ) terminator: ) ] action: [(C {(exit)} {(1)})] spids: [-1 743] ) ] spids: [-1 751] ) ] spids: [719 753] ) spids: [715 717] ) (FuncDef name: rpm_requires body: (BraceGroup children: [ (ForEach iter_name: i iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(rpm_select)} {($ VSub_Number "$1")}) (SimpleCommand words: [ {($ VSub_Name "$xp")} {(DQ ("/package/format/requires/entry/@name"))} {(-)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [789] ) ] ) ] negated: False ) ] ) left_token: spids: [772 791] ) } ] do_arg_iter: False body: (DoGroup children: [(C {(eval)} {($ VSub_Name "$i")}) (C {(echo)} {($ VSub_Name "$name")})] spids: [794 807] ) spids: [771 792] ) ] spids: [763] ) spids: [759 762] ) (FuncDef name: rpm_provides body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:providers) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$primary")}) (C {($ VSub_Name "$xp")} { (DQ ("//*[") ($ VSub_Name "$loc") ("'package'][./*[") ($ VSub_Name "$loc") ("'format'] ") (" /*[") ($ VSub_Name "$loc") ("'provides']/*[") ($ VSub_Name "$loc") ("'entry'][@name='") ($ VSub_Number "$1") ("']]/*[") ($ VSub_Name "$loc") ("'name']") ) } {(-)} ) (C {(sed)} {(-e)} {(SQ <"s|||g">)} {(-e)} {(SQ <"s||\\n|g">)} ) (C {(sort)} {(-u)}) ] negated: False ) ] ) left_token: spids: [823 875] ) } spids: [822] ) ] spids: [822] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$providers")}) (C {(wc)} {(-w)}) ] negated: False ) ] ) left_token: spids: [882 892] ) } {(-gt)} {(1)} {(Lit_Other "]")} ) terminator: ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("warning: found multiple providers ") ($ VSub_Name "$providers") (" for ") ($ VSub_Number "$1") (", adding all") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[914])] ) ] spids: [-1 901] ) ] spids: [-1 918] ) (C {(echo)} {($ VSub_Name "$providers")}) ] spids: [819] ) spids: [815 818] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:newpkgs) op: Equal rhs: {($ VSub_Name "$toinstall")} spids: [928] ) ] spids: [928] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:allrequires) op:Equal rhs:{(DQ )} spids:[931])] spids: [931] ) (While cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$newpkgs"))} {(Lit_Other "]")}) terminator: ) ] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:newrequires) op:Equal rhs:{(DQ )} spids:[951])] spids: [951] ) (ForEach iter_name: i iter_words: [{($ VSub_Name "$newpkgs")}] do_arg_iter: False body: (DoGroup children: [ (ForEach iter_name: j iter_words: [ { (CommandSubPart command_list: (CommandList children: [(C {(rpm_requires)} {($ VSub_Name "$i")})] ) left_token: spids: [974 978] ) } ] do_arg_iter: False body: (DoGroup children: [ (Case to_match: { (DQ (" ") ($ VSub_Name "$allrequires") (" ") ($ VSub_Name "$newrequires") (" ") ) } arms: [ (case_arm pat_list: [ {(Lit_Other "*") (DQ (" ") ($ VSub_Name "$j") (" ")) (Lit_Other "*") } ] spids: [1001 1008 1014 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:newrequires) op: Equal rhs: { (DQ ($ VSub_Name "$newrequires") (" ") ($ VSub_Name "$j")) } spids: [1021] ) ] spids: [1021] ) ] spids: [1017 1018 1027 -1] ) ] spids: [988 998 1030] ) ] spids: [981 1033] ) spids: [973 979] ) ] spids: [965 1036] ) spids: [961 963] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:allrequires) op: Equal rhs: {(DQ ($ VSub_Name "$allrequires") (" ") ($ VSub_Name "$newrequires"))} spids: [1039] ) ] spids: [1039] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:newpkgs) op:Equal rhs:{(DQ )} spids:[1047])] spids: [1047] ) (ForEach iter_name: i iter_words: [{($ VSub_Name "$newrequires")}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:provides) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(rpm_provides)} {($ VSub_Name "$i")})] ) left_token: spids: [1066 1070] ) ) } spids: [1064] ) ] spids: [1064] ) (Case to_match: {(DQ (" ") ($ VSub_Name "$toinstall") (" ") ($ VSub_Name "$newpkgs") (" "))} arms: [ (case_arm pat_list: [ {(Lit_Other "*") (DQ (" ") ($ VSub_Name "$provides") (" ")) (Lit_Other "*") } ] spids: [1087 1094 1100 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:newpkgs) op: Equal rhs: {(DQ ($ VSub_Name "$newpkgs") (" ") ($ VSub_Name "$provides"))} spids: [1107] ) ] spids: [1107] ) ] spids: [1103 1104 1113 -1] ) ] spids: [1074 1084 1116] ) ] spids: [1061 1119] ) spids: [1057 1059] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:toinstall) op: Equal rhs: {(DQ ($ VSub_Name "$toinstall") (" ") ($ VSub_Name "$newpkgs"))} spids: [1122] ) ] spids: [1122] ) ] spids: [948 1129] ) ) (C {(mkdir)} {(-p)} {(noarch)}) (ForEach iter_name: i iter_words: [{($ VSub_Name "$toinstall")}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgi) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(rpm_select)} {($ VSub_Name "$i")})] ) left_token: spids: [1151 1155] ) } spids: [1150] ) ] spids: [1150] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:checksum) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$pkgi")}) (C {($ VSub_Name "$xp")} {(DQ ("/package/checksum/text()"))} {(-)}) ] negated: False ) ] ) left_token: spids: [1159 1173] ) } spids: [1158] ) ] spids: [1158] ) (C {(eval)} { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$pkgi")}) (C {($ VSub_Name "$xp")} {(DQ ("/package/location/@href"))} {(-)}) ] negated: False ) ] ) left_token: spids: [1178 1192] ) } ) (C {(echo)} {(DQ ("downloading ") ($ VSub_Name "$href"))}) (C { (CommandSubPart command_list: (CommandList children:[(C {(dirname)} {(DQ ($ VSub_Number "$0"))})]) left_token: spids: [1203 1209] ) (/../../deps/tools/jldownload) } {($ VSub_Name "$href")} {($ VSub_Name "$url") (/) ($ VSub_Name "$href")} ) (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name "$checksum") (" *") ($ VSub_Name "$href"))}) (C {(sha256sum)} {(-c)}) ] negated: False ) (C {(7z)} {(x)} {(-y)} {($ VSub_Name "$href")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cpiofile) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(basename)} {($ VSub_Name "$href")}) (C {(sed)} {(SQ <"s/.rpm$/.cpio/">)}) ] negated: False ) ] ) left_token: spids: [1244 1256] ) } spids: [1243] ) ] spids: [1243] ) (C {(rm)} {($ VSub_Name "$href")}) (C {(7z)} {(x)} {(-y)} {($ VSub_Name "$cpiofile")}) (C {(rm)} {($ VSub_Name "$cpiofile")}) ] spids: [1147 1277] ) spids: [1143 1145] ) (C {(rmdir)} {(--ignore-fail-on-non-empty)} {(noarch)}) ] )