return tmp
}
-function b_makekey(a, b, s) {
+function b_makekey(a, b, # parameters
+ s) { # locals
s = a "" b
# kill bcond
gsub(/[#%]+{[!?]+[_a-zA-Z0-9]+:/, "", s)
}
# substitutes fixed strings (not regexps)
-function fixedsub(s1,s2,t, ind) {
+function fixedsub(s1,s2,t, # parameters
+ ind) { # locals
if (ind = index(t,s1))
t = substr(t, 1, ind-1) s2 substr(t, ind+length(s1))
return t
}
}
-function format_configure(line, n, a, s) {
+function format_configure(line, # parameters
+ n, a, s) { # locals
n = split(line, a, / /)
s = a[1] " \\\n"
for (i = 2; i <= n; i++) {
# insertion sort of A[1..n]
# copied from mawk manual
-function isort(A,n, i,j,hold) {
+function isort(A,n, # parameters
+ i,j,hold) { # locals
for (i = 2; i <= n; i++) {
hold = A[j = i]
while (A[j-1] > hold) {
# sentinel A[0] = "" will be created if needed
}
+function use_files_macros( # no parameters
+ i, n, t, a, l) { # locals
-function use_files_macros( i, n, t, a, l)
-{
use_macros()
# skip comments
}
}
-function get_epoch(pkg, ver, epoch)
+function get_epoch(pkg, ver, # parameters
+ epoch) # locals
{
return
# should parse the BR lines more adequately:
return epoch
}
-function format_requires(tag, value, n, p, i, deps, ndeps) {
+function format_requires(tag, value, # parameters
+ n, p, i, deps, ndeps) { # locals
# skip any formatting for commented out items or some weird macros
if (/^#/ || /%\(/) {
return tag "\t" value
# {{{ Load rpm macros
# you should update the list also in adapter when making changes here
-function import_rpm_macros( v) {
+function import_rpm_macros( # no parameters
+ v) { # locals
# File with rpm groups
topdir = ENVIRON["_topdir"]
# }}}
# {{{ replace opam names (caml)
-function replace_opam_deps(field, name) {
+function replace_opam_deps(field, # paramters
+ name) { # locals
name = $2
if (name ~ "^(cryptokit|extlib|xmlm)$") {
name = "ocaml-" name
# }}}
# {{{ replace_pkgconfig(pkg)
-function replace_pkgconfig(pkg, cmd, path, n, i, line) {
+function replace_pkgconfig(pkg, # parameters
+ cmd, path, n, i, line) { # locals
n = split("/usr/lib64/pkgconfig /usr/lib/pkgconfig /usr/share/pkgconfig", path, / /)
for (i = 1; i <= n; i++) {
cmd = "rpm -qf --qf '%{N}' " path[i] "/" pkg ".pc"
# }}}
# {{{ replace_perlmod(pkg)
-function replace_perlmod(pkg, version, cmd, line) {
+function replace_perlmod(pkg, version, # parameters
+ cmd, line) { # locals
# do nothing if version is specified
if (version) {
return
# }}}
# {{{ replace_pythonegg(pkg)
-function replace_pythonegg(pkg, cmd, line) {
+function replace_pythonegg(pkg, # parameters
+ cmd, line) { # locals
cmd = "rpm -q --qf '%{N}' --whatprovides 'pythonegg(" pkg ")'"
# Getline returns 0 on end-of-file, -1 on error, otherwise 1.
if ((cmd | getline line) <= 0) {
# }}}
# {{{ replace_requires
-function replace_requires(field, pkg) {
+function replace_requires(field, # parameters
+ pkg) { # locals
# strip %{?_isa}
if ($2 ~ /_isa/) {
$2 = fixedsub("%{?_isa}", "", $2);