Author: tille
Date: 2008-09-19 09:06:39 +0000 (Fri, 19 Sep 2008)
New Revision: 2511

Modified:
   trunk/packages/agdbnet/trunk/debian/patches/10_config_location.patch
   trunk/packages/agdbnet/trunk/debian/postinst
   trunk/packages/agdbnet/trunk/debian/postrm
Log:
Link whole dir in /var/www/agdbnet to /etc/agdbnet instead of single files; Fix 
patch to read config file properly


Modified: trunk/packages/agdbnet/trunk/debian/patches/10_config_location.patch
===================================================================
--- trunk/packages/agdbnet/trunk/debian/patches/10_config_location.patch        
2008-09-19 09:05:53 UTC (rev 2510)
+++ trunk/packages/agdbnet/trunk/debian/patches/10_config_location.patch        
2008-09-19 09:06:39 UTC (rev 2511)
@@ -1,4 +1,4 @@
---- agdbnet_v1.0.0.orig/cgi-bin/agdbnet.pl.orig
+--- agdbnet_v1.0.0.orig/cgi-bin/agdbnet.pl
 +++ agdbnet_v1.0.0/cgi-bin/agdbnet.pl
 @@ -35,7 +35,7 @@
  ######################################################
@@ -9,15 +9,23 @@
  #######End Local configuration########################
  
  local (
---- agdbnet_v1.0.0.orig/cgi-bin/agdbnet.pl
-+++ agdbnet_v1.0.0/cgi-bin/agdbnet.pl
-@@ -125,7 +125,8 @@
-       #directory as the script.  This prevents
-       #a public script from accessing a private database.
+@@ -134,7 +134,7 @@
+                       }
+               }
+               else {
+-                      $parser->parse( Source => { SystemId => $instance } );
++                      $parser->parse( Source => { SystemId => 
"/etc/agdbnet/$instance" } );
+               }
+       };
+       if ($@) {
+--- agdbnet_v1.0.0.orig/cgi-bin/agcurate.pl
++++ agdbnet_v1.0.0/cgi-bin/agcurate.pl
+@@ -64,7 +64,7 @@
        if ( $q->param('file') =~ /^([\w\d\-_]+\.xml)$/ ) {
--              $instance = $1;
-+              ## in Debian config file is in /etc/agdbnet
-+              $instance = '/etc/agdbnet/'.$1;
+               $instance = $1;
        }
-       eval {
-               if ( $ENV{MOD_PERL} )
+-      eval { $parser->parse( Source => { SystemId => $instance } ); };
++      eval { $parser->parse( Source => { SystemId => "/etc/agdbnet/$instance" 
} ); };
+       if ($@) {
+               $invalidXML = 1;
+       }

Modified: trunk/packages/agdbnet/trunk/debian/postinst
===================================================================
--- trunk/packages/agdbnet/trunk/debian/postinst        2008-09-19 09:05:53 UTC 
(rev 2510)
+++ trunk/packages/agdbnet/trunk/debian/postinst        2008-09-19 09:06:39 UTC 
(rev 2511)
@@ -55,11 +55,9 @@
 # All files that might influence the layout of the web site are
 # considered config files and stored into /etc/${pkg}/${XMLNAME}
 # If such files do not exist they will be created from a simple
-# template.  Finally links are putted into place to enable
-# agdbnet to find these files.
+# template.
 STYLEDIR=/etc/${pkg}/"$XMLNAME"
 mkdir -p ${STYLEDIR}
-mkdir -p /var/www/${pkg}/"$XMLNAME"
 for style in `ls /usr/share/${pkg}/template/*.css 
/usr/share/${pkg}/template/*.html` ; do
     confstyle=`basename $style`
     if [ ! -s "$STYLEDIR/$confstyle" ] ; then
@@ -74,11 +72,14 @@
            cp -a "$style" "$STYLEDIR/$confstyle"
        fi
     fi
-    if [ ! -s "/var/www/${pkg}/$XMLNAME/$confstyle" ] ; then
-        ln -s "$STYLEDIR/$confstyle" "/var/www/${pkg}/$XMLNAME/$confstyle"
-    fi
 done
 
+# Finally a link is put into place to enable agdbnet to find these files.
+mkdir -p /var/www/${pkg}
+if [ ! -L "/var/www/${pkg}/$XMLNAME" -a ! -d "/var/www/${pkg}/$XMLNAME" ] ; 
then
+    ln -s "$STYLEDIR" "/var/www/${pkg}/$XMLNAME"
+fi
+
 TMPDIR="/var/www/${pkg}/tmp"
 SQLDIR="/var/lib/${pkg}"
 

Modified: trunk/packages/agdbnet/trunk/debian/postrm
===================================================================
--- trunk/packages/agdbnet/trunk/debian/postrm  2008-09-19 09:05:53 UTC (rev 
2510)
+++ trunk/packages/agdbnet/trunk/debian/postrm  2008-09-19 09:06:39 UTC (rev 
2511)
@@ -25,7 +25,7 @@
                rm -f  /etc/${pkg}/"$XMLNAME".xml.old
                # remove style files
                rm -rf /etc/${pkg}/"$XMLNAME"
-               # remove static files and links which were created in postinst
+               # remove link from /var/www to /etc which was created in 
postinst
                rm -rf /var/www/${pkg}/"$XMLNAME"
            done
        fi


_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-med-commit

Reply via email to