From 1ea63067b6a845787a705412f38493efa26d69a5 Mon Sep 17 00:00:00 2001 From: Jiankang Fan Date: Sat, 11 Feb 2017 15:03:51 +0900 Subject: [PATCH] revert to old version, use rpm command to query pkgid Because rpm command faster than perl query Change-Id: Ib4dabfb78253779bbdc47aa27d5be085dca2ed4a Signed-off-by: Jiankang Fan --- init_buildsystem | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init_buildsystem b/init_buildsystem index 9d3fd80..2ed0473 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -978,8 +978,13 @@ for PKG in $MAIN_LIST ; do continue fi fi - - PKGID=$(perl -I$BUILD_DIR -MBuild -e Build::showquery "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" buildid) + + # revert use rpm to query pkgid if building rpm package + if test "$PSUF" != "rpm" ; then + PKGID=$(perl -I$BUILD_DIR -MBuild -e Build::showquery "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" buildid) + else + PKGID=`rpm -qp --qf "$RPMIDFMT" $RPMCHECKOPTS_HOST $BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm` + fi if test -f $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG ; then read OLDPKGID < $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG -- 2.7.4