Bugzilla – Attachment 59035 Details for
Bug 17777
koha-remove should deal with temporary uploads
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17777: koha-remove should deal with temporary uploads
Bug-17777-koha-remove-should-deal-with-temporary-u.patch (text/plain), 2.50 KB, created by
Karen
on 2017-01-16 22:57:25 UTC
(
hide
)
Description:
Bug 17777: koha-remove should deal with temporary uploads
Filename:
MIME Type:
Creator:
Karen
Created:
2017-01-16 22:57:25 UTC
Size:
2.50 KB
patch
obsolete
>From a230b81b22fe5998abee59910f4b4e4bf16aacbc Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 14 Dec 2016 16:48:45 +0100 >Subject: [PATCH] Bug 17777: koha-remove should deal with temporary uploads > >If the temporary upload folder exists, it should be discarded when >removing an instance. If we do not, it may/will create problems when >recreating the same instance. > >A function in koha-functions.sh is added to determine the temp directory >instead of hardcoding /tmp. > >Test plan: >[1] Copy koha-functions.sh to /usr/share/koha/bin >[2] Run koha-create --create-db newinstancexx >[3] Run mkdir /tmp/koha_newinstancexx_upload (if /tmp is your temp!) >[4] Run debian/scripts/koha-remove newinstancexx > Do not run the regular one, but verify that you use the updated one. >[5] Check that /tmp/koha_newinstancexx_upload is gone. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Karen Jen <karenliang.student@wegc.school.nz> >--- > debian/scripts/koha-functions.sh | 20 ++++++++++++++++++++ > debian/scripts/koha-remove | 6 ++++++ > 2 files changed, 26 insertions(+) > >diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh >index cf6835d..fc1a329 100755 >--- a/debian/scripts/koha-functions.sh >+++ b/debian/scripts/koha-functions.sh >@@ -233,3 +233,23 @@ get_loglevels() > fi > > } >+ >+get_tmpdir() >+{ >+ if [ "$TMPDIR" != "" ]; then >+ if [ -d "$TMPDIR" ]; then >+ echo $TMPDIR >+ return 0 >+ fi >+ # We will not unset TMPDIR but just default to /tmp here >+ # Note that mktemp (used later) would look at TMPDIR >+ echo "/tmp" >+ return 0 >+ fi >+ local retval=$(mktemp -u) >+ if [ "$retval" = "" ]; then >+ echo "/tmp" >+ return 0 >+ fi >+ echo $(dirname $retval) >+} >diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove >index 67e2402..763da29 100755 >--- a/debian/scripts/koha-remove >+++ b/debian/scripts/koha-remove >@@ -108,6 +108,12 @@ eof > rm "/etc/koha/sites/$name/zebra-authorities-dom.cfg" > [ -f "/etc/koha/sites/$name/zebra.passwd" ] && \ > rm "/etc/koha/sites/$name/zebra.passwd" >+ >+ tempdir=$(get_tmpdir) >+ [ -d "$tempdir/koha_${name}_upload" ] && \ >+ # Temporary uploads can be discarded, apart from purgeall >+ rm -r "$tempdir/koha_${name}_upload" >+ > [ -f "/var/lib/koha/$name/letsencrypt.enabled" ] && \ > rm -r "/var/lib/koha/$name/letsencrypt.enabled" > [ -f "/etc/letsencrypt/renewal/$le_opacdomain.conf" ] && \ >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17777
:
58181
|
59035
|
59076