[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
www
lon-capa-cvs@mail.lon-capa.org
Fri, 31 Oct 2003 22:20:37 -0000
www Fri Oct 31 17:20:37 2003 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
Trying to fix versioned maps. Not quite there yet.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.437 loncom/lonnet/perl/lonnet.pm:1.438
--- loncom/lonnet/perl/lonnet.pm:1.437 Thu Oct 30 17:52:25 2003
+++ loncom/lonnet/perl/lonnet.pm Fri Oct 31 17:20:37 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.437 2003/10/30 22:52:25 albertel Exp $
+# $Id: lonnet.pm,v 1.438 2003/10/31 22:20:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3993,13 +3993,13 @@
sub symblist {
my ($mapname,%newhash)=@_;
- $mapname=declutter($mapname);
+ $mapname=&deversion(&declutter($mapname));
my %hash;
if (($ENV{'request.course.fn'}) && (%newhash)) {
if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db',
&GDBM_WRCREAT(),0640)) {
foreach (keys %newhash) {
- $hash{declutter($_)}=$mapname.'___'.$newhash{$_};
+ $hash{declutter($_)}=$mapname.'___'.&deversion($newhash{$_});
}
if (untie(%hash)) {
return 'ok';
@@ -4089,6 +4089,12 @@
untie %bighash;
}
return &declutter($uri);
+}
+
+sub deversion {
+ my $url=shift;
+ $url=~s/\.\d+\.(\w+)$/\.$1/;
+ return $url;
}
# ------------------------------------------------------ Return symb list entry