Opened 16 years ago

Closed 16 years ago

#16619 closed defect (fixed)

certain characters in long description cause corrupt receipt to be installed

Reported by: darren.weber.lists@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.8.0
Component: base Version: 1.6.0
Keywords: receipt port syntax Cc: ryandesign (Ryan Carsten Schmidt), kballard (Lily Ballard)
Port:

Description

I'm testing a new port for libpqxx in a local user port repository. I'll attach the Portfile and the receipt. This is the problem:

[ dweber@elegans ~/ports ]$ sudo port install libpqxx
Password:
Portfile changed since last build; discarding previous state.
--->  Fetching libpqxx
--->  Verifying checksum(s) for libpqxx
--->  Extracting libpqxx
--->  Configuring libpqxx
--->  Building libpqxx with target all
--->  Staging libpqxx into destroot
--->  Installing libpqxx 2.6.9_0
list element in braces followed by "}" instead of space
Error: Status 1 encountered during processing.

Thereafter, I can't do anything with this port, eg:

[ dweber@elegans ~/ports ]$ sudo port lint libpqxx
list element in braces followed by "}" instead of space
Error: Status 1 encountered during processing.
[ dweber@elegans ~/ports ]$ sudo port clean --all libpqxx
Portfile changed since last build; discarding previous state.
list element in braces followed by "}" instead of space
Error: Status 1 encountered during processing.
[ dweber@elegans ~/ports ]$ sudo port install libpqxx
list element in braces followed by "}" instead of space
Error: Status 1 encountered during processing.

I think the receipt file could be the problem, but I don't know how to check or correct it (see attached).

Attachments (2)

Portfile (1.6 KB) - added by darren.weber.lists@… 16 years ago.
a new Portfile for libpqxx, to be tested
receipt (14.7 KB) - added by darren.weber.lists@… 16 years ago.
Receipt file for new port of libpqxx, probably contains syntax issue related to closing {}

Download all attachments as: .zip

Change History (10)

Changed 16 years ago by darren.weber.lists@…

Attachment: Portfile added

a new Portfile for libpqxx, to be tested

Changed 16 years ago by darren.weber.lists@…

Attachment: receipt added

Receipt file for new port of libpqxx, probably contains syntax issue related to closing {}

comment:1 Changed 16 years ago by darren.weber.lists@…

I've tested a drastic solution to my immediate problem:

sudo rm -rf /opt/local/var/macports/receipts/libpqxx

This restores functionality to port installed.

The receipt file may contain a syntax anomaly. On looking at the receipt file, it appears to have syntax anomalies in the long_description. In my Portfile, I have used several \ and \n tags to control the display of the long_description. That may be non-standard formatting for this key value.

comment:2 Changed 16 years ago by darren.weber.lists@…

I changed the long_description to:

long_description \
libpqxx is the official C++ client API for PostgreSQL, \
the enterprise-strength open-source database software.

This removes the \n and all the \" text from it. I'm pleased to say the following now works:

[ dweber@elegans ~/ports ]$ sudo port clean --all libpqxx
Password:
Portfile changed since last build; discarding previous state.
--->  Cleaning libpqxx
[ dweber@elegans ~/ports ]$ 
[ dweber@elegans ~/ports ]$ sudo port install libpqxx
--->  Fetching libpqxx
--->  Attempting to fetch libpqxx-2.6.9.tar.gz from http://pqxx.org/download/software/libpqxx/
--->  Verifying checksum(s) for libpqxx
--->  Extracting libpqxx
--->  Configuring libpqxx
--->  Building libpqxx with target all
--->  Staging libpqxx into destroot
--->  Installing libpqxx 2.6.9_0
--->  Activating libpqxx 2.6.9_0
--->  Cleaning libpqxx
[ dweber@elegans ~/ports ]$ ll /opt/local/lib/libpqxx*
-rwxr-xr-x 2 root admin 397K 2008-09-22 14:30 /opt/local/lib/libpqxx-2.6.9.dylib*
-rw-r--r-- 2 root admin 695K 2008-09-22 14:30 /opt/local/lib/libpqxx.a
lrwxr-xr-x 1 root admin   19 2008-09-22 14:30 /opt/local/lib/libpqxx.dylib -> libpqxx-2.6.9.dylib*
-rwxr-xr-x 2 root admin  880 2008-09-22 14:30 /opt/local/lib/libpqxx.la*

