diff options
author | Will Dietz <w@wdtz.org> | 2019-03-25 03:04:33 -0500 |
---|---|---|
committer | Will Dietz <w@wdtz.org> | 2019-04-28 10:08:56 -0500 |
commit | c37b3ab88851ee2200d38be74d09851353bd1d02 (patch) | |
tree | 95d16f3c545a1c5122a14aba8f7931a819616faf /maintainers | |
parent | 7bd31a322f5b3c75b801a03ca60e35c03b503267 (diff) |
update-luarocks-packages: simplify server var, whitespace fixup
Diffstat (limited to 'maintainers')
-rwxr-xr-x | maintainers/scripts/update-luarocks-packages | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/maintainers/scripts/update-luarocks-packages b/maintainers/scripts/update-luarocks-packages index aee74dae10cd..e7ab61b1a9c7 100755 --- a/maintainers/scripts/update-luarocks-packages +++ b/maintainers/scripts/update-luarocks-packages @@ -76,11 +76,7 @@ FOOTER=" function convert_pkg () { nix_pkg_name="$1" lua_pkg_name="$2" - server="" - if [ ! -z "$3" ]; then - server=" --server=$3" - fi - + server="${3:+--server=$3}" version="${4:-}" echo "looking at $lua_pkg_name (version $version) from server [$server]" >&2 @@ -101,15 +97,15 @@ echo "$HEADER" | tee "$TMP_FILE" # name,server,version while IFS=, read -r nix_pkg_name lua_pkg_name server version do - if [ "${nix_pkg_name:0:1}" == "#" ]; then - echo "Skipping comment ${nix_pkg_name}" >&2 - continue - fi - if [ -z "$lua_pkg_name" ]; then - echo "Using nix_name as lua_pkg_name" >&2 - lua_pkg_name="$nix_pkg_name" - fi - convert_pkg "$nix_pkg_name" "$lua_pkg_name" "$server" "$version" + if [ "${nix_pkg_name:0:1}" == "#" ]; then + echo "Skipping comment ${nix_pkg_name}" >&2 + continue + fi + if [ -z "$lua_pkg_name" ]; then + echo "Using nix_name as lua_pkg_name" >&2 + lua_pkg_name="$nix_pkg_name" + fi + convert_pkg "$nix_pkg_name" "$lua_pkg_name" "$server" "$version" done < "$CSV_FILE" # close the set |