From d54932b9b1aabcffd2baac36db87f432013a4df0 Mon Sep 17 00:00:00 2001 From: Dmitrii Krosh Date: Tue, 21 Jul 2026 00:55:16 +0300 Subject: [PATCH] fix bug in check_sisyphus_set_relations.sh --- .gitignore | 2 ++ scripts/rpmsetcmp/check_sisyphus_set_relations.sh | 6 ++++-- tests/test_check_sisyphus_set_relations.py | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3b1bb31..ccdfdb0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *.o +tt + # Generated benchmark results /res/ /res_cmp/ diff --git a/scripts/rpmsetcmp/check_sisyphus_set_relations.sh b/scripts/rpmsetcmp/check_sisyphus_set_relations.sh index 60858b1..8455967 100755 --- a/scripts/rpmsetcmp/check_sisyphus_set_relations.sh +++ b/scripts/rpmsetcmp/check_sisyphus_set_relations.sh @@ -6,7 +6,7 @@ MIRROR=https://ftp.altlinux.org/pub/distributions/ALTLinux REQUIRE_LIMIT=100 SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) -REPO_ROOT=$(cd -- "$SCRIPT_DIR/.." && pwd) +REPO_ROOT=$(cd -- "$SCRIPT_DIR/../.." && pwd) WORK=$(mktemp -d "${TMPDIR:-/tmp}/arsv-set-check.XXXXXX") trap 'rm -rf "$WORK"' EXIT @@ -64,7 +64,8 @@ EOF fetch_metadata() { - mkdir -p "$WORK/apt/lists/partial" "$WORK/apt/archives/partial" + mkdir -p "$WORK/apt/lists/partial" "$WORK/apt/archives/partial" \ + "$WORK/root/var/lib/rpm" : >"$WORK/apt/apt.conf" : >"$WORK/apt/status" printf '%s\n' \ @@ -82,6 +83,7 @@ fetch_metadata() -o "Dir::Cache::archives=$WORK/apt/archives" -o "Dir::Cache::pkgcache=$WORK/apt/pkgcache.bin" -o "Dir::Cache::srcpkgcache=$WORK/apt/srcpkgcache.bin" + -o "RPM::RootDir=$WORK/root" ) APT_CONFIG="$WORK/apt/apt.conf" apt-get "${options[@]}" -qq update diff --git a/tests/test_check_sisyphus_set_relations.py b/tests/test_check_sisyphus_set_relations.py index c3ac7d7..3fb38d1 100644 --- a/tests/test_check_sisyphus_set_relations.py +++ b/tests/test_check_sisyphus_set_relations.py @@ -6,7 +6,7 @@ from pathlib import Path REPO_ROOT = Path(__file__).resolve().parents[1] -SCRIPT = REPO_ROOT / "scripts" / "check_sisyphus_set_relations.sh" +SCRIPT = REPO_ROOT / "scripts" / "rpmsetcmp" / "check_sisyphus_set_relations.sh" PROVIDER_SET = "set:jg2ZwFjdTD2B0" REQUIRED_SET = "set:jiXMb" @@ -22,12 +22,15 @@ def run_with_metadata( (fake_bin / "apt-get").write_text( """#!/bin/sh archive= +rpm_root= for argument in "$@"; do case $argument in Dir::Cache::archives=*) archive=${argument#*=} ;; + RPM::RootDir=*) rpm_root=${argument#*=} ;; esac done [ -n "$archive" ] && [ -d "$archive/partial" ] +[ -n "$rpm_root" ] && [ -d "$rpm_root/var/lib/rpm" ] """, encoding="utf-8", )