diff options
author | joerg <joerg@pkgsrc.org> | 2011-12-07 15:18:51 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2011-12-07 15:18:51 +0000 |
commit | 9556bfbc322d044ea614fdb34250130d323c312e (patch) | |
tree | 212e6d3ab3aa83c80f905720fd917e55f855c232 /net/tcptrace | |
parent | c61c0609184c240dec2f67818540c704223d0033 (diff) | |
download | pkgsrc-9556bfbc322d044ea614fdb34250130d323c312e.tar.gz |
Don't use "bool" as struct member. Fix flex/bison usage
Diffstat (limited to 'net/tcptrace')
-rw-r--r-- | net/tcptrace/Makefile | 4 | ||||
-rw-r--r-- | net/tcptrace/distinfo | 7 | ||||
-rw-r--r-- | net/tcptrace/patches/patch-aa | 32 | ||||
-rw-r--r-- | net/tcptrace/patches/patch-filt__parser.y | 22 | ||||
-rw-r--r-- | net/tcptrace/patches/patch-filter.c | 147 | ||||
-rw-r--r-- | net/tcptrace/patches/patch-filter.h | 13 |
6 files changed, 221 insertions, 4 deletions
diff --git a/net/tcptrace/Makefile b/net/tcptrace/Makefile index 718df9bffaf..e97e9af7a7a 100644 --- a/net/tcptrace/Makefile +++ b/net/tcptrace/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.32 2010/02/11 22:59:14 joerg Exp $ +# $NetBSD: Makefile,v 1.33 2011/12/07 15:18:51 joerg Exp $ DISTNAME= tcptrace-6.6.7 CATEGORIES= net @@ -12,6 +12,8 @@ PKG_DESTDIR_SUPPORT= user-destdir GNU_CONFIGURE= yes +USE_TOOLS+= bison flex + BUILD_TARGET= tcptrace DOCFILES= COPYRIGHT FAQ README README.tput_graphs diff --git a/net/tcptrace/distinfo b/net/tcptrace/distinfo index 91658e8b585..9bf1dc4c5f0 100644 --- a/net/tcptrace/distinfo +++ b/net/tcptrace/distinfo @@ -1,6 +1,9 @@ -$NetBSD: distinfo,v 1.7 2005/08/26 08:32:13 adam Exp $ +$NetBSD: distinfo,v 1.8 2011/12/07 15:18:51 joerg Exp $ SHA1 (tcptrace-6.6.7.tar.gz) = ae4d10a0829c57f2eda17e63f593e558f52b7f24 RMD160 (tcptrace-6.6.7.tar.gz) = 1dd0f373f766322343ffad59d0655eba4c6682e0 Size (tcptrace-6.6.7.tar.gz) = 3773308 bytes -SHA1 (patch-aa) = c2ff30c18659f803160fbb0567acdffbbd1b4b60 +SHA1 (patch-aa) = a17e39cd2a944c3f439849feeb0eb0b957cd97b2 +SHA1 (patch-filt__parser.y) = ac7c510d6bf231496e9c6b459c7a97d98531dbaf +SHA1 (patch-filter.c) = 3058ee8b08ceca99b38ae772b51d26df91de6d9c +SHA1 (patch-filter.h) = 6e8170f63938e4e3b2c8c97ea9361d707af2f8bb diff --git a/net/tcptrace/patches/patch-aa b/net/tcptrace/patches/patch-aa index a6a4ef0dd9b..7368d720ff9 100644 --- a/net/tcptrace/patches/patch-aa +++ b/net/tcptrace/patches/patch-aa @@ -1,4 +1,4 @@ -$NetBSD: patch-aa,v 1.8 2005/08/26 08:32:13 adam Exp $ +$NetBSD: patch-aa,v 1.9 2011/12/07 15:18:51 joerg Exp $ --- Makefile.in.orig 2004-03-04 20:33:56.000000000 +0000 +++ Makefile.in @@ -48,3 +48,33 @@ $NetBSD: patch-aa,v 1.8 2005/08/26 08:32:13 adam Exp $ # # special rules for scanner/parser +@@ -210,26 +210,11 @@ YACC_VAL=@YACC@ + LEX_VAL=@LEX@ + + filt_parser.c: filt_parser.y filter.h +- if test "${YACC_VAL}" = "bison -y" ; then \ +- @YACC@ -vd -p filtyy -o filt_parser.c $(srcdir)/filt_parser.y ;\ +- cp filt_parser.c flex_bison ;\ +- cp filt_parser.h flex_bison ;\ +- else \ +- echo "Could not find BISON on this system";\ +- echo "Copying the BISON output files generated at our place" ;\ +- cp flex_bison/filt_parser.c . ;\ +- cp flex_bison/filt_parser.h . ;\ +- fi ++ @YACC@ -vd -p filtyy -o filt_parser.c $(srcdir)/filt_parser.y + + filt_scanner.c: filt_scanner.l filter.h filt_parser.h +- if test ${LEX_VAL} = "flex" ; then \ +- @LEX@ -t -Pfiltyy $(srcdir)/filt_scanner.l > filt_scanner.c ;\ +- cp filt_scanner.c flex_bison ;\ +- else \ +- echo "Could not find FLEX on this system" ;\ +- echo "Copying the FLEX output files generated at our place" ;\ +- cp flex_bison/filt_scanner.c . ;\ +- fi ++ @LEX@ -t -Pfiltyy $(srcdir)/filt_scanner.l > filt_scanner.c ++ cp filt_scanner.c flex_bison + + # filt_parser.h created as a side effect of running yacc... + filt_parser.h: filt_parser.c diff --git a/net/tcptrace/patches/patch-filt__parser.y b/net/tcptrace/patches/patch-filt__parser.y new file mode 100644 index 00000000000..28fd8e92629 --- /dev/null +++ b/net/tcptrace/patches/patch-filt__parser.y @@ -0,0 +1,22 @@ +$NetBSD: patch-filt__parser.y,v 1.1 2011/12/07 15:18:51 joerg Exp $ + +--- filt_parser.y.orig 2001-05-31 20:54:59.000000000 +0000 ++++ filt_parser.y +@@ -72,7 +72,7 @@ + long signed_long; + u_long unsigned_long; + ipaddr *pipaddr; +- Bool bool; ++ Bool boolean; + enum optype op; + struct filter_node *pf; + } +@@ -99,7 +99,7 @@ + %token <string> VARIABLE STRING + %token <signed_long> SIGNED + %token <unsigned_long> UNSIGNED +-%token <bool> BOOL ++%token <boolean> BOOL + %token <pipaddr> IPADDR + %type <op> relop + %type <pf> expr leaf number diff --git a/net/tcptrace/patches/patch-filter.c b/net/tcptrace/patches/patch-filter.c new file mode 100644 index 00000000000..8fc9bee3253 --- /dev/null +++ b/net/tcptrace/patches/patch-filter.c @@ -0,0 +1,147 @@ +$NetBSD: patch-filter.c,v 1.1 2011/12/07 15:18:51 joerg Exp $ + +--- filter.c.orig 2003-11-19 14:38:02.000000000 +0000 ++++ filter.c +@@ -534,7 +534,7 @@ MakeBoolConstNode( + pf = MallocZ(sizeof(struct filter_node)); + + pf->vartype = V_BOOL; +- pf->un.constant.bool = val; ++ pf->un.constant.boolean = val; + + return(pf); + } +@@ -624,9 +624,9 @@ PrintConst( + break; + case V_BOOL: + if (debug) +- snprintf(buf,sizeof(buf),"BOOL(%s)", BOOL2STR(pf->un.constant.bool)); ++ snprintf(buf,sizeof(buf),"BOOL(%s)", BOOL2STR(pf->un.constant.boolean)); + else +- snprintf(buf,sizeof(buf),"%s", BOOL2STR(pf->un.constant.bool)); ++ snprintf(buf,sizeof(buf),"%s", BOOL2STR(pf->un.constant.boolean)); + break; + case V_IPADDR: + if (debug) +@@ -716,7 +716,7 @@ Res2Str( + case V_ULLONG: snprintf(buf,sizeof(buf),"ULLONG(%" FS_ULL ")",pres->val.u_longint); break; + case V_LLONG: snprintf(buf,sizeof(buf),"LLONG(%" FS_LL ")",pres->val.longint); break; + case V_STRING: snprintf(buf,sizeof(buf),"STRING(%s)",pres->val.string); break; +- case V_BOOL: snprintf(buf,sizeof(buf),"BOOL(%s)", BOOL2STR(pres->val.bool)); break; ++ case V_BOOL: snprintf(buf,sizeof(buf),"BOOL(%s)", BOOL2STR(pres->val.boolean)); break; + default: { + fprintf(stderr,"Res2Str: unknown constant type %d (%s)\n", + pres->vartype, Vartype2Str(pres->vartype)); +@@ -1219,7 +1219,7 @@ EvalRelopUnsigned( + + /* fill in the answer */ + pres->vartype = V_BOOL; +- pres->val.bool = ret; ++ pres->val.boolean = ret; + + if (debug) + printf("EvalUnsigned %" FS_ULL " %s %" FS_ULL " returns %s\n", +@@ -1267,7 +1267,7 @@ EvalRelopSigned( + + /* fill in the answer */ + pres->vartype = V_BOOL; +- pres->val.bool = ret; ++ pres->val.boolean = ret; + + if (debug) + printf("EvalSigned %" FS_LL " %s %" FS_LL " returns %s\n", +@@ -1329,7 +1329,7 @@ EvalRelopIpaddr( + + /* fill in the answer */ + pres->vartype = V_BOOL; +- pres->val.bool = ret; ++ pres->val.boolean = ret; + + if (debug) { + printf("EvalIpaddr %s %s", HostAddr(*varl), Op2Str(pf->op)); +@@ -1382,7 +1382,7 @@ EvalRelopString( + + /* fill in the answer */ + pres->vartype = V_BOOL; +- pres->val.bool = ret; ++ pres->val.boolean = ret; + + if (debug) + printf("EvalString '%s' %s '%s' returns %s\n", +@@ -1425,7 +1425,7 @@ EvalVariable( + + case V_BOOL: + pres->vartype = V_BOOL; +- pres->val.bool = (Var2Unsigned(ptp,pf) != 0); ++ pres->val.boolean = (Var2Unsigned(ptp,pf) != 0); + break; + + case V_IPADDR: +@@ -1475,7 +1475,7 @@ EvalConstant( + + case V_BOOL: + pres->vartype = V_BOOL; +- pres->val.bool = (Var2Unsigned(ptp,pf) != 0); ++ pres->val.boolean = (Var2Unsigned(ptp,pf) != 0); + break; + + case V_IPADDR: +@@ -1528,11 +1528,11 @@ EvalFilter( + if (pf->un.binary.left->vartype == V_ULLONG) { + EvalRelopUnsigned(ptp,&res,pf); + pres->vartype = V_BOOL; +- pres->val.bool = res.val.bool; ++ pres->val.boolean = res.val.boolean; + } else if (pf->un.binary.left->vartype == V_LLONG) { + EvalRelopSigned(ptp,&res,pf); + pres->vartype = V_BOOL; +- pres->val.bool = res.val.bool; ++ pres->val.boolean = res.val.boolean; + } else if (pf->un.binary.left->vartype == V_STRING) { + EvalRelopString(ptp,&res,pf); + pres->vartype = V_LLONG; +@@ -1540,7 +1540,7 @@ EvalFilter( + } else if (pf->un.binary.left->vartype == V_IPADDR) { + EvalRelopIpaddr(ptp,&res,pf); + pres->vartype = V_BOOL; +- pres->val.bool = res.val.bool; ++ pres->val.boolean = res.val.boolean; + } else { + fprintf(stderr, + "EvalFilter: binary op %d (%s) not supported on data type %d (%s)\n", +@@ -1583,14 +1583,14 @@ EvalFilter( + if (pf->op == OP_OR) { + EvalFilter(ptp,&res1,pf->un.binary.left); + EvalFilter(ptp,&res2,pf->un.binary.right); +- ret = res1.val.bool || res2.val.bool; ++ ret = res1.val.boolean || res2.val.boolean; + } else { + EvalFilter(ptp,&res1,pf->un.binary.left); + EvalFilter(ptp,&res2,pf->un.binary.right); +- ret = res1.val.bool && res2.val.bool; ++ ret = res1.val.boolean && res2.val.boolean; + } + pres->vartype = V_BOOL; +- pres->val.bool = ret; ++ pres->val.boolean = ret; + } else { + fprintf(stderr, + "EvalFilter: binary op %d (%s) not supported on data type %d (%s)\n", +@@ -1604,7 +1604,7 @@ EvalFilter( + if (pf->vartype == V_BOOL) { + EvalFilter(ptp,&res,pf->un.unary.pf); + pres->vartype = V_BOOL; +- pres->val.bool = !res.val.bool; ++ pres->val.boolean = !res.val.boolean; + } else { + fprintf(stderr, + "EvalFilter: unary operation %d (%s) not supported on data type %d (%s)\n", +@@ -1641,7 +1641,7 @@ PassesFilter( + + /* recurse down the tree */ + EvalFilter(ptp,&res,filter_root); +- ret = res.val.bool; ++ ret = res.val.boolean; + + if (debug) + printf("PassesFilter('%s<->%s') returns %s\n", diff --git a/net/tcptrace/patches/patch-filter.h b/net/tcptrace/patches/patch-filter.h new file mode 100644 index 00000000000..c89489a4c41 --- /dev/null +++ b/net/tcptrace/patches/patch-filter.h @@ -0,0 +1,13 @@ +$NetBSD: patch-filter.h,v 1.1 2011/12/07 15:18:51 joerg Exp $ + +--- filter.h.orig 2003-11-19 14:38:06.000000000 +0000 ++++ filter.h +@@ -118,7 +118,7 @@ enum optype { + union Constant { + u_llong u_longint; + llong longint; +- Bool bool; ++ Bool boolean; + char *string; + ipaddr *pipaddr; + }; |