There is no link to a VCS for the docbookwiki packaging in the PTS, but
from a debdiff, the changes to the postinst appear to be the problem:

-    dpkg-maintscript-helper mv_conffile /etc/apache2/conf.d/docbookwiki 
/etc/apache2/conf.available/docbookwiki 0.9.2-2 docbookwiki -- "$@"
+    if [ -d /usr/share/docbookwiki/content/SVN/repository ]
+    then
+        mv /usr/share/docbookwiki/content/SVN/repository /var/lib/docbookwiki
+    else
+   /usr/bin/svnadmin create /var/lib/docbookwiki
+   /usr/bin/svnadmin load --quiet /var/lib/docbookwiki < 
/usr/share/docbookwiki/content/SVN/svn.dump

This is a waste of time on new installations because of the later
cleanup script and only creates a repository, not the working copy that
the later scripts actually need:

svn: E155007: '/var/lib/docbookwiki/docbookwiki_guide_en.xml' is not a working 
copy
svn: E155007: '/var/lib/docbookwiki/media' is not a working copy
svn: E155007: '/var/lib/docbookwiki/media/docbookwiki_guide' is not a working 
copy
svn: E155007: '/var/lib/docbookwiki/media/docbookwiki_guide' is not a working 
copy

svn is correct here, /var/lib/docbookwiki/ is not a working copy, it is
the repository itself - an svn checkout needs to be made somewhere in /var/lib/

+    fi
+    ln -s /var/lib/docbookwiki /usr/share/docbookwiki/content/SVN/repository 

This should be conditional on /usr/share/docbookwiki/content/SVN/repository not 
already existing.

The init.sh script called later does the svnadmin call wrongly later:
### if no repository argument is given, create a local repository
if [ "$repository" = "" ]
then
  # create it if it does not exist
  if [ ! -d 'repository' ]
  then
    svnadmin create $(pwd)/repository  #create
  fi
  repository=file://$(pwd)/repository 
fi

+    dpkg-maintscript-helper mv_conffile /etc/apache2/conf.d/docbookwiki 
/etc/apache2/conf-available/docbookwiki 0.9.2-2 docbookwiki -- "$@"
+    if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
+        . /usr/share/apache2/apache2-maintscript-helper
+        apache2_invoke enconf docbookwiki
+    elif  dpkg-query -f '${Version}'  -W 'apache2.2-common' > /dev/null 2>&1 ; 
then
+        # if the configuration uses <IfVersion> uncomment the next line
+        # a2enmod -q version
+        [ -d /etc/apache2/conf.d/ ] && [ ! -L 
/etc/apache2/conf.d/docbookwiki.conf ] && ln -s 
../conf-available/docbookwiki.conf /etc/apache2/conf.d/docbookwiki.conf
+    fi


    if [ ! -d /usr/share/docbookwiki/content/books ]; then
        # This is a new installation
        db_get docbookwiki/setup_password
        su -c "install/set_su_passwd.sh $RET ; \
        content/clean.sh all ; \
        content/SVN/init.sh ; \

0: Those calls should be put into a single separate script, packaged in the 
debian/ directory and installed into /var/lib/docbookwiki/init/ or similar so 
that set -e can be used (and set -x during debugging).

1: the init.sh call should use /var/lib/docbookwiki

2: Due to the symlink, clean.sh does rm -rf /var/lib/docbookwiki

The bigger problem is that the package still modified shipped files,
irrespective of what happens with the svndump because the init scripts
are still called from /usr/share/ and write files to /usr/share (like 
svn_cfg.txt):

root@sylvester:/home/docbookwiki-0.9.2# dpkg -S  
/usr/share/docbookwiki/content/SVN/svn_cfg.txt 
dpkg-query: no path found matching pattern 
/usr/share/docbookwiki/content/SVN/svn_cfg.txt

That file and all the files like it *must* be in /var/lib/docbookwiki
to be able to close this bug.

This bug isn't about simply putting a directory under /var and then
operating the rest of the package on /usr/share via a symlink. This
needs to be fixed properly by getting the upstream package to use /var
whenever it is dealing with modifiable / modified data during all
stages: installation, configuration, operation, upgrade and purge.

This would include moving /usr/share/docbookwiki/content/books
into /var/lib/ as well as this is generated data.

docbookwiki must treat /usr/share as read-only during operation *and
setup* with only dpkg putting files or directories beneath that
mountpoint. Essentially, once dpkg -X has completed, I see no reason
why a wiki engine should expect to have write permissions on /usr - those
writes go into /var/.

There are also upstream problems with the init.sh script:
### create the directories 'trunk/media/' in the svn repository
svn mkdir $repository/trunk/ -m ''
svn mkdir $repository/trunk/media/ -m ''

svn mkdir /var/lib/docbookwiki//trunk/ -m ''
svn: E205009: Local, non-commit operations do not take a log message or 
revision properties

This prevents the init.sh from using set -e and therefore prevents
other errors from being caught elsewhere.

Worse, the mkdir call is made *before* the export:
### checkout trunk to svn_dir
rm -rf $svn_dir
echo "Checking out '$repository/trunk/' in '$svn_dir'"
svn checkout $repository/trunk/ $svn_dir

Sorry, but at this point I gave up. docbookwiki would appear to be in a
very bad state and the use of an internal SVN repository appears to be
completely broken - upstream and in Debian. 

The only option here is to remove docbookwiki. The package in wheezy
needs to be removed because shipping a VCS repository in /usr/share is
insane and the package in sid needs to be removed because the fix for
that bug is incomplete and broken.

I'll file for removal as RoQA on that basis.

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

Attachment: pgpKcAIqGt43S.pgp
Description: PGP signature

Reply via email to