Lines 90-97
function find_replaced_crates(input, output, in_patch_crates_io, line, cols) {
Link Here
|
90 |
close(output) |
90 |
close(output) |
91 |
} |
91 |
} |
92 |
|
92 |
|
93 |
function add_crates_io_patches( header_printed, cmd, cargotoml, source, crates) { |
93 |
function add_crates_io_patches( print_header, local_crates, cmd, cargotoml, source, crates) { |
94 |
header_printed = 0 |
94 |
print_header = 0 |
95 |
# --exclude-dir not supported on FreeBSD < 13 |
95 |
# --exclude-dir not supported on FreeBSD < 13 |
96 |
# cmd = GREP " --include='*/Cargo.toml' --exclude-dir='" CARGO_VENDOR_DIR "' -Flr 'patch.crates-io' " WRKSRC |
96 |
# cmd = GREP " --include='*/Cargo.toml' --exclude-dir='" CARGO_VENDOR_DIR "' -Flr 'patch.crates-io' " WRKSRC |
97 |
cmd = FIND " " WRKSRC " -name Cargo.toml -not -path '" CARGO_VENDOR_DIR "/*' -exec " GREP " -Flr 'patch.crates-io' {} \\\+" |
97 |
cmd = FIND " " WRKSRC " -name Cargo.toml -not -path '" CARGO_VENDOR_DIR "/*' -exec " GREP " -Flr 'patch.crates-io' {} \\\+" |
Lines 106-121
function add_crates_io_patches( header_printed, cmd, cargotoml, source, crates)
Link Here
|
106 |
split(source_crates[source], crates) |
106 |
split(source_crates[source], crates) |
107 |
for (j in crates) { |
107 |
for (j in crates) { |
108 |
if (replaced_crates[crates[j]]) { |
108 |
if (replaced_crates[crates[j]]) { |
109 |
if (!header_printed) { |
109 |
print_header = 1 |
110 |
printf("[patch.crates-io]\n") |
110 |
local_crates[crates[j]] = get_source_dir(source, crates[j]) |
111 |
header_printed = 1 |
|
|
112 |
} |
113 |
printf("%s = { path = '%s' }\n", crates[j], get_source_dir(source, crates[j])) |
114 |
} |
111 |
} |
115 |
} |
112 |
} |
116 |
} |
113 |
} |
117 |
} |
114 |
} |
118 |
} |
115 |
} |
|
|
116 |
if (print_header == 1) { |
117 |
printf("[patch.crates-io]\n") |
118 |
|
119 |
for (i in local_crates) { |
120 |
printf("%s = { path = '%s' }\n", i, local_crates[i]) |
121 |
} |
122 |
} |
119 |
close(cmd) |
123 |
close(cmd) |
120 |
} |
124 |
} |
121 |
|
125 |
|