Commit Graph

220 Commits

Author SHA1 Message Date
Fabio Erculiani 87e984b303 [entropy.client.services] make get_document_url() fetch atomic
This avoids other instances to pull in invalid/partial data
2012-03-05 23:35:34 +01:00
Fabio Erculiani 058e448ebd [entropy.dump] do not unlink() old cache files if aging threshold is reached
Other cache consumers may still find the cache file valid, even if
for others it's old. So, don't remove the file but just return None.
This way it works more like an "overlay".
2012-03-04 18:10:22 +01:00
Fabio Erculiani bf01329f4d [entropy.services] WebService: make possible to configure cache aging
Configuring cache aging makes possible to automatically throw away
old metadata, like package votes and number of downloads.
Usually, this information is still valid, from user POV, even if
quite old. But how much old? This can be tuned via enable_cache_aging()
from outside WebService class, depending on the scenario.
2012-03-04 18:06:50 +01:00
Fabio Erculiani a48cb985c6 [entropy.cache] EntropyCacher: add cache aging support
Following entropy.dump cache aging suport, this commit exports the
same functionality to Cacher.pop()
2012-03-04 18:05:54 +01:00
Fabio Erculiani 623930ee4b [entropy.dump] add cache aging support to deserializer
If cached file is older than aging_days, it will be removed from
disk (if possible) and None shall be returned
2012-03-04 18:05:37 +01:00
Fabio Erculiani 63947241b4 [entropy.const] do not hardcode "raw_unicode_escape" 2012-03-04 17:57:57 +01:00
Fabio Erculiani 7e3c89f3d6 [entropy.dump] trivial code style update 2012-03-04 17:57:37 +01:00
Fabio Erculiani 527cbbbaa9 [entropy.dump] getobjmtime: fix possible race wrt file removal 2012-03-04 17:56:51 +01:00
Fabio Erculiani 3f45623ab5 [entropy.dump] use etpConst['conf_raw_encoding'] 2012-03-04 17:56:15 +01:00
Fabio Erculiani 21dcdcc636 [entropy.db] _migrateBaseinfoExtrainfo: make sure tables exist before running the query 2012-03-02 17:16:42 +01:00
Fabio Erculiani 81738b8d3a [entropy.client] atom_search: make possible to also search through package description 2012-03-02 08:36:06 +01:00
Fabio Erculiani de72481fbd [entropy.db] searchDescription: improve search results
Improve search results by splitting keyword into multiple words
and searching the unordered concatenation of them.
2012-03-02 08:35:05 +01:00
Fabio Erculiani 303b7ad1ea Release Entropy 1.0_rc90 2012-03-01 12:06:54 +01:00
Fabio Erculiani 3c8ec43e35 [entropy.client.interfaces.dep] SLOT intersection: alter dependency adding slot
Scenario:
dependency = dev-lang/python
SLOT intersection = enabled
available slots = 2.6, 2.7, 3.2
installed slot = 2.7

