Commit 31646def authored by Vitaly Lipatov's avatar Vitaly Lipatov

add trans_rpmdeps_to_pkgname function for print out real package requires

parent 4781ff42
......@@ -31,10 +31,6 @@ fi
export LC_ALL=C
get_requires()
{
rpm --requires $@ | cut -f1 -d" " | sed -e "s|([A-Z].*||g" | sort -u
}
# Translate rpm requires to package names
rpmreqs_to_apt()
......@@ -74,7 +70,7 @@ install_packages()
docmd $SUDO apt-get install $LIST
ALREADYHANDLEDAPT="$ALREADYHANDLEDAPT $LIST"
REQLIST="$(get_requires $LIST)"
REQLIST="$(get_rpmpkg_requires $LIST)"
REQLIST=$(regexp_exclude_list "$ALREADYHANDLEDRPM" "$REQLIST")
test -n "$REQLIST" || { echog "There is no more req packages to install" ; return ; }
......
#!/bin/bash
# 2003-2008 Etersoft www.etersoft.ru
# 2003-2008, 2012 Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
......@@ -105,3 +105,34 @@ pkg_release_check()
fi
done
}
# copied from aptU
get_rpmpkg_requires()
{
rpmquery --requires $@ | cut -f1 -d" " | sed -e "s|([A-Z].*||g" | sort -u
}
# Translate requires from local rpm package to package names (on local ALT Linux Sisyphus)
# FIXME: do not support x86_64 issues, use only with 32 bit packages
# Use test from tests/test_cget_depends.sh
trans_rpmdeps_to_pkgname()
{
# partially copied from aptU
local ALREADYHANDLEDAPT="bash sh apt rpm filesystem alt-gpgkeys glibc-core glibc-locales"
local ALREADYHANDLEDRPM="rpmlib.* rtld libgcc_s\..* libstdc\+\+.* libc\.so.* ld-linux\.so.* libpthread\.so.* librt\.so.*"
local REQLIST
REQLIST=$(get_rpmpkg_requires -p "$1")
REQLIST=$(regexp_exclude_list "$ALREADYHANDLEDRPM" "$REQLIST")
# partially copied from aptU
VIRTREQ=$(LANG=C apt-get install --print-uris $REQLIST 2>&1 | grep "is a virtual package provided by" | cut -f2 -d" " | sort -u)
TRREALREQ=$(LANG=C apt-get install --print-uris $REQLIST 2>&1 | grep "^Selecting" | cut -f2 -d" " | sort -u)
for ni in $REQLIST $VIRTREQ $TRREALREQ ; do
# drop internal reqs (already converted via apt)
echo $ni | grep -q "/" && continue
echo $ni | grep -q "\.so\." && continue
# extra words when run on x86_64
echo $ni | sed -e "s/^i586-//g" | sed -e "s/\.32bit$//g"
done
}
......@@ -3,7 +3,7 @@
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
ETERBUILDVERSION=196
ETERBUILDVERSION=2011
SUDO="sudo"
......
#!/bin/sh
# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod alt
testfile=$(echo /var/ftp/pub/Etersoft/RX@Etersoft/testing/CentOS/6/nxclient-*.i586.rpm)
trans_rpmdeps_to_pkgname $testfile
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment