Re: [Lxr-general] How to remove a version from the mysql database?
Brought to you by:
ajlittoz
From: Michael O. <mic...@fr...> - 2006-06-22 08:15:51
|
Hi Malcolm, Thank you very much for your very quick answer! >> Is there a clean and simple way to remove a indexed version from the >> MySQL database ? > > There's no built in way or script. The simplest thing to do is to > drop the database, remove the version from the list of versions and do > a genxref --reindexall. It's not pretty but it will work. I'm not > sure whether just re-running genxref having removed the version from > the list will delete old versions - I suspect not. All right, that's what I chose to do. For people who want to do this too, here is what I did: * Went to the lxr install directory * 'mysql -p': connection to the mysql command line * 'drop database lxr;' (read the following line before running it!) * '\. initdb-mysql': recreated the database and tables. Actually, 'drop database lxr;' was unnecessary, as the 'initdb-mysql' script is supposed to remove any already existing DB. * `quit': to exit the mysql command line * Removed the contents of the swish-e directory * Ran "./genxref --url=http://lxr.free-electrons.com --allversions" > >> That's an ugly issue for sites indexing many versions at one, >> especially for big projects like the Linux kernel... > > It is. I guess it wouldn't be too hard to create a sql script that > would do what you want - basically it's a question of identifying all > the files that are only in the release you want to remove, then all > the identifiers that are only in those files, then the references to > those identifiers. Right! The most ugly thing is that your LXR site is no longer available when you do this. As soon as I have time in the next days or weeks, I will refresh my SQL knowledge and will come up with a SQL script taking care of removing all the table entries for a given version. That's right this should be fairly easy to implement. Thanks again! Cheers, Michael. -- Michael Opdenacker, Free Electrons Free Embedded Linux Training Materials on http://free-electrons.com/training (More than 1000 pages!) |