2013-03-17

Slitaz -- tazpkg rdepends

tazpkg rdepends: syntax error

-    for (i = 1, n = split(deps[pkg], mydeps, " "); i <= n; i++) {
+    for (i = 1; i <= split(deps[pkg], mydeps, " "); i++) {


Env: slitaz-4.0-firefox hd install.
tux@slitaz:~$ uname -a
Linux slitaz 2.6.37-slitaz #2 SMP Wed Mar 7 10:36:39 CET 2012 i686 GNU/Linux


1.
tux@slitaz:~$ tazpkg rdepends binutils
awk: cmd. line:7:     for (i = 1, n = split(deps[pkg], mydeps, " "); i <= n; i++) {
awk: cmd. line:7:               ^ syntax error
awk: cmd. line:7:     for (i = 1, n = split(deps[pkg], mydeps, " "); i <= n; i++) {
awk: cmd. line:7:                                                               ^ syntax error


2.
tux@slitaz:~$ tazpkg list | grep awk
gawk                    3.1.8             development


3.
tazpkg: gawk do not like rdepend (thanks tkoun)
http://hg.slitaz.org/tazpkg/rev/889e293abdc7
tazpkg changeset 623:889e293abdc7
tazpkg: gawk do not like rdepend (thanks tkoun)
author     Pascal Bellard <pascal.bellard@slitaz.org>
date     Fri Jan 18 14:56:42 2013 +0100 (8 weeks ago ago)
parents     bf40947983cf
children     38be19551677
files     tazpkg
line diff

     1.1 --- a/tazpkg    Mon Jan 07 17:12:03 2013 +0000
     1.2 +++ b/tazpkg    Fri Jan 18 14:56:42 2013 +0100
     1.3 @@ -1008,7 +1008,7 @@
     1.4      DEPENDS=""
     1.5      . $i/receipt
     1.6      echo "$i $(echo $DEPENDS)"
     1.7 -done | awk -v search=$SEARCH '
     1.8 +done | busybox awk -v search=$SEARCH '
     1.9  function show_deps(deps, all_deps, pkg, space)
    1.10  {
    1.11      if (all_deps[pkg] == 1) return


4.
Env:slitaz-4.0-firefox tazpkg-4.9.2
--- tazpkg-orig
+++ tazpkg
@@ -1028,7 +1028,7 @@
     if (all_deps[pkg] == 1) return
     all_deps[pkg] = 1
     if (space != "") printf "%s %s\n",space,pkg
-    for (i = 1, n = split(deps[pkg], mydeps, " "); i <= n; i++) {
+    for (i = 1; i <= split(deps[pkg], mydeps, " "); i++) {
         show_deps(deps, all_deps, mydeps[i],"==" space)
     }
 }

.