Opened 5 years ago

Last modified 5 years ago

#15414 new bug

solve_repo_dependencies tool

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Package Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

We're in desperate need of a "solve_repo_dependencies" tool which we can run on binary repo files and get a listing of packages which can not be installed cleanly.

This would be a good sanity check we could run server-side on repositories to validate they are sane.

get_package_dependencies seems like a good potential base. (But instead of depending on the repository and the packages to install against it, it should simply look for "uninstallable" packages based purely on the packages within the specified repository)

Change History (2)

comment:1 by kallisti5, 5 years ago

I tried to hack in usage of get_package_dependencies, but it didn't really work like we need:

#!/bin/bash

BUILD_REPO_DIR="/var/lib/docker/plugins/0b25ebdee8b48451b1459c6c1965570c948ef97028d78e96057a0962b482ce84/propagated-mount/volumes/ci-packages/data/build-packages/master"

if [[ $# -ne 2 ]]; then
        echo "Usage: $0 [ARCH] [RemotePackageRepository File]"
        echo ""
        echo "Example: $0 x86_64 /home/billy/x86_64"
        echo ""
        exit 1
fi

ARCH=$1
REPO=$2
PACKAGES=$(cat $REPO | grep \- | egrep -v ":")
REPO_ID=$(sha256sum $REPO | awk '{ print $1}')

NEEDS=""
for i in $PACKAGES; do
        PACKAGE=$(echo $i | sed -e 's/-[0-9]*$//g')
        RESULTS=$(find $BUILD_REPO_DIR/$REPO_ID/packages/ -name "${PACKAGE}*${ARCH}.hpkg")
        NEEDS=$(echo "${NEEDS} ${RESULTS}")
done

get_package_dependencies $BUILD_REPO_DIR/$REPO_ID/repo -- $NEEDS

comment:2 by kallisti5, 5 years ago

Design goals:

  • Provide cli tool an on-disk repository
  • Tool looks at packages in repo, and solves the dependencies of each.
  • Any "uninstallable" packages are reported back

Nice to haves:

  • Flags to "ignore dependencies" such as packages depending on "haiku"

Example usage:

solve_repo_dependencies --ignore haiku,haiku_userguide my/fancy/repository/repo
Note: See TracTickets for help on using tickets.