[jamming] Behavior of :D= modifier appears to be broken
Abbate, Joseph M
Joseph.Abbate at ca.com
Mon Apr 4 07:33:33 PDT 2005
According to the Jam manual page, the :D modifier selects the directory
path, :P selects the parent directory, and :D=path can be used to
"replace directory with /path/". It further states that
On VMS, $(var:P) is the parent directory of $(var:D); on Unix and
NT, $(var:P) and
$(var:D) are the same.
However, given a path such as /src/i18n/fr for SEARCH_SOURCE, on Linux
echoing $(SEARCH_SOURCE) with :D, :P, :D= and :P= (the latter is not
documented, but tried for completeness), I see /src/i18n/fr,
/src/i18n/fr, fr and /src/i18n/fr, respectively. In other words, the
:D= modifier appears to extract the last directory in a given path.
It's hard to discern how the above specifications can be translated into
the latter behavior, but as far as I can tell this is how :D= behaves on
Linux, UNIX and Windows.
However, on VMS given the comparable path [.src.i18n.fr], for the same
modifiers, I see [.src.i18n.fr], [.src.i18n], an empty string and
[.src.i18n], respectively. This does confirm the specification above in
terms of the differences between :D and :P. IMHO the empty string also
confirms the :D=path specification since in :D= the path is indeed
Unfortunately, my colleagues have conveniently used the :D= behavior of
extracting the last directory in implementing rules to copy translated
help text and message files from their source directories to the
corresponding installation/build directories, e.g., copy from
/src/i18n/fr to /build/files/fr, but I'm unable to use the same rules on
I'd like feedback on the following two questions. First and most
important is what is a reliable and portable way to extract the last
directory of a given path? Second is whether the Jam experts believe
the :D= behavior is correct on Unix/Windows given the specs and if so
what can be done to achieve the same on VMS.
I have a simple test scenario which I can distribute as a shar archive
if someone is interested.
Senior Software Engineer
joseph.abbate at ca.com
More information about the jamming