Skip to content

Commit

Permalink
Trim source-profile link for usnistgov#116.
Browse files Browse the repository at this point in the history
As discussed in the branch under review in usnistgov#204, we now have absolute
paths in the resolved catalogs based on the full paths to the profile,
which is less than idea for published catalogs.

Comment with explanation:
usnistgov#204 (comment)

Example:
https://github.com/aj-stein-nist/oscal-content/blob/dc5500ed9371b485fc21cb095d2fb9db6e2a1fd3/nist.gov/SP800-53/rev5/xml/NIST_SP-800-53_rev5_LOW-baseline-resolved-profile_catalog.xml#L11

To work around this for the time being, we are using sed in the Makefile
to clean up once profile resolution is done and before the XML source is
converted to the target JSON and YAML.
  • Loading branch information
aj-stein-nist committed Oct 27, 2023
1 parent 44dbcfc commit cc51eb9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ resolve-xml-profiles: $(GEN_XML_RESOLVED_CATALOGS) ## Resolve OSCAL XML profiles

$(GEN_CONTENT_DIR)/%-resolved-profile_catalog.xml: $(SRC_DIR)/%_profile.xml
mkdir -p $(@D)
$(PROFILE_RESOLVER_RUNNER) $(SRC_DIR)/$*_profile.xml $(GEN_CONTENT_DIR)/$*-resolved-profile_catalog.xml $(PROFILE_RESOLVER_ARGS)
$(PROFILE_RESOLVER_RUNNER) $(GEN_CONTENT_DIR)/$*_profile.xml $(GEN_CONTENT_DIR)/$*-resolved-profile_catalog.xml $(PROFILE_RESOLVER_ARGS)
@sed -i'' -e "s|file:$(shell realpath $(GEN_CONTENT_DIR)/$*_profile.xml)|$(shell basename $*_profile.xml)|g" $(GEN_CONTENT_DIR)/$*-resolved-profile_catalog.xml

.PHONY: validate-xml-content
validate-xml-content: $(GEN_XML_FILES) ## Validate XML files
Expand Down

0 comments on commit cc51eb9

Please sign in to comment.