From 3b3251a9555a39af11d172f9aa322d268f61f159 Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Thu, 1 Jun 2006 19:52:44 +0000 Subject: [PATCH] Fixed a bug in wrt_remove_existing_dirs when both bz2 and gz version of the same package are found in sources dir. --- common/common-functions | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/common-functions b/common/common-functions index e82870d..8b61da2 100644 --- a/common/common-functions +++ b/common/common-functions @@ -214,7 +214,8 @@ wrt_remove_existing_dirs() { # local PKG_NAME=$1 ( cat << EOF - @ROOT=\`tar -tf \$(MOUNT_PT)\$(SRC)/${PKG_NAME} | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\ + @PKG_PATH=\`ls -t \$(MOUNT_PT)\$(SRC)/${PKG_NAME} | head -n1\` && \\ + ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\ [[ -n \$\$ROOT ]] && \\ rm -rf \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\ if [ -e \$(MOUNT_PT)\$(SRC)/${PKG_NAME%%-*}-build ]; then \\ @@ -230,7 +231,8 @@ wrt_remove_existing_dirs2() { # local PKG_NAME=$1 ( cat << EOF - @ROOT=\`tar -tf \$(SRC)/${PKG_NAME} | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\ + @PKG_PATH=\`ls -t \$(SRC)/${PKG_NAME} | head -n1\` && \\ + ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\ [[ -n \$\$ROOT ]] && \\ rm -rf \$(SRC)/\$\$ROOT && \\ if [ -e \$(SRC)/${PKG_NAME%%-*}-build ]; then \\