comment:3 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… eridius@… added
Milestone: Port BugsMacPorts base bugs
Summary: receipt bug for new port in testingcertain characters in long description cause corrupt receipt to be installed

comment:4 Changed 16 years ago by jmroot (Joshua Root)

I think you could work around this by wrapping your long_description body in braces.

comment:5 in reply to:  4 Changed 16 years ago by darren.weber.lists@…

Replying to jmr@…:

I think you could work around this by wrapping your long_description body in braces.

Yes, that could be the fix. In that case, all the special backslash characters (symbols) would not get parsed. I've found a discussion of tcl parsing online at: http://www.beedub.com/book/2nd/tclintro.doc.html. Also, the Ousterhout book "Tcl and the Tk Toolkit" also explains this syntax issue with some useful examples.

I wonder then if macports "should" parse the long_description for any special backslash characters, like \n, \t, etc. and then wrap them in {} before creating the receipt? In any case, it might help to have some examples of using {} in the MACPORTS GUIDE. Perhaps a general policy statement about the formatting of long_description would help.

comment:6 Changed 16 years ago by darren.weber.lists@…

I've tested the {} solution for long_description; it seems to fail. Here's the example test for libpqxx below.

Portfile contains:

long_description {
libpqxx is the official C++ client API for PostgreSQL, the enterprise-strength
open-source database software.  There are many similar libraries for PostgreSQL
and for other databases, some of them database independent.  Most of these,
however, are fairly C like in their programming style, and fail to take
advantage of the full power of the C++ language as it has matured since
the acceptance of the Standard in 1996.  What libpqxx brings you is effective
use of templates to reduce the inconvenience of dealing with type conversions,
standard C++ strings to keep you from having to worry about buffer allocation
and overflow attacks, exceptions to take the tedious and error prone plumbing
around error handling out of your hands, constructors and destructors to bring
resource management under control, and even basic object orientation to give
you some extra reliability features that would be hard to get with most other
database interfaces.}

port install process:

[ dweber@elegans ~ ]$ sudo port install libpqxx
--->  Fetching libpqxx
--->  Verifying checksum(s) for libpqxx
--->  Extracting libpqxx
--->  Configuring libpqxx
--->  Building libpqxx with target all
--->  Staging libpqxx into destroot
--->  Installing libpqxx 2.6.9_0
--->  Activating libpqxx 2.6.9_0
Error: Target org.macports.activate returned: Image error: libpqxx @2.6.9_0 not installed as an image.
Error: Status 1 encountered during processing.

Resulting receipt file contains:

[ dweber@elegans ~ ]$ cat /opt/local/var/macports/receipts/libpqxx/2.6.9_0/receipt.bz2 | bunzip2 | more
# Version: 1.0
variants {} imagedir /opt/local/var/macports/software/libpqxx/2.6.9_0 description {Official C++ client API for PostgreSQL} active 0 homepage http://pqxx
.org/development/libpqxx/ epoch 0 compact 0 depends_lib {port:pkgconfig port:postgresql83} name libpqxx installtype image receipt_f receipt_flat maintai
ners gmail.com:darren.weber.lists long_description {{
libpqxx is the official C++ client API for PostgreSQL, the enterprise-strength
open-source database software.  There are many similar libraries for PostgreSQL
and for other databases, some of them database independent.  Most of these,
however, are fairly C like in their programming style, and fail to take
advantage of the full power of the C++ language as it has matured since
the acceptance of the Standard in 1996.  What libpqxx brings you is effective
use of templates to reduce the inconvenience of dealing with type conversions,
standard C++ strings to keep you from having to worry about buffer allocation
and overflow attacks, exceptions to take the tedious and error prone plumbing
around error handling out of your hands, constructors and destructors to bring
resource management under control, and even basic object orientation to give
you some extra reliability features that would be hard to get with most other
database interfaces.}} contents {{/opt/local/var/macports/software/libpqxx/2.6.9_0/opt/local/bin/pqxx-config 0 80 33261 1259 {MD5 (/opt/local/var/macpor
ts/software/libpqxx/2.6.9_0/opt/local/bin/pqxx-config) = a65c02cde9c3e0efb766c85f4b1652e6}} . . .<snip>

comment:7 Changed 16 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:8 Changed 16 years ago by blb@…

Milestone: MacPorts FutureMacPorts 1.8.0
Resolution: fixed
Status: newclosed

Fixed in r50663.

Note: See TracTickets for help on using tickets.