Ticket #212 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Fix for real the problems with running Umit when a ~/.umit already exists

Reported by: gpolo Owned by: gpolo
Priority: high Milestone: Umit 1.0beta2
Component: Umit Version: current svn
Keywords: Cc:

Description

Running umit when an older ~/.umit exists (supposedly from another installation or something) still causes troubles, I think this was supposedly fixed some time ago but it is not really the case.

I'm assigning this to myself, but I'm not working on it yet so if someone else want to pick it up and fix.. please do it.

Attachments

212.patch (2.9 kB) - added by luis 4 years ago.
first_cut.diff (7.8 kB) - added by gpolo 4 years ago.
second_cut.diff (8.9 kB) - added by gpolo 4 years ago.
final_cut.diff (10.4 kB) - added by gpolo 4 years ago.
final_cut_2.diff (10.7 kB) - added by gpolo 4 years ago.

Change History

  Changed 4 years ago by gpolo

Besides merging config files (and somehow dealing with sqlite3 databases), this tool now should also handle the new directory being used for umit under Windows (as soon as the patch in ticket #213 is committed).

  Changed 4 years ago by gpolo

  • status changed from new to assigned

The merger is mostly done now, some few decisions have to be taken regarding the sqlitedb merger. There are also some few functionalities missing in the sqlitedb merger which do not affect our current sqlite databases, the exception goes to column constraints merging which is not done yet.

The code can be found on the branch named merger, which I intend to add into trunk as a package inside the umit package.

follow-up: ↓ 4   Changed 4 years ago by gpolo

The code regarding sqlitedb merging should be working fine now.

Now umit needs to be adjusted to work with the merge, it would be better/easier to merge the merger branch into trunk and start adjusting there. Anyone against ?

in reply to: ↑ 3   Changed 4 years ago by luis

Replying to gpolo:

The code regarding sqlitedb merging should be working fine now. Now umit needs to be adjusted to work with the merge, it would be better/easier to merge the merger branch into trunk and start adjusting there. Anyone against ?

No. Go ahead.

  Changed 4 years ago by gpolo

The branch is now lives in umit/merger, if anyone wants to complete this then go ahead.

  Changed 4 years ago by cassiano

  • owner changed from gpolo to cassiano
  • status changed from assigned to new

I'm working it.

  Changed 4 years ago by luis

  • owner changed from cassiano to gpolo

rollback after discussing in IRC.

But what files should be called by merged_ini? conf_files = ['umit.conf', 'scan_profile.usp']

Changed 4 years ago by luis

  Changed 4 years ago by luis

with the patch attached I get this:

bastiao@bastiao-desktop:~/projects/umit/umit-svn/trunk$ ./bin/umit 
Traceback (most recent call last):
  File "/home/bastiao/Projects/umit/umit-svn/trunk/umit/gui/MainWindow.py", line 1245, in _exit_cb
    remove_old_data()
  File "/home/bastiao/Projects/umit/umit-svn/trunk/umit/core/DataDecay.py", line 81, in remove_old_data
    remover.remove_old_umit_scans(umit_decay)
  File "/home/bastiao/Projects/umit/umit-svn/trunk/umit/db/Remove.py", line 79, in remove_old_umit_scans
    (old_data_date, )).fetchall()
sqlite3.OperationalError: no such table: scan

May be wrong called in sqlitedb.merger?

  Changed 4 years ago by gpolo

I get a different error:

$ ./bin/umit
Traceback (most recent call last):
  File "./bin/umit", line 213, in <module>
    main(sys.argv)
  File "./bin/umit", line 194, in main
    Path.set_umit_conf(os.path.split(args[0])[0])
  File "/home/gpolo/umit/trunk/umit/core/Paths.py", line 200, in set_umit_conf
    self.update_config_dir(config_dir)
  File "/home/gpolo/umit/trunk/umit/core/Paths.py", line 238, in update_config_dir
    os.path.join(CONFIG_DIR, file))
  File "/home/gpolo/umit/trunk/umit/merger/merge_ini.py", line 23, in merge
    config.read(old_file)
  File "/usr/lib/python2.5/ConfigParser.py", line 267, in read
    self._read(fp, filename)
  File "/usr/lib/python2.5/ConfigParser.py", line 462, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /home/gpolo/.umit/scheduler.log, line: 2
'INFO - 2009-02-19 22:41:07,826 - Scheduler starting..\n'

scheduler.log is not a configuration file, it is not supposed to be merged. I will be working on a patch later tonight.

  Changed 4 years ago by gpolo

I've changed merger.merge_ini.merge signature now. It is just like sqlitedb now.

So the difference now is that it merges from a supposed newer file to a supposedly older file, just like sqlitedb. In your patch you reversed the order for sqlitedb (since they had different order), now to adjust the test-patch you have to reverse both orders -- hope it is not too confusing :)

Changed 4 years ago by gpolo

  Changed 4 years ago by gpolo

We are getting somewhere now, from my head what is remaining now:

* Handle the move from ~/.umit to user localappdata [Windows only] -- yes, this patch I attached doesn't use merger.nt_appdata yet but there are still some details in this step * Write to a file what files got merged, from what version, so we can base on that to merge or not (although I have modified merge_ini now to not write back the config if it didn't change)

I think that is it.

Changed 4 years ago by gpolo

  Changed 4 years ago by gpolo

This now handles the move to local appdata.

Testing is needed, specially under Windows since nt_appdata is totally untested for now. I will be testing it later today, but it would be great if more people tested it (of course).

Changed 4 years ago by gpolo

  Changed 4 years ago by gpolo

I'm still testing this final_cut.diff under Windows, but this is much better than the previous versions. Anyone can help testing and breaking it too ?

Changed 4 years ago by gpolo

  Changed 4 years ago by gpolo

Several minor bugs (which together formed some big ones) fixed in this final_cut_2

  Changed 4 years ago by gpolo

  • status changed from new to closed
  • resolution set to fixed

Committed in r4453.

Note: See TracTickets for help on using tickets.