diff options
author | Fredrik Domeij <fredrik.domeij@umu.se> | 2022-02-11 14:26:41 +0100 |
---|---|---|
committer | Fredrik Domeij <fredrik.domeij@umu.se> | 2022-02-11 14:26:41 +0100 |
commit | e70319db9ebb880af2ee4fe1dd6f1b476b590230 (patch) | |
tree | 88f0833d28dd602b65c8f4127bbd22f0679b8cc3 /scripts/get-metadata.sh | |
parent | 5ad1c32c4b662d851d7af9ed59ccf0e39f6d51dd (diff) |
Do not touch xml if fetched from metadata.swamid.se
Diffstat (limited to 'scripts/get-metadata.sh')
-rwxr-xr-x | scripts/get-metadata.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/get-metadata.sh b/scripts/get-metadata.sh index 1a4af53e..89e33bab 100755 --- a/scripts/get-metadata.sh +++ b/scripts/get-metadata.sh @@ -35,6 +35,7 @@ if test -d swamid-2.0 ; then echo "$script_cwd" | grep -q ^/ || script_cwd=../$script_cwd fi +update_xml=true if echo "$metadataurl" | grep -qE '^http://|^https://' ; then metadata=`curl -L -s -k -f "$metadataurl"` elif echo "$metadataurl" | grep -qE '^reep:' ; then @@ -48,6 +49,7 @@ else case $metadataurl in [0-9][0-9]*) urls="https://metadata.swamid.se/?rawXML=${metadataurl}" + update_xml=false ;; http*) urls="$metadataurl" @@ -100,9 +102,11 @@ case $x in fi echo "$metadata" > $entityidfn - tmp=`mktemp` - xsltproc --stringparam regDate "$regdate" $script_cwd/../xslt/add-rpi.xsl ${entityidfn} > ${tmp} && mv ${tmp} ${entityidfn} - xsltproc $script_cwd/../xslt/clean-entitydescriptor.xsl ${entityidfn} > ${tmp} && mv ${tmp} ${entityidfn} + if $update_xml ; then + tmp=`mktemp` + xsltproc --stringparam regDate "$regdate" $script_cwd/../xslt/add-rpi.xsl ${entityidfn} > ${tmp} && mv ${tmp} ${entityidfn} + xsltproc $script_cwd/../xslt/clean-entitydescriptor.xsl ${entityidfn} > ${tmp} && mv ${tmp} ${entityidfn} + fi if $new ; then echo -n "Add swamid-2.0/$entityidfn to git [Y/n]? " |