Opened 19 years ago

Closed 12 years ago

#421 closed enhancement (fixed)

Feature request: bug and user_notes keywords

Reported by: gwright@… Owned by: lperry (Perry Lee)
Priority: Normal Milestone: MacPorts 1.8.0
Component: base Version:
Keywords: Cc: waqar@…, raimue (Rainer Müller)
Port:

Description (last modified by jmpp@…)

In my portfiles I use two keywords to give the maintainer and user some useful information. For now, I comment them out. The keywords are 'bugs' and 'user_notes'.

'bugs' is intended to tell the maintainer about infelicities in the port. This might include delicate hacks needed to get it running or unsupported features.

'user_notes' is usually a reminder that the user has to do something to get the expected behavior, like set an enviroment variable. It can also warn of pitfalls for the unwary.

The 'user_notes' variable could be displayed at the end of installation from the command line, or in a text window from the GUI version. Maintainers (and other knowledgable users) can be expected to grep for 'bugs', but it might be nice if the GUI supported display of the 'bugs' value for advanced users.

These seem to be both useful and unlikely to break anything. Could they be added to the port system?

Attachments (2)

patch-portactivate.tcl.diff (1.6 KB) - added by lperry (Perry Lee) 13 years ago.
Portfile (1.1 KB) - added by lperry (Perry Lee) 13 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 19 years ago by kevin@…

Owner: changed from kevin@… to darwinports-bugs@…

comment:2 Changed 18 years ago by waqar@…

Cc: waqar@… added

comment:3 Changed 17 years ago by toby@…

Component: dportsbase

comment:4 Changed 15 years ago by markd@…

Type: defectenhancement

comment:5 Changed 15 years ago by pipping@…

Milestone: MacPorts 1.5

comment:6 Changed 14 years ago by nox@…

Cc: waqar@… added; waqar@… removed
Priority: ExpectedNormal
Version: 1.0

comment:7 Changed 14 years ago by jmpp@…

Description: modified (diff)
Milestone: MacPorts 1.5MacPorts base enhancements

comment:8 Changed 13 years ago by jmroot (Joshua Root)

Milestone: MacPorts base enhancementsMacPorts 1.8.0

comment:9 Changed 13 years ago by lperry (Perry Lee)

Looks like this ticket has been opened for awhile ;) -- I'll go ahead and take a stab at it.

On top of what has already been described, it might be useful to add a new port command (i.e., port notes foo) that displays any notes associated with a port. That way users can see the user notes before installing a port and/or in case the user misses the message displayed at the end of installation.

Before I go ahead and implement the described behavior for user_notes (display it at the end of installation) and add the two commands bugs and notes, should I wait for further discussion or bring this ticket up on the dev mailing list?

comment:10 Changed 13 years ago by raimue (Rainer Müller)

Cc: raimue@… added

The user notes seem useful to me.

But I don't understand what bugs should contain. Port bugs should be filed in Trac with a correct 'Port' field. Other stuff can be added as comments. If you want to improve/update the Portfile you have to look at it anyway.

comment:11 in reply to:  10 Changed 13 years ago by lperry (Perry Lee)

Replying to raimue@…:

But I don't understand what bugs should contain. Port bugs should be filed in Trac with a correct 'Port' field. Other stuff can be added as comments. If you want to improve/update the Portfile you have to look at it anyway.

That makes sense to me -- should the bugs portion of this ticket be removed then?

For now, I've implemented the following (r45686):

  • I added a new field (notes) to PortInfo in portutil.tcl.
  • I added a new action (action_notes) in port.tcl that displays notes set in the Portfile (not PortIndex, though an option that reads notes from the index can be added -- much like in action_info).
  • At the end of activate_main in portactivate.tcl, notes are displayed. Note that action_activate does not call this procedure (it uses portimage::activate instead). This means that notes are only displayed when port install or port upgrade is called -- not during port activate.

To test the implementation, I created an example Portfile (foo) that contains the following lines in particular:

notes This message is stored in notes. It is displayed at\
      \nthe end of the activation phase and when action_notes\
      \nis invoked.

When port install foo or port upgrade foo is called:

--->  Installing foo @0.2.1_0+darwin_9
--->  Activating foo @0.2.1_0+darwin_9

This message is stored in notes. It is displayed at 
the end of the activation phase and when action_notes 
is invoked.

--->  Cleaning foo

When port notes elinks foo git-core is called:

elinks has no notes.
foo has the following notes:
    This message is stored in notes. It is displayed at 
    the end of the activation phase and when action_notes 
    is invoked.
git-core has no notes.

comment:12 Changed 13 years ago by lperry (Perry Lee)

Unless there are any reasons not to do so, in a couple of days I'll go ahead and merge the existing code into trunk so more people can test/use the keyword.

comment:13 Changed 13 years ago by lperry (Perry Lee)

Merged into trunk in r46061.

comment:14 Changed 13 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to perry@…

I don't see any value in storing the notes in the index and thus making it even bigger. Is anyone really going to want to search on the notes field?

comment:15 Changed 13 years ago by lperry (Perry Lee)

That's a good point; I'll go ahead and remove the field from PortInfo.

comment:16 Changed 13 years ago by lperry (Perry Lee)

The notes field was removed in r46632.

comment:17 Changed 13 years ago by lperry (Perry Lee)

I've attached a patch that wraps the notes output (in portactivate.tcl) to the terminal's width. It uses the same logic as the wrap* procs in port/port.tcl. Is there a better way to share the code than duplicating the logic in portactivate.tcl?

I've also attached the Portfile that I've been using to test the functionality.

Changed 13 years ago by lperry (Perry Lee)

Attachment: patch-portactivate.tcl.diff added

Changed 13 years ago by lperry (Perry Lee)

Attachment: Portfile added

comment:18 Changed 13 years ago by lperry (Perry Lee)

In r49104, I reverted to storing notes in PortInfo now that PortInfo keys are limited to those that are searchable (r47874).

comment:19 Changed 13 years ago by lperry (Perry Lee)

For the time being, I've committed the patch to trunk so notes output is a tad prettier (r49606).

comment:20 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

The feature is added. Sure it's not perfect, but that can be worked on in future.

Note: See TracTickets for help on using tickets.