The SLOT intersection feature worked correctly but in the end
dev-lang/python was added to the unsatisfied set because there
was a dev-lang/python-2.7 update as well. This results in other
dep calculation code to match dev-lang/python against 3.2 instead.
The SLOT intersection feature has to reduce the dependency string
scope by adding a SLOT suffix (in this case: ":2.7"). This way the
correct dependency is eventually pulled in.
2012-03-01 12:01:53 +01:00
Fabio Erculiani 732482473f [entropy.dep] dep_getslot: remove tag before mangling.
Otherwise the following query will fail (at atomMatch()):
x11-drivers/nvidia-drivers:0,3.2.0-sabayon#3.2.0-sabayon
2012-03-01 11:58:47 +01:00
Fabio Erculiani 80f1e1182e [entropy.client.interfaces.dep] don't spam stdout with same progress values 2012-03-01 11:13:51 +01:00
Fabio Erculiani 095038425a [entropy.const] improve thread dump signal function
Always flush stderr on a newline and also write the number of
active threads as well.
Moreover, always install the dump function at SIGQUIT when --debug
is passed.
2012-02-29 10:21:04 +01:00
Fabio Erculiani 161ba2cfd9 [entropy.client.services.interfaces] add ClientWebService.get_images()
Don't ask me why this was missing, anyway, now we have it.
This returns a superset of get_icons(), also including normal images.
2012-02-28 21:57:18 +01:00
Fabio Erculiani b97c1dd8b7 Release Entropy 1.0_rc89 2012-02-27 23:33:12 +01:00
Fabio Erculiani 85ebb0ebac [entropy.const] rework ETP_ARCH_CONST and keywords configuration, make it work with overridden values 2012-02-27 23:18:26 +01:00
Fabio Erculiani 65506c706f Release Entropy 1.0_rc88 2012-02-27 22:56:58 +01:00
Fabio Erculiani 642da47e40 [entropy.const] add _RAW_ENCODING and fix wrong encoding detection code 2012-02-27 19:49:13 +01:00
Fabio Erculiani 18282e3764 [entropy.spm] PortagePlugin: try using raw_unicode_escape when reading .desktop files
Sometimes, upstream .desktop files are encoded using raw_unicode_escape
and we should really fallback to that encoding before giving up reading
them.
2012-02-27 19:47:16 +01:00
Fabio Erculiani a28a92c2a3 [entropy.const] do not hardcode UTF-8 string, but rather use _ENCODING 2012-02-27 19:35:15 +01:00
Fabio Erculiani c1ef9ae4b5 [entropy.client.services] make possible to retrieve documents in reverse order 2012-02-27 10:32:47 +01:00
Fabio Erculiani 550be469a1 [entropy.client.services.interfaces] drop incomplete comment 2012-02-26 22:18:37 +01:00
Fabio Erculiani 4673c622a4 [entropy.spm] improve heuristic used to detect non-kernel ebuilds
This makes possible to have external module packages inside the
sys-kernel/ category, by just adding extra checks. In particular,
we now check against ETYPE ebuild environment variable.
This should guarantee that all the kernel sources, binaries and
headers won't be tagged by Entropy.
2012-02-20 17:52:50 +01:00
Fabio Erculiani 74149c79c1 [entropy.spm] PortagePlugin: be more robust against fucked up portage world file 2012-02-19 14:53:23 +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 1c213a911b [entropy.client] add Repository.get_last_sync_time()
Everytime Repository.sync() is triggered, the last sync time
information is updated. This makes possible to figure out when
the last repository update has been run and warn user about it
if they're too old.
2012-02-17 14:14:38 +01:00
Fabio Erculiani 351b2b23b9 [entropy] fix typo in documentation 2012-02-16 15:58:49 +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 c2d0c81923 [entropy.misc] add non blocking methods to FlockFile 2012-02-15 19:36:28 +01: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 6cdede57ab [entropy.cli] remove deprecated acquire_entropy_locks, release_entropy_locks 2012-02-15 19:36:28 +01:00
Fabio Erculiani 1ae1088983 [entropy.cache] put EntropyCacher to sleep when there's nothing to do
Use a semaphore to signal the worker thread if there's something to do,
otherwise the whole thread should just sleep and avoid to poll every
N seconds.
2012-02-13 16:26:39 +01:00
Fabio Erculiani affcf20425 [entropy.i18n] rename P_() into ngettext().
intltool-update doesn't understand ngettext function exposed as
P_().
2012-02-13 14:14:45 +01:00
Fabio Erculiani e914763b6d [entropy.client.services] implement ram-caching for get_downloads()
get_downloads() was left uncovered from ram-caching of the responses,
in contraddiction to get_votes() and get_available_downloads(), for
example.
2012-02-13 08:50:44 +01:00
Sławomir Nizio a8420b5ad5 [i18n] use ngettext in some places where it's most useful 2012-02-12 15:47:58 +01:00
Fabio Erculiani 7b0c95078b [entropy.client.interfaces.db] do not use "&>", which is bash only
This commit fixes bug #3022
2012-02-10 14:07:48 +01:00
Fabio Erculiani dafc861554 [entropy.spm] PortagePlugin._pkg_foorm: catch OSError during env setup
ebuild environment setup function for pkg_{prerm,postrm} can raise
OSError during os.makedirs(). Better catch it and handle the failure
nicely so that the user can take proper measures to fix it, instead
of completely bailing out with garbageish text.
2012-02-10 13:55:39 +01:00
Fabio Erculiani eca401649d [entropy.fetchers] UrlFetcher: handle HTTP response without Content-Length
It can happen that HTTP servers (or those accessed via Proxy) do not
actually provide Content-Length information in the response.
This caused UrlFetcher to keep __remotesize = 0, which means that
the same thought that the file has been fully downloaded already
under some circumstances.
2012-02-09 21:55:52 +01:00
Fabio Erculiani 056f552dab [entropy.client] implement Client.atom_search
As of today, both Equo and Sulfur implemented their own search
functions because the API didn't provide any direct support for
searching through all the repositories. atom_search() now offers
a basic way to do this, without reinventing the weel every time
in consumer code.
2012-02-08 15:27:57 +01:00
Fabio Erculiani 0ceb055608 Release Entropy 1.0_rc87 2012-02-03 23:06:41 +01:00
Fabio Erculiani 6782d4581a [entropy.spm] PortagePlugin: fix NEEDED.ELF.2 parsing
It can happen that NEEDED.ELF.2 file contains invalid entries,
more specifically, entries that are directories.
2012-02-03 10:57:19 +01:00
Fabio Erculiani b2a0029655 Release Entropy 1.0_rc86 2012-02-01 19:57:15 +01:00
Fabio Erculiani 95ddc907a7 [entropy.const] make possible to override the default arch using /etc/entropy/.arch 2012-02-01 19:56:12 +01:00
Fabio Erculiani 0594b8df4a Release Entropy 1.0_rc85 2012-01-29 12:11:17 +01:00