Mercurial > hg > foxridge-archiver
changeset 40:2afcb4ff750e
first real version
author | casties |
---|---|
date | Tue, 27 Jun 2006 20:18:05 +0200 |
parents | 2ee05ce0c0d2 |
children | a175b62e7584 |
files | changemeta.pl |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/changemeta.pl Tue Jun 27 20:06:41 2006 +0200 +++ b/changemeta.pl Tue Jun 27 20:18:05 2006 +0200 @@ -10,13 +10,13 @@ $|=1; # program version -my $version = "0.1 (27.6.2006 ROC)"; +my $version = "0.2 (27.6.2006 ROC)"; my $help = "use: checkmeta [options] dir options: -debug show debugging info -dry-run simulate, dont'do anything - -access=free adds free access tag (use access=mpiwg for restricted access) + -access=free set free access tag (use access=mpiwg for restricted access) "; logger("INFO", "checkmeta $version"); @@ -81,6 +81,7 @@ my $parent_tag = $index_root->findnodes('//meta/access-conditions')->get_node(1); if ($parent_tag) { my $access_tag = $parent_tag->findnodes('access')->get_node(1); + # remove access tag if it exists if ($access_tag) { $parent_tag->removeChild($access_tag); } @@ -88,6 +89,7 @@ $parent_tag = create_element_path('meta/access-conditions', $index_root, $namespace); } + # add new access tag (if $access_Type is not empty) if ($access_type eq "free") { create_element_path('access@type=free', $parent_tag, $namespace); } elsif (length $access_type > 0) { @@ -119,7 +121,7 @@ } if ($access_type) { - change_access($index_root); + change_access($access_type, $index_root); } @@ -134,7 +136,7 @@ logger('DEBUG', "would write $docdir/index.meta"); logger('DEBUG', $index_doc->toString(1)); } else { - #write_xml($index_doc, "$docdir/index.meta"); + write_xml($index_doc, "$docdir/index.meta"); } logger("DONE", "changed index file successfully!"); } else {