#6 brt_dep_solver.sh: multiple fixes
Merged 7 years ago by mkocka. Opened 7 years ago by ttomecek.
modularity/ ttomecek/modularity-tools fix-brt-dep-solver  into  master

file modified
+4 -10
@@ -1,6 +1,6 @@ 

  #!/bin/bash

  

- #set -e

+ # set -ex

  pkg=${1}

  

  CLEAN=${CLEAN:-true}
@@ -16,15 +16,9 @@ 

  function get-baseruntime-caps {

  

      provided_caps=brt-provides.txt

-     verbose_echo -n "Getting list of base-runtime rpms... "

-     wget --quiet -O api.txt  https://github.com/fedora-modularity/base-runtime/blob/master/api.txt?raw=true && verbose_echo "DONE"

- 

-     verbose_echo -n "Modifying list of base-runtime rpms.."

-     # get package name of rpms on lines starting with '+', '*', or nothing

-     cat api.txt | sed '/^!/ d' | sed $'s/[+*]\t//g' | sed -e "s/-[^-]*-[^-]*$//" > brt-pkgs.txt && verbose_echo "DONE"

  

      verbose_echo -n "Getting capabilities provided by base-runtime packages... "

-     dnf repoquery --repofrompath brt,https://fedorapeople.org/groups/modularity/repos/base-runtime/26/ --provides -q `paste -s -d ' ' brt-pkgs.txt` > ${provided_caps} && verbose_echo "DONE"

+     dnf repoquery --disablerepo='*' --repofrompath brt,https://kojipkgs.stg.fedoraproject.org/compose/branched/jkaluza/latest-Boltron-26/compose/base-runtime/x86_64/os/ --enablerepo=brt --provides -q > ${provided_caps} && verbose_echo "DONE"

  

  }

  
@@ -53,7 +47,7 @@ 

      # TODO: use remote path for fedora repository

      SRPM_FLAG=

      [ "${runtime}" = "true" ] || SRPM_FLAG=--srpm

-       dnf --repofrompath fedora.repo,/etc/yum.repos.d/fedora.repo repoquery $SRPM_FLAG --requires -q ${pkg} > ${pkg}-caps.txt && verbose_echo "DONE"

+       dnf --disablerepo='*' --repofrompath f26,http://ftp.fi.muni.cz/pub/linux/fedora/linux/development/26/Everything/x86_64/os/ --enablerepo=f26 repoquery $SRPM_FLAG --requires -q ${pkg} > ${pkg}-caps.txt && verbose_echo "DONE"

      while read cap; do

        if [[ $cap != *" = "* ]]; then

          grep -wq "^${cap}*" ${provided_caps} || echo ${cap} >> ${pkg}-filtered-caps.txt
@@ -63,7 +57,7 @@ 

      done < ${pkg}-caps.txt

  

      while read cap; do

-       dnf repoquery --whatprovides ${cap} -q --latest-limit=1 >> cap2rpm.txt

+       dnf --disablerepo='*' --repofrompath f26,http://ftp.fi.muni.cz/pub/linux/fedora/linux/development/26/Everything/x86_64/os/ --enablerepo=f26 repoquery --whatprovides "${cap}" -q --latest-limit=1 >> cap2rpm.txt

      done < ${pkg}-filtered-caps.txt

  

      if [ "$runtime" = "true" ]; then

  • use f26 repo (which is in Brno, we should probably make this easy for
    our friends in Germany and US, not sure if mirrorlist works here)

  • use BRT staging compose; contyk & jkaluza confirmed it should be okay

  • get all caps from base-runtime repo: don't care about api.txt since
    repo has all we need

  • disable all repos for every dnf invocation b/c it messes up results
    greatly

  • please rewrite the script into python, this version in shell was a
    great prototype

Signed-off-by: Tomas Tomecek ttomecek@redhat.com

line 22 and 33 seem to pull in dependencies from packages on your local system as well.
(If it doesn't happen on your system, maybe that's a bug in F24 dnf)

1 new commit added

  • revert setting SRPM_FLAG
7 years ago

@karsten very good point; it did on my f22, it does not on rawhide

f22

dnf-plugins-core-0.1.19-1.fc22.noarch

rawhide

dnf-plugins-core-1.1.0-1.fc27.noarch

rebased

7 years ago

Pull-Request has been merged by mkocka

7 years ago
Metadata