summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFredrik Domeij <fredrik.domeij@umu.se>2022-02-11 14:26:41 +0100
committerFredrik Domeij <fredrik.domeij@umu.se>2022-02-11 14:26:41 +0100
commite70319db9ebb880af2ee4fe1dd6f1b476b590230 (patch)
tree88f0833d28dd602b65c8f4127bbd22f0679b8cc3 /scripts
parent5ad1c32c4b662d851d7af9ed59ccf0e39f6d51dd (diff)
Do not touch xml if fetched from metadata.swamid.se
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get-metadata.sh10
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]? "