Summary: | app-admin/webapp-config leaves behind stray files | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Priit Laes (IRC: plaes) <plaes> |
Component: | Current packages | Assignee: | Anthony Basile <blueness> |
Status: | RESOLVED TEST-REQUEST | ||
Severity: | trivial | CC: | ashl1future, cyprien, eras, jmbsvicetto, proxy-maint, twitch153, web-apps |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Priit Laes (IRC: plaes)
2008-03-12 13:18:14 UTC
(In reply to comment #0) > When upgrading packages with webapp-config, it leaves behind empty "install" > files under /var/db/webapps/programname/version I am no python guru but: --- db_orig.py 2008-03-12 16:38:05.000000000 +0000 +++ db.py 2008-03-12 16:44:52.000000000 +0000 @@ -318,6 +318,8 @@ if not self.__p: installs = open(dbpath, 'w') installs.write('\n'.join(newentries) + '\n') + if not self.has_installs(): + os.unlink(dbpath) else: OUT.info('Pretended to remove installation ' + installdir) OUT.info('Final DB content:\n' + '\n'.join(newentries) + '\n') works for me (slightly tested). *** Bug 344909 has been marked as a duplicate of this bug. *** (In reply to comment #1) > (In reply to comment #0) > > When upgrading packages with webapp-config, it leaves behind empty "install" > > files under /var/db/webapps/programname/version > > I am no python guru but: > > --- db_orig.py 2008-03-12 16:38:05.000000000 +0000 > +++ db.py 2008-03-12 16:44:52.000000000 +0000 > @@ -318,6 +318,8 @@ > if not self.__p: > installs = open(dbpath, 'w') > installs.write('\n'.join(newentries) + '\n') > + if not self.has_installs(): > + os.unlink(dbpath) > else: > OUT.info('Pretended to remove installation ' + installdir) > OUT.info('Final DB content:\n' + '\n'.join(newentries) + '\n') > > works for me (slightly tested). This patch was never committed to either the git repo or as a patch against any version on the tree. I'll test this and commit if it works. (In reply to comment #1) > (In reply to comment #0) > > When upgrading packages with webapp-config, it leaves behind empty "install" > > files under /var/db/webapps/programname/version > > I am no python guru but: > > --- db_orig.py 2008-03-12 16:38:05.000000000 +0000 > +++ db.py 2008-03-12 16:44:52.000000000 +0000 > @@ -318,6 +318,8 @@ > if not self.__p: > installs = open(dbpath, 'w') > installs.write('\n'.join(newentries) + '\n') > + if not self.has_installs(): > + os.unlink(dbpath) > else: > OUT.info('Pretended to remove installation ' + installdir) > OUT.info('Final DB content:\n' + '\n'.join(newentries) + '\n') > > works for me (slightly tested). I can confirm that this patch does resolve the issue with older versions of a particular webapp still having an installs file after a version update. Patch destination: /usr/lib/python2.7/site-packages/WebappConfig/db.py Post-update (Prepatch): Octo_Azul ~ # find /var/db/webapps/bugzilla/ /var/db/webapps/bugzilla/ /var/db/webapps/bugzilla/3.6.8 /var/db/webapps/bugzilla/3.6.8/.keep_www-apps_bugzilla-3.6.8 /var/db/webapps/bugzilla/3.6.8/installs /var/db/webapps/bugzilla/3.6.9 /var/db/webapps/bugzilla/3.6.9/.keep_www-apps_bugzilla-3.6.9 /var/db/webapps/bugzilla/3.6.9/installs Post-update (Postpatch): Octo_Azul ~ # find /var/db/webapps/bugzilla/ /var/db/webapps/bugzilla/ /var/db/webapps/bugzilla/3.6.8 /var/db/webapps/bugzilla/3.6.8/.keep_www-apps_bugzilla-3.6.8 /var/db/webapps/bugzilla/3.6.9 /var/db/webapps/bugzilla/3.6.9/.keep_www-apps_bugzilla-3.6.9 /var/db/webapps/bugzilla/3.6.9/installs (In reply to comment #4) > (In reply to comment #1) > > (In reply to comment #0) > > > When upgrading packages with webapp-config, it leaves behind empty "install" > > > files under /var/db/webapps/programname/version > > > > I am no python guru but: > > > > --- db_orig.py 2008-03-12 16:38:05.000000000 +0000 > > +++ db.py 2008-03-12 16:44:52.000000000 +0000 > > @@ -318,6 +318,8 @@ > > if not self.__p: > > installs = open(dbpath, 'w') > > installs.write('\n'.join(newentries) + '\n') > > + if not self.has_installs(): > > + os.unlink(dbpath) > > else: > > OUT.info('Pretended to remove installation ' + installdir) > > OUT.info('Final DB content:\n' + '\n'.join(newentries) + '\n') > > > > works for me (slightly tested). > > I can confirm that this patch does resolve the issue with older versions of > a particular webapp still having an installs file after a version update. > > Patch destination: /usr/lib/python2.7/site-packages/WebappConfig/db.py > > Post-update (Prepatch): > > Octo_Azul ~ # find /var/db/webapps/bugzilla/ > /var/db/webapps/bugzilla/ > /var/db/webapps/bugzilla/3.6.8 > /var/db/webapps/bugzilla/3.6.8/.keep_www-apps_bugzilla-3.6.8 > /var/db/webapps/bugzilla/3.6.8/installs > /var/db/webapps/bugzilla/3.6.9 > /var/db/webapps/bugzilla/3.6.9/.keep_www-apps_bugzilla-3.6.9 > /var/db/webapps/bugzilla/3.6.9/installs > > Post-update (Postpatch): > > Octo_Azul ~ # find /var/db/webapps/bugzilla/ > /var/db/webapps/bugzilla/ > /var/db/webapps/bugzilla/3.6.8 > /var/db/webapps/bugzilla/3.6.8/.keep_www-apps_bugzilla-3.6.8 > /var/db/webapps/bugzilla/3.6.9 > /var/db/webapps/bugzilla/3.6.9/.keep_www-apps_bugzilla-3.6.9 > /var/db/webapps/bugzilla/3.6.9/installs Committed to the git head. We'll leave this bug open until we push out the next release. (In reply to Anthony Basile from comment #5) > Committed to the git head. We'll leave this bug open until we push out the > next release. Ping, it's almost 6 months already since the commit. Was the fix released already? (In reply to Michał Górny from comment #6) > (In reply to Anthony Basile from comment #5) > > Committed to the git head. We'll leave this bug open until we push out the > > next release. > > Ping, it's almost 6 months already since the commit. Was the fix released > already? please test webapp-config-1.51 |