Commit Graph

75 Commits

Author SHA1 Message Date
Fabio Erculiani
aa4e2441be [entropy.client] move _enabled_repos to a property, allow lazy loading 2013-12-12 18:35:17 +01:00
Fabio Erculiani
3a7269aa5c [entropy.db] EntropyBaseRepository: turn lock methods into no-op if direct mode
Now that the repository lock is reentrant, it's good to have the
methods take into account direct mode as well. In direct mode,
we explicitly don't want to deal with any kind of locking, because
we accept to manipulate stale data. In order to hide locking code
from the outside and have it transparently managed inside entropy.*
methods, we must respect requests made in direct mode.
2013-12-12 14:25:44 +01:00
Fabio Erculiani
023e8e1b72 [entropy.db] EntropyBaseRepository: make possible to permanently enable direct mode 2013-12-12 10:21:27 +01:00
Fabio Erculiani
7808ad6b92 [entropy.db.sqlite] migrate locking code to entropy.locks.ResourceLock
The new EntropySQLiteRepository uses ResourceLock, and gains support
for reentrancy, anti-deadlock safety measures (only for nested calls),
unification of memory and file repositories locking code (the semantics
was already the same).
2013-12-10 21:42:34 +01:00
Fabio Erculiani
fc597d04c5 [entropy.security] refactor System, add internal locking support, improve speed 2013-12-10 16:39:17 +01:00
Fabio Erculiani
94ab49fd0b [tests] use const_mk{s,d}temp instead of tmpfile ones, default TMPDIR to /var/tmp 2013-12-09 14:36:34 +01:00
Fabio Erculiani
6a2d45df47 [entropy.locks] set recursed to False only when the reference counter is 0 2013-12-09 14:24:37 +01:00
Fabio Erculiani
d080db0d3b [tests] locks: fix test class name 2013-12-09 14:21:05 +01:00
Fabio Erculiani
bf3a8b79f9 [entropy.locks] use TLS for reentrancy safety checks, update tests 2013-12-09 14:19:21 +01:00
Fabio Erculiani
ebf63e6060 [entropy.locks] fix shared/exclusive locking mix due to reentrancy, add tests 2013-12-08 16:15:39 +01:00
Fabio Erculiani
3545f2b619 [entropy.db] add direct access support to repository
In latency sensitive code paths, the performance penality caused
by file lock contention and memory cache invalidation is too high.
This problem happens in Rigo, which is extremely latency sensitive.
Since we don't want to crap on the user, a way to solve this is
letting API consumers skip the memory cache and read data directly
from the database store. The trade off is that data may be stale,
incomplete, or invalid, but as long as the consumer is aware of this,
that's fine.
2013-12-07 20:30:06 +01:00
Fabio Erculiani
6af6a2115e [entropy.client] move Trigger class under package.actions, make it "private" 2013-12-07 20:29:20 +01:00
Fabio Erculiani
c54c893e55 [entropy.db] implement locking infrastructure (with the same semantics) for in-memory repositories 2013-12-07 20:27:57 +01:00
Fabio Erculiani
d7f22534b2 [entropy.db] rewrite locking infrastructure, handle multithreading use case 2013-12-07 20:27:57 +01:00
Fabio Erculiani
e717f7a1b3 [entropy.db.sqlite] drop support for locking based on rwsem for memory repositories
Firstly, rwsem is semantically different from flock (but this was known) and
this may confuse the API consumer. Secondly, the locking infrastructure is
purely meant for inter-process synchronization, threads synchronization is
not a current use case.
2013-12-07 20:25:55 +01:00
Fabio Erculiani
366fc37f59 [entropy.db.sqlite] implement locking infrastructure 2013-12-07 20:24:23 +01:00
Fabio Erculiani
8852a15913 [entropy.misc] add shared(), release() context managers to FlockFile 2013-12-07 20:24:22 +01:00
Fabio Erculiani
a2e1e6ba94 [entropy.client] delay installed repository initialization as much as possible 2013-12-05 23:11:36 +01:00
Fabio Erculiani
a42711086b [tests] tools: mute output 2013-11-30 11:23:40 +01:00
Fabio Erculiani
cd6d6b9d22 [tests] use const_mkdtemp() instead of tempfile.mkdtemp() 2013-11-30 10:54:13 +01:00
Fabio Erculiani
3a05acd16a [tests] spm: use const_mkdtemp() instead of tempfile.mkdtemp 2013-11-30 08:25:30 +01:00
Fabio Erculiani
a01f0bd103 [tests] mute QA and Security test function outputs 2013-11-29 19:41:08 +01:00
Fabio Erculiani
982d99fe30 [tests] client: silence tests 2013-11-29 19:37:24 +01:00
Fabio Erculiani
464ae46d90 [tests] drop debug output 2013-11-29 19:29:12 +01:00
Fabio Erculiani
e406a4edaa [entropy.*] create new dependencies metadata "pkg_dependencies"
The old "dependencies" metadata is deprecated. It was found that
the generated metadata might get corrupted by colliding atom strings.
The new implementation avoids collisions completely and is more
efficient.
2013-11-29 19:15:44 +01:00
Fabio Erculiani
2b082167cd [entropy.tools] read_elf_real_dynamic_libraries: correctly filter out elf_file 2013-11-29 16:30:23 +01:00
Fabio Erculiani
56bc937e47 [tests] cleanup run 2013-11-28 19:55:00 +01:00
Fabio Erculiani
e7c482ac21 [entropy.db] add atom field to preserved_libs metadata 2013-11-27 12:30:09 +01:00
Fabio Erculiani
005ac42610 [tests] port code to the new PackageActionFactory API 2013-11-23 13:58:39 +01:00
Fabio Erculiani
7091c56fe0 [entropy.tools] rewrite read_elf_linker_paths(), improve speed, add tests 2013-11-21 16:43:18 +01:00
Fabio Erculiani
60af35b748 [entropy.tools] rewrite read_elf_broken_symbols(), add tests 2013-11-21 16:30:51 +01:00
Fabio Erculiani
70fc459840 [entropy.tools] rewrite read_elf_real_dynamic_libraries(), add tests 2013-11-21 16:05:29 +01:00
Fabio Erculiani
96ef5868f4 [entropy.db] initial repository database support for preserved libraries 2013-11-20 17:09:48 +01:00
Fabio Erculiani
7eb0687ba9 [entropy.db] make listAllDependencies() public 2013-11-19 14:48:20 +01:00
Fabio Erculiani
5f93a73f46 [tests] update bytes_into_human() test case 2013-11-03 16:59:20 +01:00
Fabio Erculiani
060c12193d [entropy.tools] drop spawn_function(), no longer needed 2013-09-18 20:50:45 +02:00
Fabio Erculiani
b6e028cf24 [tests] misc: fix FastRSS tests 2013-04-02 23:35:34 +01:00
Fabio Erculiani
4183fe9b6c [tests] db: fix some tests to accomodate Python 3.3 2013-04-02 23:23:42 +01:00
Fabio Erculiani
2dc1438373 [tests] security: create temporary directory using TMPDIR or, if unset, $PWD 2013-03-23 19:00:15 +00:00
Fabio Erculiani
b395b13d84 [tests] db: fix test_libs_download 2013-03-23 11:42:42 +00:00
Fabio Erculiani
831237b7fc [entropy.server] insert the package SHA1 checksum into the file name
This commit partially reverts commit d6b7a21314.
Package revision is no longer incremented across package moves.
This has two advantages:
  - much less traffic generated on the mirror infrastructure
  - less updates for sabayon-limbo users when packages are moved to main

