[DRE-commits] [redmine] 02/15: don't leave unowned files after purge
Antonio Terceiro
terceiro at moszumanska.debian.org
Sat May 2 21:00:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository redmine.
commit 44b74d2716bf335d92f95c968ea6c8d1e37a6c72
Author: Antonio Terceiro <terceiro at debian.org>
Date: Wed Apr 8 17:00:02 2015 +0200
don't leave unowned files after purge
Closes: #781534
---
debian/changelog | 6 ++++++
debian/postinst | 10 ++--------
debian/postrm | 4 ++++
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index fa175b1..712c637 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,12 @@ redmine (3.0~20140825-6) UNRELEASED; urgency=medium
* debian/postinst: initialize variable that will hold the return code of a
potentially failing command to 0 so it is not undefined if the command
suceeeds. Closes: #780894
+ * debian/postinst: don't leave unowned files after purge. Closes: #781534
+ - debian/postinst:
+ - don't create files under /usr/share/redmine/app
+ - pass SCHEMA=/dev/null to rake `db:migrate` so it won't create
+ /usr/share/redmine/db/schema.rb
+ - debian/postrm: remove the aforementioned files
-- Antonio Terceiro <terceiro at debian.org> Wed, 08 Apr 2015 12:06:32 +0200
diff --git a/debian/postinst b/debian/postinst
index 5f97f78..c3c535d 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -78,12 +78,6 @@ case "$1" in
echo "Inconsistent link in vendor/rails, please remove manually"
fi
fi
- if [ ! -e app/views/members ]; then
- mkdir app/views/members
- fi
- if [ ! -e app/sweepers ]; then
- mkdir app/sweepers
- fi
# this directory should never be used: /usr not writable policy
if [ -e tmp ]; then
rm -rf tmp
@@ -296,7 +290,7 @@ for lInstance in $gInstances; do
echo "Populating database for redmine instance \"${lInstance}\".
This may take a while."
fCode=0
- bundle exec rake -s db:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || fCode=$?
+ bundle exec rake -s db:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE SCHEMA=/dev/null || fCode=$?
if [ $fCode -eq 0 ]; then
echo "Done."
if [ $lInstall -eq 1 ]; then
@@ -306,7 +300,7 @@ This may take a while."
chown -f www-data:www-data ${fRailsLog}/production.log
fi
# handle plugins migration
- bundle exec rake -s redmine:plugins:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE || true
+ bundle exec rake -s redmine:plugins:migrate RAILS_ENV=$fRailsEnv X_DEBIAN_SITEID="${lInstance}" VERBOSE=$RAKE_VERBOSE SCHEMA=/dev/null || true
else
echo "Error when running rake db:migrate, check database configuration."
exit 1
diff --git a/debian/postrm b/debian/postrm
index 58411a2..a7fbd87 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -10,6 +10,10 @@ if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
+# remove files/dirs erroneusly created by redmine < 3.0~20140825-6:
+rm -f /usr/share/redmine/db/schema.rb
+rmdir /usr/share/redmine/app/sweepers 2>/dev/null || true
+
case "$1" in
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/redmine.git
More information about the Pkg-ruby-extras-commits
mailing list