Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 213130 - app-admin/webapp-config leaves behind stray files
Summary: app-admin/webapp-config leaves behind stray files
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High trivial
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
: 344909 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-12 13:18 UTC by Priit Laes (IRC: plaes)
Modified: 2013-08-03 14:12 UTC (History)
7 users (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 Priit Laes (IRC: plaes) 2008-03-12 13:18:14 UTC
When upgrading packages with webapp-config, it leaves behind empty "install" files under /var/db/webapps/programname/version

app-admin/webapp-config-1.50.16-r1 on stable-x86

Example (I only have 2.11.5 installed):
store20 phpmyadmin # find /var/db/webapps/phpmyadmin/
/var/db/webapps/phpmyadmin/
/var/db/webapps/phpmyadmin/2.10.0.2
/var/db/webapps/phpmyadmin/2.10.0.2/installs
/var/db/webapps/phpmyadmin/2.11.2.2
/var/db/webapps/phpmyadmin/2.11.2.2/installs
/var/db/webapps/phpmyadmin/2.10.1
/var/db/webapps/phpmyadmin/2.10.1/installs
/var/db/webapps/phpmyadmin/2.11.5
/var/db/webapps/phpmyadmin/2.11.5/.keep_dev-db_phpmyadmin-2.11.5
/var/db/webapps/phpmyadmin/2.11.5/installs
Comment 1 Eray Aslan gentoo-dev 2008-03-12 17:19:35 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).
Comment 2 Alexey Shildyakov 2010-11-16 07:50:51 UTC
*** Bug 344909 has been marked as a duplicate of this bug. ***
Comment 3 Anthony Basile gentoo-dev 2011-12-30 16:23:30 UTC
(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.
Comment 4 Devan Franchini (RETIRED) gentoo-dev 2013-02-12 03:29:01 UTC
(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
Comment 5 Anthony Basile gentoo-dev 2013-02-12 13:10:33 UTC
(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.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-08-02 14:47:40 UTC
(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?
Comment 7 Anthony Basile gentoo-dev 2013-08-03 14:12:10 UTC
(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