Skip to content

Commit

Permalink
Rationalise schema files referred to by fragment files to all be pres…
Browse files Browse the repository at this point in the history
…ent - and only present - in the xml directory.

Change references in all schema files.  Delete duplicate schema files in entities directory.
  • Loading branch information
iay committed Sep 13, 2011
1 parent f2de070 commit 8de3480
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
26 changes: 26 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,32 @@
</target>
-->

<!--
Utility to apply a one-off change to every fragment file.
The perl script is applied in "-i" mode to perform in-place
editing; this only works well on Unix-like systems.
Comment this out when not in use to avoid accidents.
-->
<!--
<target name="fix.fragments">
<for param="file">
<path>
<fileset dir="${entities.dir}" includes="uk*.xml"/>
</path>
<sequential>
<echo>processing @{file}</echo>
<exec executable="perl" dir="${entities.dir}">
<arg value="-i"/>
<arg value="${build.dir}/fix_fragment.pl"/>
<arg value="@{file}"/>
</exec>
</sequential>
</for>
</target>
-->

<!--
Extract embedded certificates
-->
Expand Down
20 changes: 20 additions & 0 deletions build/fix_fragment.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/perl -w

#
# Apply a given one-off change to the input fragment file.
#

while (<>) {

s {(\s)(?=shibboleth-metadata-1\.0\.xsd)} {$1..\/xml\/};
s {(\s)(?=sstc-saml-schema-assertion-2\.0\.xsd)} {$1..\/xml\/};
s {(\s)(?=sstc-saml-schema-metadata-2\.0\.xsd)} {$1..\/xml\/};
s {(\s)(?=uk-fed-label\.xsd)} {$1..\/xml\/};
s {(\s)(?=xenc-schema\.xsd)} {$1..\/xml\/};
s {(\s)(?=xml\.xsd)} {$1..\/xml\/};
s {(\s)(?=xmldsig-core-schema\.xsd)} {$1..\/xml\/};

print $_;
}

# end

0 comments on commit 8de3480

Please sign in to comment.