@@ -707,26 +707,40 @@ See also &f-link-env-AppendUnique;,
707
707
<varlistentry id="f-AppendENVPath">
708
708
<term><replaceable>env</replaceable>.<methodname>AppendENVPath</methodname>(<parameter>name, newpath, [envname, sep, delete_existing=False]</parameter>)</term>
709
709
<listitem><para>
710
- Append path elements specified by <parameter>newpath</parameter>
711
- to the given search path string or list <parameter>name</parameter>
712
- in mapping <parameter>envname</parameter> in the &consenv;.
713
- Supplying <parameter>envname</parameter> is optional:
714
- the default is the execution environment &cv-link-ENV;.
715
- Optional <parameter>sep</parameter> is used as the search path separator,
716
- the default is the platform's separator (<systemitem>os.pathsep</systemitem>).
717
- A path element will only appear once.
718
- Any duplicates in <parameter>newpath</parameter> are dropped,
719
- keeping the last appearing (to preserve path order).
720
- If <parameter>delete_existing</parameter>
721
- is <constant>False</constant> (the default)
722
- any addition duplicating an existing path element is ignored;
723
- if <parameter>delete_existing</parameter>
724
- is <constant>True</constant> the existing value will
725
- be dropped and the path element will be added at the end.
726
- To help maintain uniqueness all paths are normalized (using
727
- <systemitem>os.path.normpath</systemitem>
728
- and
729
- <systemitem>os.path.normcase</systemitem>).
710
+ Append directory paths from
711
+ <parameter>newpath</parameter> to
712
+ a search-path entry <parameter>name</parameter>
713
+ in &consvar; <parameter>envname</parameter>
714
+ in the current enviromment (<parameter>env</parameter>).
715
+ If <parameter>envname</parameter> is not given,
716
+ the default is <literal>"ENV"</literal>
717
+ (see &cv-link-ENV;).
718
+ <parameter>envname</parameter> is expected
719
+ to refer to a dictionary-like object;
720
+ if it does not exist in <parameter>env</parameter>
721
+ it will be created as an initially empty dict.
722
+ <parameter>newpath</parameter>
723
+ may be specified as a string,
724
+ a directory node, or a list of strings.
725
+ If a string, it may contain multiple paths separated
726
+ by the system path separator
727
+ (<systemitem>os.pathsep</systemitem>),
728
+ or, if specified, by the value of <parameter>sep</parameter>.
729
+ Top-relative path strings (starting with <literal>#</literal>) are recognized.
730
+ The type of the existing value
731
+ of <parameter>name</parameter> is preserved.
732
+ </para>
733
+
734
+ <para>
735
+ Paths will only appear once.
736
+ Duplicate paths in <parameter>newpath</parameter> are removed,
737
+ preserving the last occurrence to maintain path order.
738
+ If <parameter>delete_existing</parameter> is true (the default),
739
+ existing duplicates are removed before appending,
740
+ otherwise, new duplicates are skipped.
741
+ Paths are normalized during comparisons to avoid problems of
742
+ "same path, spelled differently",
743
+ but retain their original form in the result.
730
744
</para>
731
745
732
746
<para>
@@ -1031,8 +1045,8 @@ env4 = env.Clone(tools=['msvc', MyTool])
1031
1045
The
1032
1046
<parameter>parse_flags</parameter>
1033
1047
keyword argument is also recognized, to allow merging command-line
1034
- style arguments into the appropriate construction
1035
- variables (see &f-link-env-MergeFlags;).
1048
+ style arguments into the appropriate &consvars;
1049
+ (see &f-link-env-MergeFlags;).
1036
1050
</para>
1037
1051
1038
1052
<example_commands>
@@ -3381,26 +3395,40 @@ and &f-link-env-PrependUnique;.
3381
3395
<varlistentry id="f-PrependENVPath">
3382
3396
<term><replaceable>env</replaceable>.<methodname>PrependENVPath</methodname>(<parameter>name, newpath, [envname, sep, delete_existing=True]</parameter>)</term>
3383
3397
<listitem><para>
3384
- Prepend path elements specified by <parameter>newpath</parameter>
3385
- to the given search path string or list <parameter>name</parameter>
3386
- in mapping <parameter>envname</parameter> in the &consenv;.
3387
- Supplying <parameter>envname</parameter> is optional:
3388
- the default is the execution environment &cv-link-ENV;.
3389
- Optional <parameter>sep</parameter> is used as the search path separator,
3390
- the default is the platform's separator (<systemitem>os.pathsep</systemitem>).
3391
- A path element will only appear once.
3392
- Any duplicates in <parameter>newpath</parameter> are dropped,
3393
- keeping the first appearing (to preserve path order).
3394
- If <parameter>delete_existing</parameter>
3395
- is <constant>False</constant>
3396
- any addition duplicating an existing path element is ignored;
3397
- if <parameter>delete_existing</parameter>
3398
- is <constant>True</constant> (the default) the existing value will
3399
- be dropped and the path element will be inserted at the beginning.
3400
- To help maintain uniqueness all paths are normalized (using
3401
- <systemitem>os.path.normpath</systemitem>
3402
- and
3403
- <systemitem>os.path.normcase</systemitem>).
3398
+ Prepend directory paths from
3399
+ <parameter>newpath</parameter> to
3400
+ a search-path entry <parameter>name</parameter>
3401
+ in &consvar; <parameter>envname</parameter>
3402
+ in the current enviromment (<parameter>env</parameter>).
3403
+ If <parameter>envname</parameter> is not given,
3404
+ the default is <literal>"ENV"</literal>
3405
+ (see &cv-link-ENV;).
3406
+ <parameter>envname</parameter> is expected
3407
+ to refer to a dictionary-like object;
3408
+ if it does not exist in <parameter>env</parameter>
3409
+ it will be created as an initially empty dict.
3410
+ <parameter>newpath</parameter>
3411
+ may be specified as a string,
3412
+ a directory node, or a list of strings.
3413
+ If a string, it may contain multiple paths separated
3414
+ by the system path separator
3415
+ (<systemitem>os.pathsep</systemitem>),
3416
+ or, if specified, by the value of <parameter>sep</parameter>.
3417
+ Top-relative path strings (starting with <literal>#</literal>) are recognized.
3418
+ The type of the existing value
3419
+ of <parameter>name</parameter> is preserved.
3420
+ </para>
3421
+
3422
+ <para>
3423
+ Paths will only appear once.
3424
+ Duplicate paths in <parameter>newpath</parameter> are removed,
3425
+ preserving the first occurrence to maintain path order.
3426
+ If <parameter>delete_existing</parameter> is true (the default),
3427
+ existing duplicates are removed before prepending,
3428
+ otherwise, new duplicates are skipped.
3429
+ Paths are normalized during comparisons to avoid problems of
3430
+ "same path, spelled differently",
3431
+ but retain their original form in the result.
3404
3432
</para>
3405
3433
3406
3434
<para>
0 commit comments