Friday, February 19, 2010

New gentoolkit utility --- analyse

Well, I've gone and done it again, I haven't finished the eclean re-write and I've found something else to work on. It all started from a forum post. He wanted to fix his mistakes and it looked like the only way was the hard way.

Having been doing more gentoolkit coding I put together a quick and dirty python script to output some USE flag info about his installed pkgs. With that and me saying I could add some more code to spit out a package.use file populated with what is installed/what flags enabled/disabled. I have now been coding it up and have it now working for USE flag analysis and rebuild. I plan on adding more so it can analyse and repair keywords and mask files too.














I also would like to code up yet another /etc/portage/package.* cleaning tool. Since It'll have nearly/all the functions needed for gathering the info, may as well do that too. All the main functionality will also be importable for other apps to use as library functions/methods.

analyse rebuild -pv use


analyse analyse -uv use








left: showing the output of the report. Enabled USE flags are marked with a leading + and colored blue. Disabled USE flags are marked - and colored red. Unset USE flags are plain text.

It also indicates if the flag is a system default, the number of packages that have it enabled/disabled/unset and using the --verbose option lists the packages.


right: Part way down the report. notice that mplayer has faac faad flags enabled but ffmpeg does not. Something that I didn't notice before. Now I know to set them for ffmpeg too.




This last one shows the totals at the end of the analyse report.

Also if you can think of a good "e" name for it to go along with the other gentoolkit apps like eclean & equery. Post a comment.

some of the names so far:
  • erepair
  • esylana (analyse spelled backward)

Sunday, February 7, 2010

more ecleaning

I'ts been awhile since my last post. I've made good progress on the eclean modular re-write. The cleaning modules have been completed, but not tested yet. I have gotten about halfway coding the testing modules for it. I swear there is going to be 3 times more lines of code to test those functions that there are lines of code in the functions. This is due mostly to having to create a small fake distfiles and packages directories and a small fake portage dbapi to return the pre-programmed data back to the function/module being unit tested.

The output module should be complete aside from minor changes.

The search module has mostly been re-worked and the distfiles search function has now been turned into a class and split up into 13 smaller functions/methods. Along the way I discovered that there were several bugs in the code logic that could potentially clean installed sources that it should not have. I have that mostly fixed now, but intend to extend some of the options a little where I can. Along the way I have been optimizing the code to increase speed for the slow non-destructive distfiles search. I have managed to reduce the time taken by approximately 10-12% while at the same time doing a more thorough search.

I have also added a -v, --verbose option which will give more info about it's actions and findings. useful for debugging and knowledge about your system. It will also inform you of installed package versions that are no longer in any installed trees/overlays, while protecting them from deletion.

That's all for now, gotta go on some errands...

Monday, January 25, 2010

Distractions

I've been distracted away form porthole code lately. Well not completely, I do have an ulterior motive. I am working on gentoolkit code again. Namely a modular rewrite of eclean.

eclean was an all in one python script that contained a number of unwieldy methods and functions which made it difficult to modify and nearly impossible to create test functions for. One of the primary reasons I started on it was to split the back-end functioning code from the output printing code similar to most of the newly redone equery modules. That way the code can be used by other applications. So, I began by separating the script into a python package containing 5 files and a nearly empty script that just loads and calls the main() .

Those 5 files being:
  1. cli.py to handle all command line interface argument parsing and start the requested action.
  2. search.py with all the search related methods and functions which determine the files to be cleaned.
  3. exclude.py containing the exclusion file parsing and handling code.
  4. output.py for the screen output and user interaction.
  5. clean.py to handle the actual cleaning process.
The end result should be one that has a number of automatic tests run on it to check that any code modifications are performing correctly as well as code that will be easier to maintain.
It will also then be possible for the code to be used in other apps such as a planned plug-in module for porthole. :)

Thursday, January 7, 2010

Translators Needed

I have porthole pretty much ready for another release. I have the translation files updated with any string changes and ready for a final edit.

  1. Polish language is fully updated (just need to commit it). Thank you, Arkadiusz Kowalski.
  2. German is nearly up to date, a few minor strings to check, Thank you, Timo Gurr.
  3. French, is in need of checking and/or fixing.
  4. Italian, is in need of updates.
  5. Russian, is in need of updates.
  6. Vietnamese, is in need of updates.
If you would like to see porthole translated into your language please leave a comment or email me. It is quite simple to do, just takes some time and knowledge of both English and the target language. There are tools like poedit to help.

Wednesday, January 6, 2010

And so Christmas came and the New Year begins

It's been the usual busy time of the year, with all the extra running around, preparing things. Getting the gifts for the people close to you. Trying to keep my wife from going overboard with the giving (again). It has been a good Christmas overall, lots of new toys, kids got some too (he he).

I had been hoping to get a release out for Christmas, but got a little too busy and lost concentration on what I was doing, so had a little break. The coding I was doing was centered more on su'ing porthole's processes that require root access while the majority of the code still runs as the user. I made a lot of progress, but came across a blocker in that gtk refused to do some things because of the detected su. It would run as all user or all root but not a mix. So I reverted most of the changes, (some were better even without su'ing). I believe I've come up with a better way without having to use policykit and the only python interface to it being through d-bus. Also due to the migration in python towards py-3k means using features of python-2.6 and greater. I am not about to do that for this release, but probably for the next major release of -0.7.0.

Porthole-0.7.0 I am hoping to have made all the changes needed to have multiple options for the backend package manager code it uses for data gathering as well as installing/syncing, etc..

So, I hope everyone had a wonderful Christmas and are starting the new year out right and happily so far.

Friday, December 11, 2009

ChangeLog


It looks like I've nearly got it all working. I have been creating a custom highlighting view for the ChangeLogs.

See for yourself...

When it's done you'll also be able to click on the bug #'s to open your browser to bugzilla's bug

gotta go... more later.

[edit]
I have it all working now including opening your browser opening bugzilla to the bug number.

next on the list is to customize the installed files view and add functionality there too.

Thursday, December 10, 2009

Dependencies revamp

Lately I've been working on a revamp of the dependencies code. I have made good progress at cleaning up the code base for easier maintainability and updating to all the latest EAPI's. It now caches dependency atoms to save memory and help speed things along. I have also made the dependency tree fully dynamic and deps can be expanded as long as there are unsatisfied deps or options to expand. And because of this it loads so much quicker due to it not digging deep into the tree. It is done piecemeal every time an expander is toggled open.

I have already completed syntax highlighting for the ebuild view and am working on a custom highlighted ChangeLog view that works with the new view structure I've started using.

Also in svn are translation updates for German (Timo Gurr) and Polish (Arkadiusz Kowalski) so a very big "Thank you" for your work.

All the other languages are in need of translation updates so if you are capable, please help to update the translations. I plan to release -0.6.1 by Christmas with some exciting feature improvements and several bugs I've fixed.

Til next time... Brian.