Changeset 27764 for trunk/doc


Ignore:
Timestamp:
Aug 14, 2007, 1:14:46 AM (12 years ago)
Author:
markd@…
Message:

Clarify the section on -append and -delete keywords.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/guide/new/xml/portfileref.xml

    r27731 r27764  
    674674    be used within the "global" and "variant" sections of Portfiles, and not
    675675    within optional port phase declarations. In other words, port phase
    676     keywords are not located within port phase declaration; they
     676    keywords are not located within port phase declarations, but rather they
    677677    <emphasis>refer</emphasis> to port phases and set options for those
    678678    phases, and they take affect whether or not phase declarations have been
     
    685685
    686686    <section>
    687       <title>Keywords using -append and -delete</title>
    688 
    689       <para>Frequently it is necessary to add to a list of keyword values
     687      <title>Using -append and -delete Keywords</title>
     688
     689      <para>It is often necessary to add to a list of keyword values
    690690      previously set by MacPorts base or set by a prior Portfile keyword. In
    691691      these cases we generally don't want to replace the current list, but
    692       rather to add or delete values from the list. Keywords that use
    693       "-append" or "-delete" append or delete individual options from a
    694       matching list of options without overwriting the list. The three most
    695       common practical uses for these keywords are:</para>
     692      rather to add or delete values from the list. For this purpose there are
     693      "-append" and "-delete" keywords; they are listed below according to
     694      keyword category. The three most common uses for these keywords are
     695      given below.</para>
    696696
    697697      <itemizedlist>
    698698        <listitem>
    699           <para>Configure arguments. MacPorts base sets the gcc complier flags
    700           CFLAGS and LDFLAGS for all ports, therefore to keep from overwriting
    701           the defaults use:</para>
     699          <para>Preserve default configure arguments.</para>
     700
     701          <para>MacPorts base sets the gcc compiler flags CFLAGS and LDFLAGS
     702          for all ports using <literal>configure.cflags</literal> and
     703          <literal>configure.ldflags</literal>, therefore to keep from
     704          overwriting the default compiler flags use:</para>
    702705
    703706          <itemizedlist>
     
    713716
    714717        <listitem>
    715           <para>Ports belonging to a PortGroup. Ports in a PortGroup have
    716           default dependencies set by the Portgroup. Therefore, never use
    717           <literal>depends_lib</literal> or it will overwrite the default
    718           library dependencies. Use instead:</para>
     718          <para>Preserve default dependencies within a PortGroup.</para>
     719
     720          <para>Ports in a PortGroup have default library dependencies set by
     721          MacPorts base. Therefore, never use <literal>depends_lib</literal>
     722          in ports belonging to a PortGroup or it will overwrite the default
     723          library dependencies. Instead, use:</para>
    719724
    720725          <itemizedlist>
     
    726731
    727732        <listitem>
    728           <para>Port variants. When adding or removing dependencies to a port
    729           when a variant is specified, you want to add items to the list of
    730           dependency keyword values that were set previously in the Portfile.
    731           Use the appropriate keywords.</para>
     733          <para>Add or delete port dependencies, distfiles, patchfiles, etc.
     734          for port variants.</para>
     735
     736          <para>When a variant requires more or fewer dependencies, distfiles,
     737          or patchfiles, you want to add or remove items to the list of
     738          dependency keyword values that were set in the global section of the
     739          Portfile. Use the appropriate keywords, for example:</para>
    732740
    733741          <itemizedlist>
     
    738746
    739747            <listitem>
    740               <para><literal>depends_build-append</literal> or
    741               <literal>depends_build-delete</literal></para>
    742             </listitem>
    743 
    744             <listitem>
    745               <para><literal>depends_run-append</literal> or
    746               <literal>depends_run-delete</literal></para>
     748              <para><literal>distfiles-append</literal> or
     749              <literal>distfiles-delete</literal></para>
     750            </listitem>
     751
     752            <listitem>
     753              <para><literal>patchfiles-append</literal> or
     754              <literal>patchfiles-delete</literal></para>
    747755            </listitem>
    748756          </itemizedlist>
Note: See TracChangeset for help on using the changeset viewer.