Commit b36b72ce authored by Vitaly Lipatov's avatar Vitaly Lipatov

rewrite trans_rpmdeps_to_pkgname with aptbox/apt-get install using

parent 51f078b2
......@@ -3,7 +3,7 @@
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
load_mod git
load_mod git hasher
is_alt()
{
......@@ -112,6 +112,20 @@ get_rpmpkg_requires()
rpmquery --requires $@ | cut -f1 -d" " | sed -e "s|([A-Z].*||g" | grep -v "^rpmlib" | sort -u
}
convert_pkgfile_to_pkgname()
{
for ni in $@ ; do
# drop internal reqs (already converted via apt)
#echo $ni | grep -q "/" && continue
#echo $ni | grep -q "\.so" && continue
#echo $ni | grep -q ")" && continue
# extra words when run on x86_64
ni=$(querypackage $ni NAME)
echo $ni | sed -e "s/^i586-//g" | sed -e "s/\.32bit$//g"
done | 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
......@@ -123,23 +137,38 @@ trans_rpmdeps_to_pkgname()
local REQLIST="$@"
REQLIST=$(regexp_exclude_list "$ALREADYHANDLEDRPM" "$REQLIST")
REALPKGNAMELIST=$(regexp_exclude_list ". /*" "$REQLIST")
REQCONVLIST=$(do_exclude_list "$REALPKGNAMELIST" "$REQLIST")
set_hasherdir
HASHERDIR=$HASHERDIR-pkgreqs
mkdir -p $HASHERDIR
PKGFILES=$(mkaptbox -f $HASHERDIR && $HASHERDIR/aptbox/apt-get install -qqqy -oRPM::PM=external -oDir::Bin::rpm=hsh-rpmi-print-files $REQCONVLIST)
# 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)
#VIRTREQ=$(LANG=C apt-get install --print-uris $REQLIST 2>&1 | grep "is a virtual package provided by" | cut -f2 -d" " | sort -u)
# FIXME: f.i., we got /usr/bin/lpstat in VIRTREQ (select cups or lprng package?). Skip now
REQLIST=$(regexp_exclude_list "VIRTREQ" "$REQLIST")
#REQLIST=$(regexp_exclude_list "VIRTREQ" "$REQLIST")
TRREALREQ=$(LANG=C apt-get install --print-uris $REQLIST 2>&1 | grep "^Selecting" | cut -f2 -d" " | sort -u)
#TRREALREQ=$(LANG=C apt-get install --print-uris $REQLIST 2>&1 | grep "^Selecting" | cut -f2 -d" " | sort -u)
# remove basesystem packages
ALREADYHANDLEDRPM="bash sh filesystem alt-gpgkeys glibc-core glibc-locales chkconfig service setup shadow-utils"
REQLIST=$(regexp_exclude_list "$ALREADYHANDLEDRPM" "$REQLIST $VIRTREQ $TRREALREQ" )
for ni in $REQLIST ; do
# drop internal reqs (already converted via apt)
echo $ni | grep -q "/" && continue
echo $ni | grep -q "\.so" && continue
echo $ni | grep -q ")" && continue
# extra words when run on x86_64
echo $ni | sed -e "s/^i586-//g" | sed -e "s/\.32bit$//g"
done | sort -u
ALREADYHANDLEDRPM="bash sh filesystem alt-gpgkeys glibc-core glibc-locales glibc-preinstall tcb-utils nss_tcb libtcb chkconfig service setup shadow-utils shadow-convert module-init-tools util-linux-control pam
pam0-config
pam0_mktemp
pam0_passwdqc
pam0_tcb
pam0_userpass
pam-config
pam-config-control
sysvinit-utils
libpam0
libpasswdqc
librpm
ca-certificates
common-licenses
librpmbuild
passwdqc-control"
REQLIST=$(estrlist union $(convert_pkgfile_to_pkgname $PKGFILES) $REALPKGNAMELIST)
REQLIST=$(regexp_exclude_list "$ALREADYHANDLEDRPM" "$REQLIST" )
estrlist union $REQLIST
}
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