Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 29705 - Zope ebuild blows away default installation.
Summary: Zope ebuild blows away default installation.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High critical
Assignee: net-zope (OBSOLETE)
URL:
Whiteboard:
Keywords:
: 35388 (view as bug list)
Depends on:
Blocks: 35471
  Show dependency tree
 
Reported: 2003-09-26 15:38 UTC by jbooth
Modified: 2003-12-11 23:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jbooth 2003-09-26 15:38:47 UTC
When you emerge zope, it does a default zope installation... without checking to
see first if you perhaps had some data in your installation you may have wanted.

It either needs to 1) check first or 2) tell the user the command to setup an
install, rather than doing it itself

Reproducible: Always
Steps to Reproduce:
1. emerge zope
2. mess with zope
3. emerge zope

Actual Results:  
Your changes are gone.

Expected Results:  
Something other than deleteing your changes.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-09-26 19:10:18 UTC
zope stuff belongs to kutsuya not PHP!
Comment 2 Axxackall 2003-09-28 23:25:54 UTC
It could be good to have a way to make a ZODB backup whne it uninstalls,
and a ZODB recovery when it installs as an upgrade.

Protecting of db files is also a good idea, but it's not enough sometimes
(between some versions) and the backup-recovery scenario will be required
then
Comment 3 Heinrich Wendel (RETIRED) gentoo-dev 2003-11-10 11:42:50 UTC
what are the files that have to be saved?
Comment 4 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-09 06:43:30 UTC
*** Bug 35388 has been marked as a duplicate of this bug. ***
Comment 5 Andy Dustman 2003-12-09 09:22:47 UTC
Sorry for the dup.

Another (probably easiest) solution is to install mv ${ZINSTDIR}/Data.fs to Data.fs.dist in src_install(). This way the previously-installed (and modified) copy is not overwritten, but you still get a new, pristine copy if you need to have it for some reason. Additionally, there should probably be a note in pkg_postinstall() that Data.fs.dist needs to be copied to Data.fs, or perhaps do this automatically if Data.fs does not exist.
Comment 6 Andy Dustman 2003-12-09 12:58:48 UTC
The problem lies within zope-config: zinst_fs_setup() is what does the clobbering.
Comment 7 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-10 11:03:35 UTC
fixed in zope-config-0.3 :)
Comment 8 Andy Dustman 2003-12-11 11:52:04 UTC
There's a possible issue with zope-config-0.3. It now copies Data.fs, if it exists, to Data.fs.org, copies over the template data (include the pristine Data.fs), and then moves Data.fs to Data.fs.dist, and Data.fs.org to Data.fs.

The problem here is, if Zope is running, then it will have Data.fs open. Data.fs.org will be a copy, and then it will be moved into place over the open Data.fs, which will have a link count of 0 and be deleted once it is closed. If something is written to Data.fs after it is copied but before Zope is shut down, that data will be lost, because it will be written to the unlinked file.

The solution is, use mv instead of cp. It'll be renamed, but any running Zope will still have the file open, and it'll end up where it started.

Alternately, zope-config could refuse to install anything if the target directory already exists.
Comment 9 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-11 23:43:18 UTC
ok, changed to mv :)