summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpkgsync-ng-nt11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgsync-ng-nt b/pkgsync-ng-nt
index e7a40a5..d8c8d8f 100755
--- a/pkgsync-ng-nt
+++ b/pkgsync-ng-nt
@@ -47,6 +47,13 @@ if [ "$OLD_VERSION" -ge "$NEW_VERSION" ]; then
exit 0
fi
+DO_INSTALL="$(< /etc/packages.yaml yq -r '.install | to_entries | map(.value) | add | map(tostring) | join(", ")')"
+if [ -z "$DO_INSTALL" ]; then
+ printf "Package List was empty. Refusing operation for fear of malformed configuration."
+ exit 1
+fi
+DONT_INSTALL="$(< /etc/packages.yaml yq -r '.remove | to_entries | map(.value) | add | map(tostring) | join(", ")')"
+
cat > "$PACKAGE_NAME" << EOF
Section: misc
Priority: optional
@@ -54,8 +61,8 @@ Standards-Version: 3.9.2
Package: $PACKAGE_NAME
Version: $NEW_VERSION
-Depends: $(< /etc/packages.yaml yq -r '.install | to_entries | map(.value) | add | map(tostring) | join(", ")'), apt, coreutils, equivs, findutils, yq
-Conflicts: $(< /etc/packages.yaml yq -r '.remove | to_entries | map(.value) | add | map(tostring) | join(", ")')
+Depends: $DO_INSTALL, apt, coreutils, equivs, findutils, yq
+Conflicts: $DONT_INSTALL
Description: Metapackage for all needed packages.
This is a dummy package, depending on other packages to make Package Management easier.
EOF