Commit Graph

454 Commits

Author SHA1 Message Date
Fabio Erculiani
a8e2bbd3ba [entropy.db.sql] do not catch any exception in commit() 2012-08-12 12:08:23 +02:00
Fabio Erculiani
70c6823b90 [entropy.client.package] fix non-deterministic bug with Python File.readline()
This issue caused a load of issues with the ca-certificates.

Example of partial readline():
0|obj|/usr/share/ca-certificates/mozilla/NetLock_Arany_=Class_Gold=_F\xc3\x85
and the next call:
\xc2\x91tan\xc3\x83\xc2\xbas\xc3\x83\xc2\xadtv\xc3\x83\xc2\xa1ny.crt\n

Trying to workaround it by reading ahead if line does not end with \n
2012-08-12 11:53:50 +02:00
Fabio Erculiani
c5e80d4153 [entropy.db.sql] define a common API for Cursor and Connection wrappers 2012-08-12 11:39:36 +02:00
Fabio Erculiani
beb21f1660 [entropy.db] move other standard SQL code to entropy.db.sql 2012-08-12 10:29:41 +02:00
Fabio Erculiani
27a51598a0 [entropy.db] move most of the standard SQL code to entropy.db.sql 2012-08-11 21:58:41 +02:00
Fabio Erculiani
4ea217f3fd [entropy.db.mysql] replace FLOAT with REAL for mtime (FLOAT did not give enough precision) 2012-08-11 20:24:28 +02:00
Fabio Erculiani
74f7b4d730 [entropy.db.mysql] fix __iter__ support, iter(self._cur) MUST returned 2012-08-11 18:15:33 +02:00
Fabio Erculiani
7a950cb4b9 [entropy.db] abstract exceptions away from sqlite3
Wrap the Cursor object around and execute every method through
a proxy function that catches adapter-specific exceptions and
translates them into entropy.db.exceptions ones. This way Entropy
is eventually sqlite3 agnostic and adapters for several storage
engines can be written without affecting the rest of the codebase.
2012-08-10 21:35:50 +02:00
Fabio Erculiani
8ac22f4beb [entropy.client.package] FileContent*Reader: keep raising StopIteration() at the end 2012-08-10 17:51:22 +02:00
Fabio Erculiani
08a4343597 [entropy.client.package] add a bit of paranoia to Content*Writers' close() 2012-08-10 17:44:12 +02:00
Fabio Erculiani
2e6e790677 [entropy.db.sqlite] EntropyRepository.retrieveSignatures: check if table exists 2012-08-10 14:06:24 +02:00
Fabio Erculiani
0461ca413a [entropy.db] do not check if "settings" table exists, we're fault tolerant 2012-08-10 14:05:31 +02:00
Fabio Erculiani
90400c4ade [tests/db] drop SCHEMA_2010 related code 2012-08-10 14:05:05 +02:00
Fabio Erculiani
dc4556ef46 [entropy.db] create entropy.db.sql (holding standard SQL methods)
entropy.db.mysql and entropy.db.sqlite are now subclassing
EntropySQLRepository. Methods will be moved there during the
next forthcoming overhaul. Implement ModuleProxy support and
alleviate the exception class objects issue (sqlite3 based
exceptions are thrown by entropy.db.sqlite and oursql based
exceptions are thrown by entropydb.mysql, and there is no
easy/quick fix for this apparently, besides wrapping all the
cursor calls).
2012-08-10 11:41:29 +02:00
Fabio Erculiani
95d23764c3 [entropy.db.skel] move SETTING_KEYS and add ModuleProxy to EntropyRepositoryBase 2012-08-10 11:39:30 +02:00
Fabio Erculiani
23847b99eb [tests/server] directly import EntropyRepositoryCacher from entropy.db.cache 2012-08-10 11:38:55 +02:00
Fabio Erculiani
ea1922bc9d [entropy.db.mysql] fix typos in string format 2012-08-10 10:41:08 +02:00
Fabio Erculiani
8ebf92f17b [entropy.db.sqlite] enable _SCHEMA_2010_SUPPORT by default. 2012-08-10 10:24:57 +02:00
Fabio Erculiani
b65962382d [entropy.db.mysql] migrate to oursql (from MySQLdb) 2012-08-10 10:09:43 +02:00
Fabio Erculiani
e24bf78b63 [entropy.db.mysql] finalize schema (data types) 2012-08-10 10:09:18 +02:00
Fabio Erculiani
2bac80d76a [entropy.db.sqlite] catch OperationalError instead of Error 2012-08-09 17:25:11 +02:00
Fabio Erculiani
37e1d0f465 [entropy.db.sqlite] always enforce LIMIT 1 when using Cursor.fetchone()
Certain adapters don't clear cursor data automatically if fetchone()
is used and LIMIT 1 is not enforced.
2012-08-09 15:05:06 +02:00
Fabio Erculiani
ea17f96d99 [entropy.db.sqlite] check if settings table exists before spawning schema updates 2012-08-09 15:04:16 +02:00
Fabio Erculiani
690984caf4 [entropy.db.sqlite] fix query statement 2012-08-09 13:40:24 +02:00
Fabio Erculiani
7e6c9530c1 [entropy.db] move alignDatabases() to entropy.db.skel class 2012-08-09 13:40:04 +02:00
Fabio Erculiani
4ddc162428 [entropy.db.mysql] increase datatypes' size 2012-08-09 09:45:59 +02:00
Fabio Erculiani
56be066b5a Release Entropy 132 2012-08-09 01:07:48 +02:00
Fabio Erculiani
ac77ed6d9e [entropy.db.mysql] tweak some schema values 2012-08-09 01:01:41 +02:00
Fabio Erculiani
deb5947452 [entropy.db] expose EntropyRepositoryCacher via entropy.db 2012-08-09 01:01:41 +02:00
Fabio Erculiani
d71bf47e7d [entropy.client.package] relax "path" contraints and be tolerant against broken pkgs 2012-08-08 21:49:53 +02:00
Fabio Erculiani
ad74ade00c [entropy.db] add MySQL connector (barely tested !!!) 2012-08-08 18:47:25 +02:00
Fabio Erculiani
a1e7d92bfb [entropy.db.sqlite] trivial fixes (remove imports, catch IOError, etc) 2012-08-08 17:10:20 +02:00
Fabio Erculiani
a7f958afd1 [entropy.db] split entropy.db package module into cache and sqlite 2012-08-08 11:11:42 +02:00
Fabio Erculiani
0c15d697a3 [entropy.spm] PortagePlugin._extract_pkg_metadata_content: filter out empty path strings 2012-08-08 00:37:40 +02:00
Fabio Erculiani
3ffbbcb49d [entropy.client.package] _generate_content_file: do not catch Exception
Move the os.remove() call to the finally block and detect failures via
a status boolean. This way, warnings won't be raised as exceptions.
2012-08-07 22:02:37 +02:00
Fabio Erculiani
58cb8adf96 [entropy.client.package] _generate_content_safety_file: do not catch Exception
Move the os.remove() call to the finally block and detect failures via
a status boolean. This way, warnings won't be raised as exceptions.
2012-08-07 22:02:21 +02:00
Fabio Erculiani
55472f77e2 Release Entropy 1.0_rc131 2012-08-05 22:33:41 +02:00
Fabio Erculiani
cc93458fd1 [entropy.client.methods] optimize reorder_mirrors() configuration commit code
Move reorder_mirrors() logic to benchmark_mirrors() for easier code
reuse. Avoid touching Repository objects and clearing SystemSettings
metadata but rather atomically update them in place.
2012-08-03 15:41:39 +02:00
Fabio Erculiani
87f882357f [entropy.client.methods] reorder_mirrors: make it atomic 2012-08-03 14:19:02 +02:00
Fabio Erculiani
af5a573d23 [entropy.client.methods] reorder_mirrors: enforce a reasonable upper bound timeout value 2012-08-03 14:18:23 +02:00
Fabio Erculiani
4a77fd59dd [entropy.client.methods] fix typos in docstring 2012-08-03 14:17:58 +02:00
Fabio Erculiani
5a24d2c174 [entropy.fetchers] make possible to override the default timeout 2012-08-03 14:15:42 +02:00
Fabio Erculiani
a7358e63eb [entropy.client.methods] split internal add/remove repository functions 2012-08-03 13:50:11 +02:00
Fabio Erculiani
76e045d7b6 [entropy.client.methods] add "commit" keyword arg to reorder_mirrors() 2012-08-03 13:28:27 +02:00
Fabio Erculiani
eb71741246 [entropy.client.package] remove tmp_file_content in the finally statement
Doing so in the Exception "handler" code messes up the traceback
information useful for debugging other possible issues.
2012-08-02 00:36:19 +02:00
Fabio Erculiani
8dc597c19d Release Entropy 1.0_rc130 2012-08-01 22:41:09 +02:00
Fabio Erculiani
11d013094e [entropy.client] use bytestring when dealing with the os module functions
In Python 2.x, the os module only works with bytestring. Using unicode
with it causes errors with multibyte characters (test pkgs: aspell-es,
aspell-pt) resulting in leftover files when removing package content.
2012-08-01 22:37:55 +02:00
Fabio Erculiani
c803b94533 [entropy.client] generate items_installed with unicode objects, not bytestring 2012-08-01 22:37:25 +02:00
Fabio Erculiani
0eec9cd4e9 [entropy.client] file_items_installed Set is no longer used, remove 2012-08-01 22:34:21 +02:00
Fabio Erculiani
cf86ca664d [entropy.client.trigger] call environment_update() whenever ENV_DIRS have been touched 2012-08-01 18:48:12 +02:00