Bug 236420 - devel/cgit: has an error in the file /usr/local/lib/cgit/filters/syntax-highlighting.py - wrong shebang
Summary: devel/cgit: has an error in the file /usr/local/lib/cgit/filters/syntax-highl...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-09 12:40 UTC by Frank van den Boom
Modified: 2019-03-14 20:02 UTC (History)
2 users (show)

See Also:
mt: maintainer-feedback+


Attachments
possible patch with changed python version (680 bytes, patch)
2019-03-10 17:31 UTC, Marko Turk
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frank van den Boom 2019-03-09 12:40:38 UTC
Port net/cgit has an error in the file
/usr/local/lib/cgit/filters/syntax-highlighting.py

The first line (shebang) lists an incorrect python-interpreter.
syntax-highlighting.py needs pyhton3.6 but pyhton2.7 is listed.

First line of the file syntax-highlighting.py from the port:
#!/usr/local/bin/pyhton2.7 

It should be I think:
#!/usr/local/bin/python3.6

Otherwise syntax-highlighting with pygments doesn't not work and you will see no text in cgit.
Comment 1 Marko Turk 2019-03-10 17:31:54 UTC
Created attachment 202778 [details]
possible patch with changed python version
Comment 2 Marko Turk 2019-03-10 17:33:00 UTC
Hi Frank,

can you test the attached patch?

I changed the python version to 3. Since python is not used as a dependency it shouldn't affect anything other than these shebangs.

Thanks.

BR/Marko
Comment 3 Frank van den Boom 2019-03-11 18:22:12 UTC
Hi Mark,

the patch works and fix the problem with the shebang.

I started a new jail and installed the ports: nginx, fgciwrap, git and cgit.

In order to run the file /usr/local/lib/cgit/filters/syntax-highlighting.py
/ports/lang/python3 and /ports/textproc/py-gments with the flag FLAVOR=py36 must be installed.


These are the first lines of the file syntax-highlighting.py:
#!/usr/local/bin/python3.6

# This script uses Pygments and Python3. You must have both installed
# for this to work.
#
# http://pygments.org/
# http://python.org/
#
# It may be used with the source-filter or repo.source-filter settings
# in cgitrc.

You see the shebang is correct.

Thank you!
Comment 4 Frank van den Boom 2019-03-11 18:24:17 UTC
Sorry Marko, i forgot the "o".
Comment 5 commit-hook freebsd_committer 2019-03-14 20:02:24 UTC
A commit references this bug:

Author: zi
Date: Thu Mar 14 20:02:05 UTC 2019
New revision: 495730
URL: https://svnweb.freebsd.org/changeset/ports/495730

Log:
  - Shebang fix for cgit filters
  - Bump PORTREVISION

  PR:		236420
  Submitted by:	Frank van den Boom <frank@am-knie.de>
  Approved by:	Marko Turk <mt@markoturk.info> (maintainer)

Changes:
  head/devel/cgit/Makefile