Bug 241041 - pkg-plist and newline termination requirement
Summary: pkg-plist and newline termination requirement
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Package Infrastructure (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2019-10-03 16:30 UTC by Hans Petter Selasky
Modified: 2019-10-04 08:12 UTC (History)
1 user (show)

See Also:


Attachments
Patch to solve problem (437 bytes, patch)
2019-10-03 16:30 UTC, Hans Petter Selasky
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Petter Selasky freebsd_committer freebsd_triage 2019-10-03 16:30:08 UTC
Created attachment 208069 [details]
Patch to solve problem

When using autoplist with devel/cxxtest, the pkg-plist must contain either a space or newline character in the end, else the package infrastructure breaks.

Add a terminating newline to all pkg-plist files and remove all empty lines therein.

See attached patch.
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2019-10-04 07:25:57 UTC
Can you explain what breaks exactly?
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2019-10-04 07:42:54 UTC
Try this:

portsnap fetch update
cd /usr/ports/devel/cxxtest

cat pkg-plist | hexdump -C

000004c0  75 64 65 2f 63 78 78 74  65 73 74 2f 59 65 73 4e  |ude/cxxtest/YesN|
000004d0  6f 52 75 6e 6e 65 72 2e  68 0a 69 6e 63 6c 75 64  |oRunner.h.includ|
000004e0  65 2f 63 78 78 74 65 73  74 2f 75 6e 69 78 2e 68  |e/cxxtest/unix.h|
000004f0  20 0a                                             | .|
          ^^ ^^ remove these two characters and try "make package"

000004c0  75 64 65 2f 63 78 78 74  65 73 74 2f 59 65 73 4e  |ude/cxxtest/YesN|
000004d0  6f 52 75 6e 6e 65 72 2e  68 0a 69 6e 63 6c 75 64  |oRunner.h.includ|
000004e0  65 2f 63 78 78 74 65 73  74 2f 75 6e 69 78 2e 68  |e/cxxtest/unix.h|
000004f0

Now try to run "make package" and it fails:

copying build/scripts-3.6/cxxtestgen -> /usr/ports/devel/cxxtest/work-py36/stage/usr/local/bin
changing mode of /usr/ports/devel/cxxtest/work-py36/stage/usr/local/bin/cxxtestgen to 755
writing list of installed files to '/usr/ports/devel/cxxtest/work-py36/.PLIST.pymodtmp'
install  -m 0644 /usr/ports/devel/cxxtest/work-py36/cxxtest-4.4/cxxtest/*  /usr/ports/devel/cxxtest/work-py36/stage/usr/local/include/cxxtest/
====> Compressing man pages (compress-man)
===>  Building package for cxxtest-4.4
pkg-static: Unable to access file /usr/ports/devel/cxxtest/work-py36/stage/usr/local/include/cxxtest/unix.h bin/cxxtestgen:No such file or directory
*** Error code 1
Comment 3 Mathieu Arnold freebsd_committer freebsd_triage 2019-10-04 08:03:11 UTC
Yeah, ok, so, you are saying that if you break a port in some strange way, it ends up being broken.

The framework is not the place to put every quirk to handle every sillyness a maintainer can do.

The pkg-plist file is a text file, each line has to end with the UNIX end of line, which is LF.
Comment 4 Hans Petter Selasky freebsd_committer freebsd_triage 2019-10-04 08:12:23 UTC
OK, sounds fair :-)