Commit Graph

40 Commits

Author SHA1 Message Date
Fabio Erculiani 69a2e0e8c0 [entropy.client] drop get_file_permissions, deprecated 2013-02-06 07:44:33 +00:00
Fabio Erculiani 86821d408b [entropy.client] drop deprecated methods 2013-02-06 07:44:33 +00:00
Fabio Erculiani 681e967bf3 [entropy.client] extend get_package_action() with installed_package_id
This allows some lookup speed improvements in case that such data is
already available in the caller.
2012-12-09 11:41:03 +01:00
Fabio Erculiani df3c27deac [entropy*] drop etpUi usage where possible 2012-11-04 22:36:54 +01:00
Fabio Erculiani 3becb6a215 [entropy.*] don't use magic constants for UrlFetcher errors 2012-08-21 10:51:45 +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 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 0ce6633733 [entropy.client] add public method: close_installed_repository() 2012-07-14 16:05:50 +02:00
Fabio Erculiani 853359c208 [entropy.client] make sure to drop any reference to disabled repo when enabling 2012-06-28 15:47:24 +02:00
Fabio Erculiani 18f422a680 [entropy.client] bump configuration file mtime when enabling/disabling repositories
This is useful for any mtime-based cache around. os.rename() doesn't
affect mtime.
2012-06-28 15:46:07 +02:00
Fabio Erculiani 1f9c4fb720 [entropy.client] add installed_repository_path() public method 2012-04-12 12:48:43 +02:00
Fabio Erculiani 4c954a9194 [entropy.client] _lock_resource: always increase lock reference count
Entropy Resouce Locks are reentrant, thus reference counted on lock()
and unlock() operations. For this reason, the counter must be increased
on every lock() request. This did not happen if the lock was already
held by the process with the unwanted effect of improperly releasing it.
This caused the "Calculating dependencies" glitch on each package
transaction.
2012-03-26 14:03:43 +02:00
Fabio Erculiani 99b20257a4 [entropy.client] handle _repodb_cache atomically
This prevents close_repositories() and _open_repository()
to concurrently mess with _repodb_cache, which is a dict, thus
not thread-safe.
2012-03-23 10:14:06 +01:00
Fabio Erculiani 361c4166da [entropy.client] introduce Client.unavailable_repositories()
The method returns a sorted list of repositories identifiers
belonging to repositories that are unavaiable or invalid.
2012-03-16 16:04:15 +01:00
Fabio Erculiani b7d198c776 [entropy.client] Client, more locking cleanup
Never unlink() a lock when releasing it. This is quite bad when
used with shared locks.
At the same time, don't write any pid information in it, because
it's not always reliable (see previous commit).
2012-03-14 16:21:20 +01:00
Fabio Erculiani 7d2633f2a0 [entropy.client] _lock_resource: avoid to deadlock when _unlock_resource is called 2012-03-13 16:05:40 +01:00
Fabio Erculiani 1f334138fb [entropy.client] reorder_mirrors: hostname property can be None
If mirror string (URL string) is malformed, the hostname object
property can be None.
2012-03-11 18:53:42 +01:00
Fabio Erculiani 37133e2ab2 [entropy.client] add Client.promote_resources()
Promoting a previously acquired shared Entropy Resources Lock to
an exclusive one is now possible via Client.promote_resources().
2012-03-09 09:42:27 +01:00
Fabio Erculiani ceeaf62dde [entropy.client] improve code that handles the Entropy Resources Lock 2012-02-19 14:43:41 +01:00
Fabio Erculiani 451c2b158b [entropy.client] add support for shared Entropy resources lock acquisition
This makes possible to support the "readers/writers" model by
letting code to acquire Entropy Resources in shared mode (for
readers) and the same in exclusive mode (default, for writers).
2012-02-15 19:36:29 +01:00
Fabio Erculiani acf5862034 [entropy.client] drop Client.another_entropy_running()
This has been sitting in deprecated state for very long time.
2012-02-15 19:36:28 +01:00
Fabio Erculiani 897a91d443 [entropy.client] migrate Entropy resources locking functions to FlockFile
In order to simplify the code and allow further improvements
(eg. the addition of readers/writers locking), migrate all the
Entropy Resources locking functions to FlockFile().
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 7bd5694b91 [entropy.client.interfaces.methods] fix undefined reference "accomplished" 2011-11-09 10:31:04 +01:00
Fabio Erculiani e527cc7e2e [entropy.client.interfaces.methods] _create_pid_file_lock: handle ENOENT & EACCES correctly, close bug 2835 2011-11-06 19:08:35 +01:00
Fabio Erculiani c5a80890c5 [entropy.client] use entropy.tools.atomic_write() when needed 2011-10-30 08:38:36 +01:00
Fabio Erculiani f638b550f7 [entropy.client] make sure to append "\n" to string when using atomic_write() 2011-10-30 08:29:46 +01:00
Fabio Erculiani f0e033cb61 [entropy.client] fix typo in _clear_package_mask() 2011-10-29 11:28:26 +02:00
Fabio Erculiani 57941d5e2c [entropy.client] reorder_mirrors: try at most once (slow connections will benefit) 2011-10-28 10:16:27 +02:00
Fabio Erculiani 6c16f902fd [entropy.client] use rename_keep_permissions() when moving temp file to destination 2011-10-27 14:26:48 +02:00
Fabio Erculiani 52c271512b [entropy.client] use codecs.open() for opening config files 2011-10-27 14:26:28 +02:00
Fabio Erculiani 85238b8de5 [entropy.*] add support for /etc/entropy/repositories.conf.d/ 2011-10-27 00:07:44 +02:00
Fabio Erculiani 9a012ce2cd [entropy.const] drop another global variable, etpConst['repositoriesconf'] 2011-10-26 17:28:31 +02:00
Fabio Erculiani 48dacf3e5f [entropy.client] avoid to touch other repositories in remove_repository() 2011-10-25 22:49:47 +02:00
Fabio Erculiani 5c0f255f5d [entropy.core] add *.d/* directories support for mask, unmask, license.{mask,accept}, system 2011-10-21 13:51:54 +02:00
Fabio Erculiani 69a0bb87e0 [entropy] move libraries/ to lib/ 2011-10-17 14:27:58 +02:00