Query RPM for the location of the RPM topdir, instead of guessing,
which failed on YDEL6 (/usr/src/yellowdog) and Debian/Ubuntu (/usr/src/rpm)

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
 testcases/commands/ade/file/file_test.sh |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/testcases/commands/ade/file/file_test.sh 
b/testcases/commands/ade/file/file_test.sh
index f59b0c6..5fa287b 100755
--- a/testcases/commands/ade/file/file_test.sh
+++ b/testcases/commands/ade/file/file_test.sh
@@ -474,13 +474,8 @@ export TST_COUNT=9
 $LTPBIN/tst_resm TINFO "TEST #9: file command recognizes RPM files"
 `type rpm &> /dev/null`
 if [ $? = 0 ]; then
-if [ -f /etc/redhat-release ]; then
-       bDIR=/usr/src/redhat
-       bCMD=rpmbuild
-else
-       bDIR=/usr/src/packages
-       bCMD=rpmbuild
-fi
+bDIR=$(rpm --eval "%{_topdir}")
+bCMD=rpmbuild
 
 rpmversion=`rpm --version | awk -F ' ' '{print $3}' | cut -d '.' -f1 `
 
-- 
1.6.2.4

With kind regards,

Geert Uytterhoeven
Software Architect
Techsoft Centre

Technology and Software Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   [email protected]
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to