Commit Graph

39 Commits

Author SHA1 Message Date
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
Fabio Erculiani
df3c27deac [entropy*] drop etpUi usage where possible 2012-11-04 22:36:54 +01:00
Fabio Erculiani
ba0252c152 [entropy.spm] PortagePlugin: kill /* from dependency slot substring 2012-10-17 23:01:08 +02:00
Fabio Erculiani
9c083b3aed [entropy.spm] PortagePlugin: add support for EAPI5 slot operator dependencies 2012-10-17 22:01:42 +02:00
Fabio Erculiani
6ddc4c2f14 [tests] fix Entropy Client tests (add affected_infofiles metadata) 2012-09-08 20:11:23 +02:00
Fabio Erculiani
c39bec886b [tests] fix Entropy Client tests (add affected_infofiles metadata) 2012-09-08 16:56:44 +02:00
Fabio Erculiani
796e71e9ac [repo] migrate shebangs to /usr/bin/python 2012-08-18 16:53:32 +02:00
Fabio Erculiani
1b10177640 [entropy.db.sql] major cursor and connection pooling rework
The original idea was to avoid doing cursor and connection resources
cleanup (left by old and dead threads) synchronously every time
_connection() and/or _cursor() is accessed. This strategy also had
a huge drawback: with no activity on the object, resources were
left hanging there forever.

This commit introduces a better strategy for transparent and automatic
cleanup of resources belonging to terminated threads: every time a new
thread_id arrives at _cursor() or _connection(), a new daemon thread
starts and synchronizes with the caller through a simple Thread.join()
(because it's a daemon thread, we can join() daemon threads as well,
even if this is not really compliant with the specs, but it seems to work
just fine in Python).
When the caller thread is joined, it is possible to start the resources
cleanup procedure, carefully taking into account that thread_ids are
recycled and thus there might be clashing with newly created threads.

This helped a design issue to emerge from the sand (like a zombie
at the seaside): it is impossible to cleanup resources left by the
MainThread because this thread never ends living, and if it dies,
everything dies, obviously. So, the first implementation of this new
strategy was NOT touching the MainThread resources but then, the old
behaviour was to kill them as well on EntropyRepository.close().
So, the final version of this patch kept the old buggy behaviour of
touching MainThread stuff (nein, nein, nein, nein would Hitler say).
However, a new keyword argument "safe" has been added to the close()
method so it is possible to start migrating code to the dark side of the
power.

This means nothing really changed for API consumers yet, just entropy.db.sql
code being more efficient (no weird for loops and synchronous crap)
and actually faster (multi-threading ftw).
2012-08-15 20:59:45 +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
90400c4ade [tests/db] drop SCHEMA_2010 related code 2012-08-10 14:05:05 +02:00
Fabio Erculiani
23847b99eb [tests/server] directly import EntropyRepositoryCacher from entropy.db.cache 2012-08-10 11:38:55 +02:00
Fabio Erculiani
7058db3f0a [entropy.client] simplify content_file Trigger code by passing pre-made metadata 2012-07-28 10:40:29 +02:00
Fabio Erculiani
9c06a380f5 [entropy.client] use retrieveContentIter during Package install 2012-07-27 23:26:19 +02:00
Fabio Erculiani
abb9e515ad [tests] fix EntropyCacher test 2012-07-27 22:30:07 +02:00
Fabio Erculiani
90458f80b6 [entropy.client.services,Rigo] add support for the new get_documents() WS API
The new WebService get_documents() is more efficient in terms of
server resources consumption since it doesn't force the WS engine
to calculate the full result set length, which had little use anyway
in Rigo.
This commit switches entropy.client.services' DocumentList to and
reverse dependencies to use the new WS API. The older WS API will be
kept alive for a while (6 months, roughly).
2012-07-25 22:30:38 +02:00
Fabio Erculiani
b8976f4c0c [entropy.db] EntropyRepository: expose connection and cursor pools
This commit makes possible for subclasses to reimplement the
connection and cursor pool logic.
2012-07-07 13:29:29 +02:00
Fabio Erculiani
8f0c37323a [entropy.spm] PortagePlugin: introduce conditional deps support
Introduce Entropy conditional dependencies supoort if
ETP_PORTAGE_CONDITIONAL_DEPS_ENABLE is set in the environment.
This feature is disabled by default because it braks backward
compatibility and older Entropy Clients are broken wrt this.
2012-04-15 12:24:20 +02:00
Fabio Erculiani
cdf6be90be [tests] Spm: add PortageEntropyDepTranslator tests 2012-04-14 17:49:18 +02:00
Fabio Erculiani
7c2c9437bb [entropy.misc] add FlockFile class
The purpose of this class is to implement a file-based lock,
abstracting away from fcntl.
2012-02-15 19:36:28 +01:00
Fabio Erculiani
4d343233dc [entropy.*] drop usage of another_entropy_running(), wait_resources() or similar methods should be used 2011-11-12 16:10:33 +01:00
Fabio Erculiani
890de38fe2 [tests] spm: fix test_dependencies_calculation() test 2011-10-30 21:07:06 +01:00
Fabio Erculiani
2c97897cfd [tests] ignore outcome of remove_repository() since that is a temp repo 2011-10-27 00:39:08 +02:00
Fabio Erculiani
de47e0de3d [tests] ignore outcome of remove_repository() since that is a temp repo 2011-10-27 00:36:44 +02:00
Fabio Erculiani
85238b8de5 [entropy.*] add support for /etc/entropy/repositories.conf.d/ 2011-10-27 00:07:44 +02:00
Fabio Erculiani
a16ef24829 [tests] server: remove repository in tearDown() 2011-10-25 22:52:28 +02:00
Fabio Erculiani
69a0bb87e0 [entropy] move libraries/ to lib/ 2011-10-17 14:27:58 +02:00