File: dokuwiki.preinst

package info (click to toggle)
dokuwiki 2024-02-06b%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 24,624 kB
  • sloc: php: 97,851; javascript: 3,724; sh: 599; makefile: 70; xml: 34
file content (35 lines) | stat: -rwxr-xr-x 1,168 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
# preinst for dokuwiki.

set -e

# Restructure the data tree to the new format introduced in the
# 2005-07-01 release
if [ -e "/var/lib/dokuwiki/attic" ] ; then
	mv /var/lib/dokuwiki/data /var/lib/dokuwiki/data.tmp
	mkdir /var/lib/dokuwiki/data
	mv /var/lib/dokuwiki/data.tmp /var/lib/dokuwiki/data/pages
	mv /var/lib/dokuwiki/attic /var/lib/dokuwiki/data/
	mv /var/lib/dokuwiki/media /var/lib/dokuwiki/data/
fi

if [ $1 = "upgrade" ] ; then
	# Backup the .htaccess file managed by ucf that used to be part
	# of the package file and would be deleted as a side effect.
	# Remove useless ucf associations: these files are part of the
	# package and would get deleted or overwritten before ucf
	# can do anything.
	#
	# See bug #506100.
	if [ -f /usr/share/dokuwiki/.htaccess -a ! -f /usr/share/dokuwiki/.htaccess.dist ]
	then
		cp /usr/share/dokuwiki/.htaccess /usr/share/dokuwiki/.htaccess.upgrade
		ucf --purge /usr/share/dokuwiki/.htaccess
		ucf --purge /var/lib/dokuwiki/data/.htaccess
		ucf --purge /usr/share/dokuwiki/bin/.htaccess
		ucf --purge /usr/share/dokuwiki/inc/.htaccess
		ucf --purge /usr/share/dokuwiki/inc/lang/.htaccess
	fi
fi

#DEBHELPER#