From 0ca101b095512a30292e4d0061ef4de01e780e26 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Wed, 27 Oct 2004 04:36:49 +0000 Subject: [PATCH] Generates XML manifest of packages for http://www.planet-lab.org/Software/download.php --- packages.sh | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100755 packages.sh diff --git a/packages.sh b/packages.sh new file mode 100755 index 00000000..1b909dad --- /dev/null +++ b/packages.sh @@ -0,0 +1,98 @@ +#!/bin/bash +# +# Generates XML manifest of packages for +# http://www.planet-lab.org/Software/download.php +# +# Mark Huang +# Copyright (C) 2004 The Trustees of Princeton University +# +# $Id$ +# + +xml_escape_pcdata() { + # & to & + # " to \" + # ' to ' + # < to < + # > to > + sed \ + -e 's/\&/\&/g' | sed \ + -e 's/"/\"/g' \ + -e "s/'/\'/g" \ + -e 's//\>/g' +} + +xml_escape_cdata() { + # & to & + # \ to \\ + # " to \" + # ' to ' + # < to < + # > to > + sed \ + -e 's/\&/\&/g' \ + -e 's/\\/\\\\/g' | sed \ + -e 's/"/\\"/g' \ + -e "s/'/\'/g" \ + -e 's//\>/g' +} + +# All supported tags +TAGS=$(rpm --querytags) + +cat < + + + + + +]> + +EOF + +# For every RPM in the current directory +RPMS=$(find ${1-.} -name '*.rpm') +for rpm in $RPMS ; do + +cat < + $(basename $rpm | xml_escape_pcdata) + +EOF + +done + +cat < +EOF -- 2.47.0