From f0e2486d6c099103e173a996b3a8527b462d4ace Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Mon, 30 Sep 2024 12:55:20 +0800 Subject: [PATCH] Change environment variables to positional arguments Signed-off-by: Egor Savkin --- msys2/make_msys2_packages.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/msys2/make_msys2_packages.sh b/msys2/make_msys2_packages.sh index ccf61c0..ab87996 100755 --- a/msys2/make_msys2_packages.sh +++ b/msys2/make_msys2_packages.sh @@ -24,7 +24,9 @@ pacman --root $MSYS2DIR --config $MSYS2DIR/etc/pacman.conf --cachedir $MSYS2DIR/ --sync --print-format "%l %n" mingw-w64-clang-x86_64-qt-installer-framework > $MSYS2DIR/qt_ifw_packages.txt function generate_nix_packages_from_pacman() { - echo "{ pkgs } : [" > $OUT + local in=$1 + local out=$2 + echo "{ pkgs } : [" > $out while IFS= read -r line; do read -r url package <<< "$line" hash=$(nix-prefetch-url $url --name $package) @@ -33,11 +35,11 @@ function generate_nix_packages_from_pacman() { url = \"$url\"; name = \"$package\"; sha256 = \"$hash\"; - })" >> $OUT - done < $IN - echo "]" >> $OUT + })" >> $out + done < $in + echo "]" >> $out } -IN=$MSYS2DIR/packages.txt OUT=msys2_packages.nix generate_nix_packages_from_pacman -IN=$MSYS2DIR/qt_ifw_packages.txt OUT=msys2_qt_ifw_packages.nix generate_nix_packages_from_pacman -IN=$MSYS2DIR/artiq_dependency_packages.txt OUT=artiq_dependency_packages.nix generate_nix_packages_from_pacman +generate_nix_packages_from_pacman $MSYS2DIR/packages.txt msys2_packages.nix +generate_nix_packages_from_pacman $MSYS2DIR/qt_ifw_packages.txt msys2_qt_ifw_packages.nix +generate_nix_packages_from_pacman $MSYS2DIR/artiq_dependency_packages.txt artiq_dependency_packages.nix