Bug 249388 - net-mgmt/flow-tools failed to compile with all options turned off and depends on python2.7
Summary: net-mgmt/flow-tools failed to compile with all options turned off and depends...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Muhammad Moinur Rahman
URL:
Keywords:
: 249124 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-17 08:47 UTC by Volodymyr Pushkar
Modified: 2020-11-11 16:44 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bofh)


Attachments
port's Makefile patch (1.09 KB, patch)
2020-09-17 08:47 UTC, Volodymyr Pushkar
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Volodymyr Pushkar 2020-09-17 08:47:13 UTC
Created attachment 218019 [details]
port's Makefile patch

flow-tools port failed to compile due to postgresql dependency which is enabled by default even if not set in port options. 
Solution is to use --with-postgresql=no for configure when PGSQL is off.

Also, this port depends on python2.7 for some scripts. It's easy to to transform scripts code to python3 with 2to3 tool. 

Patch for the port's Makefile attached.
Comment 1 Volodymyr Pushkar 2020-09-23 07:12:03 UTC

*** This bug has been marked as a duplicate of bug 249124 ***
Comment 2 Volodymyr Pushkar 2020-09-25 07:34:17 UTC
was closed by error
Comment 3 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2020-09-25 08:41:01 UTC
*** Bug 249124 has been marked as a duplicate of this bug. ***
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-09-25 17:16:52 UTC
A commit references this bug:

Author: bofh
Date: Fri Sep 25 17:16:30 UTC 2020
New revision: 550057
URL: https://svnweb.freebsd.org/changeset/ports/550057

Log:
  net-mgmt/flow-tools: Fix compilation when all options turned off

  - Remove python 2.7 dependency [1] [2]

  PR:		249388 [1] 249739 [2]
  Submitted by:	vladimir.pushkar@gmail.com [1]
  Reported by:	swills [2]

Changes:
  head/net-mgmt/flow-tools/Makefile
Comment 5 Andrew 2020-10-25 12:01:17 UTC
I just upgraded from PORTREVISION 2, and flow-report(1) fails with the following error:

Traceback (most recent call last):
  File "/usr/local/bin/flow-rptfmt", line 533, in <module>
    rpt.load(sys.stdin, opt_sort_field, opt_max_lines, opt_percent)
  File "/usr/local/bin/flow-rptfmt", line 324, in load
    for i in string.split(line[8:],','):
AttributeError: module 'string' has no attribute 'split'
flow-report: pclose(flow-rptfmt -f ascii): failed exit code=1.


Maybe something went wrong in code transition from Python 2.7 to 3.x... :( Unfortunately I have no clue about the exact cause, can you help me on this?
Comment 6 Volodymyr Pushkar 2020-11-11 01:17:12 UTC
Andrew, could you please file an another PR with the issue you mentioned. Also put there your exact flow-report command line and /usr/local/etc/cfg/stat.cfg file that we will be able to reproduce. I'll take a look on it when I will have time.

P.S. From your error paste I see that "string.split(line[8:],',')" should be changed to something like "line[8:].split(',')", but there are a lot of such things in flow-rptfmt file. And actually all string() methods should be replaced with build-in str().
Comment 7 Andrew 2020-11-11 16:44:47 UTC
(In reply to Volodymyr Pushkar from comment #6)

Thank you so much Vlad, I opened bug #251054 for that. Please let me know if I can help in any way.