Bumping the revision was required by sabayon-weekly, which had the problem
that some package files were replaced during normal activity on
sabayonlinux.org and sabayon-limbo on the mirror. This generated checksum
errors, thus adding the checksum in the package file name ensures that
Entropy Server will never overwrite package file names unless the checksum
also matches.
Having a SHA1 checksum in the file name is also good for security, and
we may even want to create a SHA1 from the GPG signature in future.
2013-03-20 15:21:31 +00:00
Fabio Erculiani
bc63d82b97 [entropy.server] add support for server-side repositories.conf.d/ repository config files
Entropy Server now supports repositories defined inside
    /etc/entropy/repositories.conf.d/ files, written using the
    syntax detailed below. This improves the ability to enable, disable,
    add and remove repositories programmatically. Furthermore, it
    makes possible to extend the supported parameters without breaking
    backward compatibility.

    In order to differentiate Entropy Client repository definitions between
    Entropy Server ones, each repository section must start with "[server=".

    This is an example of the syntax (with a complete listing
    of the supported arguments):

    [server=sabayon-limbo]
    desc = Sabayon Linux Official Testing Repository
    repo = ssh://username@full.host:~username/sabayon-limbo
    enabled = <true/false>

    [server=sabayon-limbo]
    desc = This statement will be ignored.
    repo-only = ssh://username@repo.host:~username/sabayon-limbo
    pkg-only = ssh://username@pkg.host:~username/sabayon-limbo

    [server=sabayon-base]
    desc = This is the base repository.
    repo-only = ssh://username@repo.host:~username/sabayon-base
    pkg-only = ssh://username@pkg.host:~username/sabayon-base
    base = <true/false>

    As you can see, multiple statements for the same repository
    are allowed. However, only the first desc = statement will be
    considered, while there can be as many {pkg,repo}* = as you want.

    The repository order is important, but this is guaranteed by the
    fact that configuration files are parsed in lexical order.

    Statements description:
    - "desc": stands for description, the repository name description.
    - "repo": the push & pull URI, for both packages and repository database.
    - "repo-only": same as repo, but only for the repository database
                   push & pull.
    - "pkg-only": same as repo, but only for the packages push & pull.
             The supported protocols are those supported by entropy.fetchers.
    - "enabled": if set, its value can be either "true" or "false". The default
                 value is "true". It indicates if a repository is configured
                 but currently disabled or enabled. Please take into account
                 that config files in /etc/entropy/repositories.conf.d/ starting
                 with "_" are considered to contain disabled repositories. This
                 is just provided for convienence.
    - "base": if set, its value can be either "true" or "false". The default
              value is "false". If no repository has the flag set, the first
              listed repository will be the base one. Only the first repository
              with "base = true" will be considered. The base repository is the
              repository that is considered base for all the others
              (the main one).
