summaryrefslogtreecommitdiff
path: root/packagesync-ng
diff options
context:
space:
mode:
authorherkulessi <git@herkulessi.de>2026-04-30 15:11:36 +0200
committerherkulessi <git@herkulessi.de>2026-04-30 15:11:45 +0200
commit40e84259dd39e34095fae2aa8de74487225daa54 (patch)
tree43aa3bb6fe55d585132387d58bd776788d28803f /packagesync-ng
parent5976786bdb4e2c6a33927b13c33e805a93c2c0ce (diff)
Remove Warning and add Warranty disclaiming license
Diffstat (limited to 'packagesync-ng')
-rwxr-xr-xpackagesync-ng66
1 files changed, 0 insertions, 66 deletions
diff --git a/packagesync-ng b/packagesync-ng
deleted file mode 100755
index 664db99..0000000
--- a/packagesync-ng
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env bash
-
-echo "WARNING: This project will happily delete all your packages if you are not careful!"
-echo "To Proceed acknowledge that you have read this by deleting the \`exit 77\` line in this script"
-exit 77
-
-PACKAGE_NAME=herk
-PACKAGE_MAINTAINER="herk <debian@herkulessi.de>"
-
-set -eu
-umask 077
-TEMPDIR=$(mktemp -d -t packagesync-XXXXXXXX)
-
-cd "$TEMPDIR" || exit 1
-
-MISSING_DEPENDENCIES=()
-command -v yq >/dev/null 2>&1 || MISSING_DEPENDENCIES+=(yq)
-command -v equivs-build >/dev/null 2>&1 || MISSING_DEPENDENCIES+=(equivs)
-command -v stat >/dev/null 2>&1 || MISSING_DEPENDENCIES+=(coreutils)
-command -v mktemp >/dev/null 2>&1 || MISSING_DEPENDENCIES+=(coreutils)
-
-set +u
-if [ "${#MISSING_DEPENDENCIES}" -gt 0 ]; then
- echo "Installing missing dependencies:" "${MISSING_DEPENDENCIES[@]}" ...
- apt-get install --no-install-recommends -yq "${MISSING_DEPENDENCIES[@]}"
- echo "Done installing dependencies."
-fi
-set -u
-
-OLD_VERSION=$(dpkg-query --showformat='${Version}' --show "$PACKAGE_NAME" 2>/dev/null || echo 0)
-NEW_VERSION=$(stat -c %Y /etc/packages.yaml)
-
-if [ "$OLD_VERSION" -ge "$NEW_VERSION" ]; then
- cd /
- rm -rf "$TEMPDIR"
- apt-mark manual "$PACKAGE_NAME"
- apt-mark showmanual | grep -v "^${PACKAGE_NAME}$" | xargs apt-mark auto || true # ignore empty list
- apt-get autoremove --purge -yq
- exit 0
-fi
-
-cat > "$PACKAGE_NAME" << EOF
-Section: misc
-Priority: optional
-Standards-Version: 3.9.2
-
-Package: $PACKAGE_NAME
-Version: $NEW_VERSION
-Maintainer: $PACKAGE_MAINTAINER
-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(", ")')
-Description: Metapackage for all needed packages.
- This is a dummy package, depending on other packages to make Package Management easier.
-EOF
-
-equivs-build "$PACKAGE_NAME"
-
-apt-get install -yq --no-install-recommends ./${PACKAGE_NAME}_${NEW_VERSION}_all.deb
-
-apt-mark manual "$PACKAGE_NAME"
-apt-mark showmanual | grep -v "^${PACKAGE_NAME}$" | xargs apt-mark auto || true # ignore empty list
-
-apt-get autoremove -yq --purge
-
-cd /
-rm -rf "$TEMPDIR"