LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   SlackPkg trying to upgrade rpm2tgz-1.0-i486-1.txt in -current (http://www.linuxquestions.org/questions/slackware-14/slackpkg-trying-to-upgrade-rpm2tgz-1-0-i486-1-txt-in-current-724859/)

niels.horn 05-09-2009 08:54 AM

SlackPkg trying to upgrade rpm2tgz-1.0-i486-1.txt in -current
 
For those who noticed that "slackpkg upgrade-all" with the -current version of Slackware is trying to upgrade the rpm2tgz-1.0-i486-1.txt package...

The problem seems to be in the update function in SlackPkg that creates the local pkglist file, since the rpm2tgz .txt file has the "tgz" sequence in its name.

I patched /usr/libexec/core-functions.sh as follows:
Code:

--- /usr/libexec/slackpkg/core-functions.sh        2009-04-25 21:56:26.000000000 -0300
+++ core-functions.sh        2009-05-09 10:52:57.000000000 -0300
@@ -749,7 +749,7 @@
        #
        echo -e "\tFormatting lists to slackpkg style..."
        echo -e "\t\tPackage List: using $( basename $FILELIST ) as source"
-        grep ".t[blxg]z" $FILELIST| \
+        grep ".t[blxg]z$" $FILELIST| \
                awk -f /usr/libexec/slackpkg/pkglist.awk |\
                sed -e 's/^M//g' > ${TMPDIR}/pkglist
        cp ${TMPDIR}/pkglist ${WORKDIR}/pkglist

And that seemed to solve the problem. I had to force a "slackpkg update" again to rebuild the local pkglist file.

bgeddy 05-09-2009 09:01 AM

Thanks niels - I have just noticed this problem myself - following your patch now - thanks again..

(I was looking here to see if anyone else had found this and posted on it. I was starting to think it was just me !)

grissiom 05-09-2009 09:35 AM

Quote:

Originally Posted by niels.horn (Post 3535439)
Code:

--- /usr/libexec/slackpkg/core-functions.sh        2009-04-25 21:56:26.000000000 -0300
+++ core-functions.sh        2009-05-09 10:52:57.000000000 -0300
@@ -749,7 +749,7 @@
        #
        echo -e "\tFormatting lists to slackpkg style..."
        echo -e "\t\tPackage List: using $( basename $FILELIST ) as source"
-        grep ".t[blxg]z" $FILELIST| \
+        grep ".t[blxg]z$" $FILELIST| \
                awk -f /usr/libexec/slackpkg/pkglist.awk |\
                sed -e 's/^M//g' > ${TMPDIR}/pkglist
        cp ${TMPDIR}/pkglist ${WORKDIR}/pkglist


I think this patch is insufficient because the dot in the search patten means "any signal character" which is absolutely not what we want to mean. So let the dots be the dots:
Code:

--- /usr/libexec/slackpkg/core-functions.sh        2009-04-25 21:56:26.000000000 -0300
+++ core-functions.sh        2009-05-09 10:52:57.000000000 -0300
@@ -749,7 +749,7 @@
        #
        echo -e "\tFormatting lists to slackpkg style..."
        echo -e "\t\tPackage List: using $( basename $FILELIST ) as source"
-        grep ".t[blxg]z" $FILELIST| \
+        grep "\.t[blxg]z$" $FILELIST| \
                awk -f /usr/libexec/slackpkg/pkglist.awk |\
                sed -e 's/^M//g' > ${TMPDIR}/pkglist
        cp ${TMPDIR}/pkglist ${WORKDIR}/pkglist

Maybe there are other places have the same problem...

niels.horn 05-09-2009 09:43 AM

I had noticed the "dot" error, but I left it alone.
Now the grep command will only pick lines that end with ".t[blxg]z", not any file that ends with "t[blxg]z".

You're right, since we are correcting it, might as well do it the best way possible, to avoid other problems in the future :)


All times are GMT -5. The time now is 03:20 AM.