2013-03-10 22:12:27 +00:00
Fabio Erculiani
5d315c70bd [entropy.const] drop /var/run/entropy/entropy.lock file and directory handling
This is no longer used by Entropy, which does use a more fine grained locking
instead.
2013-02-24 23:34:49 +01:00
Fabio Erculiani
9eb56dbc14 [entropy.const] drop several etpConst constants, replace with more OO vars
etpConst['clientdbid'] is kept for backward compatibility, but will be removed soon
While etpConst['serverdbid'] and etpConst['clientserverrepoid'] are gone.
2013-02-20 00:56:52 +00:00
Fabio Erculiani
8807ff8ba7 [entropy.tools] drop get_random_temp_file, deprecated 2013-02-06 07:44:33 +00:00
Fabio Erculiani
7473ff1c04 [tests] db: extend test_needed with another test pkg 2012-12-22 12:46:53 +01:00
Fabio Erculiani
d42003ba94 Merge remote-tracking branch 'origin/solo'
Conflicts:
	client/po/bg.po
	client/po/ca.po
	client/po/cs.po
	client/po/da.po
	client/po/de.po
	client/po/entropy.pot
	client/po/es.po
	client/po/es_CL.po
	client/po/fr.po
	client/po/fr_CA.po
	client/po/it.po
	client/po/nl.po
	client/po/pl.po
	client/po/pt.po
	client/po/pt_BR.po
	client/po/ru.po
	client/po/sk.po
	client/po/sv.po
	client/po/uk.po
	client/po/zh_TW.po
	client/revision
	docs/ChangeLog
	docs/TODO
	lib/entropy/cache.py
	lib/entropy/client/interfaces/db.py
	lib/entropy/const.py
	lib/entropy/revision
	lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py
	server/revision
2012-11-06 22:35:01 +01:00
Fabio Erculiani
d1fa09ffb4 [entropy.*] remove etpUi imports 2012-11-06 21:24:41 +01:00
Fabio Erculiani
0deb4464e7 [entropy.const] kill etpUi['mute'] 2012-11-06 21:16:16 +01:00
Fabio Erculiani
2512df68ad [lib/] drop etpUi['debug'] 2012-11-06 20:13:49 +01:00