Compare commits
19 Commits
v1.9.2
...
b20882f492
| Author | SHA1 | Date | |
|---|---|---|---|
| b20882f492 | |||
| 430f21735e | |||
| acf1b69b70 | |||
| 7d574e67ec | |||
| aad6814fc5 | |||
| 411cd2df66 | |||
| 849d29c044 | |||
| 0947dea01e | |||
| 5d7e1fdbb3 | |||
| ac6981ad4d | |||
| f3a7b69bac | |||
| 5bcad7f5f3 | |||
| d39582d1da | |||
| 043d389a76 | |||
| cc1e543ebc | |||
| 25a0579809 | |||
| d4e461bb63 | |||
| 1864d0700e | |||
| a9bd8d202f |
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -6,6 +6,10 @@ on:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: global-ci-${{ github.repository }}-${{ github.ref_name }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
test-unit:
|
||||
uses: ./.github/workflows/test-unit.yml
|
||||
|
||||
7
.github/workflows/mark-stable.yml
vendored
7
.github/workflows/mark-stable.yml
vendored
@@ -1,12 +1,13 @@
|
||||
name: Mark stable commit
|
||||
|
||||
concurrency:
|
||||
group: mark-${{ github.repository }}-${{ github.ref_name }}
|
||||
cancel-in-progress: false
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # still run tests for main
|
||||
tags:
|
||||
- 'v*' # run tests for version tags (e.g. v0.9.1)
|
||||
|
||||
jobs:
|
||||
test-unit:
|
||||
uses: ./.github/workflows/test-unit.yml
|
||||
|
||||
44
CHANGELOG.md
44
CHANGELOG.md
@@ -1,3 +1,47 @@
|
||||
## [1.12.1] - 2026-02-14
|
||||
|
||||
* pkgmgr now prefers distro-managed nix binaries on Arch before profile/PATH resolution, preventing libllhttp mismatch failures after pacman system upgrades.
|
||||
|
||||
|
||||
## [1.12.0] - 2026-02-08
|
||||
|
||||
* Adds explicit concurrency groups to the CI and mark-stable workflows to prevent overlapping runs on the same branch and make pipeline execution more predictable.
|
||||
|
||||
|
||||
## [1.11.2] - 2026-02-08
|
||||
|
||||
* Removes the v* tag trigger from the mark-stable workflow so it runs only on branch pushes and avoids duplicate executions during releases.
|
||||
|
||||
|
||||
## [1.11.1] - 2026-02-08
|
||||
|
||||
* Implements pushing the branch and the version tag together in a single command so the CI release workflow can reliably detect the version tag on HEAD.
|
||||
|
||||
|
||||
## [1.11.0] - 2026-01-21
|
||||
|
||||
* Adds a dedicated slim Docker image for pkgmgr and publishes slim variants for all supported distros.
|
||||
|
||||
|
||||
## [1.10.0] - 2026-01-20
|
||||
|
||||
* Introduce safe verbose image cleanup to reduce Docker image size and build artifacts
|
||||
|
||||
## [1.9.5] - 2026-01-16
|
||||
|
||||
* Release patch: improve git pull error diagnostics
|
||||
|
||||
|
||||
## [1.9.4] - 2026-01-13
|
||||
|
||||
* fix(ci): replace sudo with su for user switching to avoid PAM failures in minimal container images
|
||||
|
||||
|
||||
## [1.9.3] - 2026-01-07
|
||||
|
||||
* Made the Nix dependency optional on non-x86_64 architectures to avoid broken Arch Linux ARM repository packages.
|
||||
|
||||
|
||||
## [1.9.2] - 2025-12-21
|
||||
|
||||
* Default configuration files are now packaged and loaded correctly when no user config exists, while fully preserving custom user configurations.
|
||||
|
||||
13
Dockerfile
13
Dockerfile
@@ -33,6 +33,7 @@ CMD ["bash"]
|
||||
# - inherits from virgin
|
||||
# - builds + installs pkgmgr
|
||||
# - sets entrypoint + default cmd
|
||||
# - NOTE: does NOT run slim.sh (that is done in slim stage)
|
||||
# ============================================================
|
||||
FROM virgin AS full
|
||||
|
||||
@@ -53,3 +54,15 @@ COPY scripts/docker/entry.sh /usr/local/bin/docker-entry.sh
|
||||
WORKDIR /opt/src/pkgmgr
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entry.sh"]
|
||||
CMD ["pkgmgr", "--help"]
|
||||
|
||||
|
||||
# ============================================================
|
||||
# Target: slim
|
||||
# - based on full
|
||||
# - runs slim.sh
|
||||
# ============================================================
|
||||
FROM full AS slim
|
||||
|
||||
COPY scripts/docker/slim.sh /usr/local/bin/slim.sh
|
||||
RUN chmod +x /usr/local/bin/slim.sh
|
||||
RUN /usr/local/bin/slim.sh
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
rec {
|
||||
pkgmgr = pyPkgs.buildPythonApplication {
|
||||
pname = "package-manager";
|
||||
version = "1.9.2";
|
||||
version = "1.12.1";
|
||||
|
||||
# Use the git repo as source
|
||||
src = ./.;
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
# Maintainer: Kevin Veen-Birkenbach <info@veen.world>
|
||||
|
||||
pkgname=package-manager
|
||||
pkgver=1.9.2
|
||||
pkgver=1.12.1
|
||||
pkgrel=1
|
||||
pkgdesc="Local-flake wrapper for Kevin's package-manager (Nix-based)."
|
||||
arch=('any')
|
||||
url="https://github.com/kevinveenbirkenbach/package-manager"
|
||||
license=('MIT')
|
||||
|
||||
# Nix is the only runtime dependency; Python is provided by the Nix closure.
|
||||
depends=('nix')
|
||||
# Nix is required at runtime to run pkgmgr via the flake.
|
||||
# On Arch x86_64 we can depend on the distro package.
|
||||
# On other arches (e.g. ARM) we only declare it as optional because the
|
||||
# repo package may be broken/out-of-sync; installation can be done via the official installer.
|
||||
depends=()
|
||||
optdepends=('nix: required to run pkgmgr via flake')
|
||||
|
||||
if [[ "${CARCH}" == "x86_64" ]]; then
|
||||
depends=('nix')
|
||||
optdepends=()
|
||||
fi
|
||||
|
||||
makedepends=('rsync')
|
||||
|
||||
install=${pkgname}.install
|
||||
|
||||
@@ -1,3 +1,57 @@
|
||||
package-manager (1.12.1-1) unstable; urgency=medium
|
||||
|
||||
* pkgmgr now prefers distro-managed nix binaries on Arch before profile/PATH resolution, preventing libllhttp mismatch failures after pacman system upgrades.
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Sat, 14 Feb 2026 23:26:17 +0100
|
||||
|
||||
package-manager (1.12.0-1) unstable; urgency=medium
|
||||
|
||||
* Adds explicit concurrency groups to the CI and mark-stable workflows to prevent overlapping runs on the same branch and make pipeline execution more predictable.
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Sun, 08 Feb 2026 18:26:25 +0100
|
||||
|
||||
package-manager (1.11.2-1) unstable; urgency=medium
|
||||
|
||||
* Removes the v* tag trigger from the mark-stable workflow so it runs only on branch pushes and avoids duplicate executions during releases.
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Sun, 08 Feb 2026 18:21:50 +0100
|
||||
|
||||
package-manager (1.11.1-1) unstable; urgency=medium
|
||||
|
||||
* Implements pushing the branch and the version tag together in a single command so the CI release workflow can reliably detect the version tag on HEAD.
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Sun, 08 Feb 2026 18:18:09 +0100
|
||||
|
||||
package-manager (1.11.0-1) unstable; urgency=medium
|
||||
|
||||
* Adds a dedicated slim Docker image for pkgmgr and publishes slim variants for all supported distros.
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Wed, 21 Jan 2026 01:18:31 +0100
|
||||
|
||||
package-manager (1.10.0-1) unstable; urgency=medium
|
||||
|
||||
* Automated release.
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Tue, 20 Jan 2026 10:44:58 +0100
|
||||
|
||||
package-manager (1.9.5-1) unstable; urgency=medium
|
||||
|
||||
* Release patch: improve git pull error diagnostics
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Fri, 16 Jan 2026 10:09:43 +0100
|
||||
|
||||
package-manager (1.9.4-1) unstable; urgency=medium
|
||||
|
||||
* fix(ci): replace sudo with su for user switching to avoid PAM failures in minimal container images
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Tue, 13 Jan 2026 14:48:50 +0100
|
||||
|
||||
package-manager (1.9.3-1) unstable; urgency=medium
|
||||
|
||||
* Made the Nix dependency optional on non-x86_64 architectures to avoid broken Arch Linux ARM repository packages.
|
||||
|
||||
-- Kevin Veen-Birkenbach <kevin@veen.world> Wed, 07 Jan 2026 13:44:40 +0100
|
||||
|
||||
package-manager (1.9.2-1) unstable; urgency=medium
|
||||
|
||||
* Default configuration files are now packaged and loaded correctly when no user config exists, while fully preserving custom user configurations.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Name: package-manager
|
||||
Version: 1.9.2
|
||||
Version: 1.12.1
|
||||
Release: 1%{?dist}
|
||||
Summary: Wrapper that runs Kevin's package-manager via Nix flake
|
||||
|
||||
@@ -74,6 +74,33 @@ echo ">>> package-manager removed. Nix itself was not removed."
|
||||
/usr/lib/package-manager/
|
||||
|
||||
%changelog
|
||||
* Sat Feb 14 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 1.12.1-1
|
||||
- pkgmgr now prefers distro-managed nix binaries on Arch before profile/PATH resolution, preventing libllhttp mismatch failures after pacman system upgrades.
|
||||
|
||||
* Sun Feb 08 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 1.12.0-1
|
||||
- Adds explicit concurrency groups to the CI and mark-stable workflows to prevent overlapping runs on the same branch and make pipeline execution more predictable.
|
||||
|
||||
* Sun Feb 08 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 1.11.2-1
|
||||
- Removes the v* tag trigger from the mark-stable workflow so it runs only on branch pushes and avoids duplicate executions during releases.
|
||||
|
||||
* Sun Feb 08 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 1.11.1-1
|
||||
- Implements pushing the branch and the version tag together in a single command so the CI release workflow can reliably detect the version tag on HEAD.
|
||||
|
||||
* Wed Jan 21 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 1.11.0-1
|
||||
- Adds a dedicated slim Docker image for pkgmgr and publishes slim variants for all supported distros.
|
||||
|
||||
* Tue Jan 20 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 1.10.0-1
|
||||
- Automated release.
|
||||
|
||||
* Fri Jan 16 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 1.9.5-1
|
||||
- Release patch: improve git pull error diagnostics
|
||||
|
||||
* Tue Jan 13 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 1.9.4-1
|
||||
- fix(ci): replace sudo with su for user switching to avoid PAM failures in minimal container images
|
||||
|
||||
* Wed Jan 07 2026 Kevin Veen-Birkenbach <kevin@veen.world> - 1.9.3-1
|
||||
- Made the Nix dependency optional on non-x86_64 architectures to avoid broken Arch Linux ARM repository packages.
|
||||
|
||||
* Sun Dec 21 2025 Kevin Veen-Birkenbach <kevin@veen.world> - 1.9.2-1
|
||||
- Default configuration files are now packaged and loaded correctly when no user config exists, while fully preserving custom user configurations.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "kpmx"
|
||||
version = "1.9.2"
|
||||
version = "1.12.1"
|
||||
description = "Kevin's package-manager tool (pkgmgr)"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.9"
|
||||
|
||||
@@ -33,7 +33,7 @@ Usage: PKGMGR_DISTRO=<distro> $0 [options]
|
||||
Build options:
|
||||
--missing Build only if the image does not already exist (local build only)
|
||||
--no-cache Build with --no-cache
|
||||
--target <name> Build a specific Dockerfile target (e.g. virgin)
|
||||
--target <name> Build a specific Dockerfile target (e.g. virgin, slim)
|
||||
--tag <image> Override the output image tag (default: ${default_tag})
|
||||
|
||||
Publish options:
|
||||
@@ -47,7 +47,7 @@ Publish options:
|
||||
|
||||
Notes:
|
||||
- --publish implies --push and requires --registry, --owner, and --version.
|
||||
- Local build (no --push) uses "docker build" and creates local images like "pkgmgr-arch" / "pkgmgr-arch-virgin".
|
||||
- Local build (no --push) uses "docker build" and creates local images like "pkgmgr-arch" / "pkgmgr-arch-virgin" / "pkgmgr-arch-slim".
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ while [[ $# -gt 0 ]]; do
|
||||
--missing) MISSING_ONLY=1; shift ;;
|
||||
--target)
|
||||
TARGET="${2:-}"
|
||||
[[ -n "${TARGET}" ]] || { echo "ERROR: --target requires a value (e.g. virgin)"; exit 2; }
|
||||
[[ -n "${TARGET}" ]] || { echo "ERROR: --target requires a value (e.g. virgin|slim)"; exit 2; }
|
||||
shift 2
|
||||
;;
|
||||
--tag)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Publish all distro images (full + virgin) to a registry via image.sh --publish
|
||||
# Publish all distro images (full + virgin + slim) to a registry via image.sh --publish
|
||||
#
|
||||
# Required env:
|
||||
# OWNER (e.g. GITHUB_REPOSITORY_OWNER)
|
||||
@@ -11,6 +11,9 @@ set -euo pipefail
|
||||
# REGISTRY (default: ghcr.io)
|
||||
# IS_STABLE (default: false)
|
||||
# DISTROS (default: "arch debian ubuntu fedora centos")
|
||||
#
|
||||
# Notes:
|
||||
# - This expects Dockerfile targets: virgin, full (default), slim
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
@@ -33,7 +36,10 @@ for d in ${DISTROS}; do
|
||||
echo "[publish] PKGMGR_DISTRO=${d}"
|
||||
echo "============================================================"
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# virgin
|
||||
# -> ghcr.io/<owner>/pkgmgr-<distro>-virgin:{latest,<version>,stable?}
|
||||
# ----------------------------------------------------------
|
||||
PKGMGR_DISTRO="${d}" bash "${SCRIPT_DIR}/image.sh" \
|
||||
--publish \
|
||||
--registry "${REGISTRY}" \
|
||||
@@ -42,13 +48,29 @@ for d in ${DISTROS}; do
|
||||
--stable "${IS_STABLE}" \
|
||||
--target virgin
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# full (default target)
|
||||
# -> ghcr.io/<owner>/pkgmgr-<distro>:{latest,<version>,stable?}
|
||||
# ----------------------------------------------------------
|
||||
PKGMGR_DISTRO="${d}" bash "${SCRIPT_DIR}/image.sh" \
|
||||
--publish \
|
||||
--registry "${REGISTRY}" \
|
||||
--owner "${OWNER}" \
|
||||
--version "${VERSION}" \
|
||||
--stable "${IS_STABLE}"
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# slim
|
||||
# -> ghcr.io/<owner>/pkgmgr-<distro>-slim:{latest,<version>,stable?}
|
||||
# + alias for default distro: ghcr.io/<owner>/pkgmgr-slim:{...}
|
||||
# ----------------------------------------------------------
|
||||
PKGMGR_DISTRO="${d}" bash "${SCRIPT_DIR}/image.sh" \
|
||||
--publish \
|
||||
--registry "${REGISTRY}" \
|
||||
--owner "${OWNER}" \
|
||||
--version "${VERSION}" \
|
||||
--stable "${IS_STABLE}" \
|
||||
--target slim
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
130
scripts/docker/slim.sh
Normal file
130
scripts/docker/slim.sh
Normal file
@@ -0,0 +1,130 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
log() { echo "[cleanup] $*"; }
|
||||
warn() { echo "[cleanup][WARN] $*" >&2; }
|
||||
|
||||
MODE="${MODE:-safe}" # safe | aggressive
|
||||
# safe: caches/logs/tmp only
|
||||
# aggressive: safe + docs/man/info (optional)
|
||||
|
||||
ID="unknown"
|
||||
if [ -f /etc/os-release ]; then
|
||||
# shellcheck disable=SC1091
|
||||
. /etc/os-release
|
||||
ID="${ID:-unknown}"
|
||||
fi
|
||||
|
||||
log "Starting image cleanup"
|
||||
log "Mode: ${MODE}"
|
||||
log "Detected OS: ${ID}"
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Package manager caches (SAFE)
|
||||
# ------------------------------------------------------------
|
||||
case "${ID}" in
|
||||
alpine)
|
||||
log "Cleaning apk cache"
|
||||
if [ -d /var/cache/apk ]; then
|
||||
du -sh /var/cache/apk || true
|
||||
rm -rvf /var/cache/apk/* || true
|
||||
else
|
||||
log "apk cache directory not present (already clean)"
|
||||
fi
|
||||
;;
|
||||
arch)
|
||||
log "Cleaning pacman cache"
|
||||
du -sh /var/cache/pacman/pkg 2>/dev/null || true
|
||||
pacman -Scc --noconfirm || true
|
||||
rm -rvf /var/cache/pacman/pkg/* || true
|
||||
;;
|
||||
debian|ubuntu)
|
||||
log "Cleaning apt cache"
|
||||
du -sh /var/lib/apt/lists 2>/dev/null || true
|
||||
apt-get clean || true
|
||||
rm -rvf /var/lib/apt/lists/* || true
|
||||
;;
|
||||
fedora)
|
||||
log "Cleaning dnf cache"
|
||||
du -sh /var/cache/dnf 2>/dev/null || true
|
||||
dnf clean all || true
|
||||
rm -rvf /var/cache/dnf/* || true
|
||||
;;
|
||||
centos|rhel)
|
||||
log "Cleaning yum/dnf cache"
|
||||
du -sh /var/cache/yum /var/cache/dnf 2>/dev/null || true
|
||||
(command -v dnf >/dev/null 2>&1 && dnf clean all) || true
|
||||
(command -v yum >/dev/null 2>&1 && yum clean all) || true
|
||||
rm -rvf /var/cache/yum/* /var/cache/dnf/* || true
|
||||
;;
|
||||
*)
|
||||
warn "Unknown distro '${ID}' — skipping package manager cleanup"
|
||||
;;
|
||||
esac
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Python caches (SAFE)
|
||||
# ------------------------------------------------------------
|
||||
log "Cleaning pip cache"
|
||||
du -sh /root/.cache/pip 2>/dev/null || true
|
||||
rm -rvf /root/.cache/pip 2>/dev/null || true
|
||||
rm -rvf /home/*/.cache/pip 2>/dev/null || true
|
||||
|
||||
log "Cleaning __pycache__ directories"
|
||||
find /opt /usr /root /home -type d -name "__pycache__" -print -prune 2>/dev/null || true
|
||||
find /opt /usr /root /home -type d -name "__pycache__" -prune -exec rm -rvf {} + 2>/dev/null || true
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Logs (SAFE)
|
||||
# ------------------------------------------------------------
|
||||
log "Truncating log files (keeping paths intact)"
|
||||
if [ -d /var/log ]; then
|
||||
find /var/log -type f -name "*.log" -print 2>/dev/null || true
|
||||
find /var/log -type f -name "*.log" -exec sh -lc ': > "$1" 2>/dev/null || true' _ {} \; 2>/dev/null || true
|
||||
|
||||
find /var/log -type f -name "*.out" -print 2>/dev/null || true
|
||||
find /var/log -type f -name "*.out" -exec sh -lc ': > "$1" 2>/dev/null || true' _ {} \; 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if command -v journalctl >/dev/null 2>&1; then
|
||||
log "Vacuuming journald logs"
|
||||
journalctl --disk-usage || true
|
||||
journalctl --vacuum-size=10M || true
|
||||
journalctl --vacuum-time=1s || true
|
||||
journalctl --disk-usage || true
|
||||
else
|
||||
log "journald not present (skipping)"
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Temporary files (SAFE)
|
||||
# ------------------------------------------------------------
|
||||
log "Cleaning temporary directories"
|
||||
if [ -d /tmp ]; then
|
||||
du -sh /tmp 2>/dev/null || true
|
||||
rm -rvf /tmp/* || true
|
||||
fi
|
||||
|
||||
if [ -d /var/tmp ]; then
|
||||
du -sh /var/tmp 2>/dev/null || true
|
||||
rm -rvf /var/tmp/* || true
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Generic caches (SAFE)
|
||||
# ------------------------------------------------------------
|
||||
log "Cleaning generic caches"
|
||||
du -sh /root/.cache 2>/dev/null || true
|
||||
rm -rvf /root/.cache/* 2>/dev/null || true
|
||||
rm -rvf /home/*/.cache/* 2>/dev/null || true
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Optional aggressive extras (still safe for runtime)
|
||||
# ------------------------------------------------------------
|
||||
if [[ "${MODE}" == "aggressive" ]]; then
|
||||
log "Aggressive mode enabled: removing docs/man/info"
|
||||
du -sh /usr/share/doc /usr/share/man /usr/share/info 2>/dev/null || true
|
||||
rm -rvf /usr/share/doc/* /usr/share/man/* /usr/share/info/* 2>/dev/null || true
|
||||
fi
|
||||
|
||||
log "Cleanup finished successfully"
|
||||
@@ -38,11 +38,7 @@ echo "[aur-builder-setup] Configuring sudoers for aur_builder..."
|
||||
${ROOT_CMD} bash -c "echo '%aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman' > /etc/sudoers.d/aur_builder"
|
||||
${ROOT_CMD} chmod 0440 /etc/sudoers.d/aur_builder
|
||||
|
||||
if command -v sudo >/dev/null 2>&1; then
|
||||
RUN_AS_AUR=(sudo -u aur_builder bash -lc)
|
||||
else
|
||||
RUN_AS_AUR=(su - aur_builder -c)
|
||||
fi
|
||||
RUN_AS_AUR=(su - aur_builder -s /bin/bash -c)
|
||||
|
||||
echo "[aur-builder-setup] Ensuring yay is installed for aur_builder..."
|
||||
|
||||
|
||||
@@ -49,11 +49,7 @@ install_nix_with_retry() {
|
||||
if [[ -n "$run_as" ]]; then
|
||||
chown "$run_as:$run_as" "$installer" 2>/dev/null || true
|
||||
echo "[init-nix] Running installer as user '$run_as' ($mode_flag)..."
|
||||
if command -v sudo >/dev/null 2>&1; then
|
||||
sudo -u "$run_as" bash -lc "sh '$installer' $mode_flag"
|
||||
else
|
||||
su - "$run_as" -c "sh '$installer' $mode_flag"
|
||||
fi
|
||||
su - "$run_as" -s /bin/bash -c "bash -lc \"sh '$installer' $mode_flag\""
|
||||
else
|
||||
echo "[init-nix] Running installer as current user ($mode_flag)..."
|
||||
sh "$installer" "$mode_flag"
|
||||
|
||||
@@ -36,16 +36,17 @@ real_exe() {
|
||||
|
||||
# Resolve nix binary path robustly (works across distros + Arch /usr/sbin)
|
||||
resolve_nix_bin() {
|
||||
local nix_cmd=""
|
||||
nix_cmd="$(command -v nix 2>/dev/null || true)"
|
||||
[[ -n "$nix_cmd" ]] && real_exe "$nix_cmd" && return 0
|
||||
|
||||
# IMPORTANT: prefer system locations before /usr/local to avoid self-symlink traps
|
||||
# IMPORTANT: prefer distro-managed locations first.
|
||||
# This avoids pinning /usr/local/bin/nix to a stale user-profile nix binary.
|
||||
[[ -x /usr/sbin/nix ]] && { echo "/usr/sbin/nix"; return 0; } # Arch package can land here
|
||||
[[ -x /usr/bin/nix ]] && { echo "/usr/bin/nix"; return 0; }
|
||||
[[ -x /bin/nix ]] && { echo "/bin/nix"; return 0; }
|
||||
|
||||
# /usr/local last, and only if it resolves to a real executable
|
||||
local nix_cmd=""
|
||||
nix_cmd="$(command -v nix 2>/dev/null || true)"
|
||||
[[ -n "$nix_cmd" ]] && real_exe "$nix_cmd" && return 0
|
||||
|
||||
# /usr/local after system locations, and only if it resolves to a real executable
|
||||
[[ -e /usr/local/bin/nix ]] && real_exe "/usr/local/bin/nix" && return 0
|
||||
|
||||
[[ -x /nix/var/nix/profiles/default/bin/nix ]] && {
|
||||
|
||||
@@ -5,8 +5,8 @@ import sys
|
||||
from typing import Optional
|
||||
|
||||
from pkgmgr.actions.branch import close_branch
|
||||
from pkgmgr.core.git import GitRunError
|
||||
from pkgmgr.core.git.commands import add, commit, push, tag_annotated
|
||||
from pkgmgr.core.git import GitRunError, run
|
||||
from pkgmgr.core.git.commands import add, commit, tag_annotated
|
||||
from pkgmgr.core.git.queries import get_current_branch
|
||||
from pkgmgr.core.repository.paths import resolve_repo_paths
|
||||
|
||||
@@ -133,8 +133,7 @@ def _release_impl(
|
||||
add(existing_files, preview=True)
|
||||
commit(commit_msg, all=True, preview=True)
|
||||
tag_annotated(new_tag, tag_msg, preview=True)
|
||||
push("origin", branch, preview=True)
|
||||
push("origin", new_tag, preview=True)
|
||||
run(["push", "origin", branch, new_tag], preview=True)
|
||||
|
||||
if is_highest_version_tag(new_tag):
|
||||
update_latest_tag(new_tag, preview=True)
|
||||
@@ -156,9 +155,8 @@ def _release_impl(
|
||||
commit(commit_msg, all=True, preview=False)
|
||||
tag_annotated(new_tag, tag_msg, preview=False)
|
||||
|
||||
# Push branch and ONLY the newly created version tag (no --tags)
|
||||
push("origin", branch, preview=False)
|
||||
push("origin", new_tag, preview=False)
|
||||
# Push branch and ONLY the newly created version tag in one command (no --tags)
|
||||
run(["push", "origin", branch, new_tag], preview=False)
|
||||
|
||||
# Update 'latest' only if this is the highest version tag
|
||||
try:
|
||||
|
||||
@@ -29,7 +29,11 @@ def pull_args(
|
||||
try:
|
||||
run(["pull", *extra], cwd=cwd, preview=preview)
|
||||
except GitRunError as exc:
|
||||
details = getattr(exc, "output", None) or getattr(exc, "stderr", None) or ""
|
||||
raise GitPullArgsError(
|
||||
f"Failed to run `git pull` with args={extra!r}.",
|
||||
(
|
||||
f"Failed to run `git pull` with args={extra!r} "
|
||||
f"in cwd={cwd!r}.\n{details}"
|
||||
).rstrip(),
|
||||
cwd=cwd,
|
||||
) from exc
|
||||
|
||||
Reference in New Issue
Block a user