Commit Graph

11546 Commits

Author SHA1 Message Date
Sławomir Nizio 6bdcd152c8 [entropy.client.misc] correct ConfigurationFiles with Python 3
1. Command to execute (diff) was getting arguments like b"path".
2. Crash when priting message.
3. In Python 3, b'x'[0] is int, not str, so a test (if) was (silently)
always true. This way, upon eit commit (at least) and with Python 3,
warning about not merged configuration files was newer printed.

(3) prevented prior discovery of (1) and (2).

Based on my checks, there are no more problems like (3), but I cannot
tell for sure.
2019-11-09 12:14:10 +01:00
Ettore Di Giacinto 65c28deb2e Tagging Entropy version 320 320 2019-11-07 17:21:33 +01:00
Ettore Di Giacinto f2cac41869 Release Entropy 320 2019-11-07 17:21:28 +01:00
geaaru b55adfafe8 Merge pull request #79 from Enlik/qfile-no-e
[entropy.spm] adapt to qfile from portage-utils-0.80
2019-10-05 11:26:28 +02:00
Sławomir Nizio 54a3e50017 [entropy.spm] adapt to qfile from portage-utils-0.80
In 0.74 -e was available, and in 0.80 it is not present.
In both versions, and with the same set of options used, -e and -v
provide the same result so -v is now used to work on both.

Changed in portage-utils, commit 951a8711a59b1a7d49125f5f5214ff1ae9e50074:

    qfile: drop non-functional --exact option

    Bug: https://bugs.gentoo.org/678632
2019-10-02 02:01:07 +02:00
Enlik d2c1bcd13b Merge pull request #76 from geaaru/fix-unused
unused: fix wrong variable reference
2019-08-18 21:27:49 +02:00
geaaru 67cde5ac5c Merge pull request #78 from geaaru/fix-utf8-issue
Handle unicode decode error as not text file - #77
2019-08-17 19:21:15 +02:00
Daniele Rondina 8647a8739d Handle unicode decode error as not text file - #77 2019-08-17 17:18:35 +02:00
Daniele Rondina 84ff779709 unused: Fix search with spm 2019-08-15 11:29:18 +02:00
geaaru 0b24448404 Merge pull request #75 from Enlik/completions
[solo.commands.command] simplify and improve bash completions
2019-07-18 16:39:53 +02:00
Sławomir Nizio b2c8e2c819 [solo.commands.command] simplify and improve bash completions
Note: <tab> below can mean double <tab>.

This commit fixes cases such like the following ones:

* crash (issue !73) - e.g. KeyError: u'--mtime':
    - equo security oscheck --mtime <tab>
    - equo query graph --complete <tab>
      (this was due to a typo in variable name)

* now prints options, previously it didn't:
    - equo install -a <tab>

* crashed, or (with only variable name fixed) didn't print all options:
    - equo security oscheck --mtime <tab>
      (note that it worked with more special -q instead of --mtime etc.)

* didn't print all options:
    - equo query list installed <tab>
      (now shows also --by-user)

The following behaviour is still buggy:

* last typed word (note: no space before <tab>) disappears upon completion:
    - equo security oscheck<tab>
      (not a regression)
    - equo install --deep<tab>
      (here it's an option; regression! - previously it didn't complete but
      didn't cause the word to be erased either)

These can be corrected reliably when something like ${COMP_WORDS[COMP_CWORD]}
(from complete -F) is passed to the Python side.
Without this it's not possible to distinguish between `recognized_option<tab>`
(completion of recognized_option) and `recognized_option <tab>`.
2019-07-16 08:35:32 +02:00
geaaru fa6068b2e4 Merge pull request #70 from geaaru/arm-iuse-fix
Fix handling IUSE with default options with Python 3
2019-07-12 22:42:29 +02:00
Geaaru 427bc90bc0 Process IUSE with default option correctly
On ARM environment injection of packages doesn't handle
correctly IUSE with default options (+)/(-) and this
doesn't expose correctly the USE flags of the package for dependencies
test.

Example:

  ╠  @@ Searching...
  ╠      @@ Package: app-arch/xz-utils-5.2.4-r2 branch: 5, [__system__]
  ╠          Category:        app-arch
  ╠          Name:            xz-utils
  ╠          Masked:          False
  ╠          Installed:       version: 5.2.4-r2 ~ tag: NoTag ~ revision:
  9999
  ╠          Slot:            0
  ╠          Size:            29.3kB
  ╠          Download:
  packages/armv7l/5/app-arch/app-arch:xz-utils-5.2.4-r2.efbac860e08851659458db1e4b55a03c3f3711e0.tbz2
  ╠          Checksum:        0
  ╠          SHA1:            efbac860e08851659458db1e4b55a03c3f3711e0
  ╠          SHA256:
  69989fb2f120539938b060531ba17e8cc2e2e3ed879ef937aacc5f2b9abcfc70
  ╠          GPG:             No
  ╠          ## Dependencies:
  ╠          ##               [3] >=app-portage/elt-patches-20170815
  ╠          ##               Legend:
  ╠          ##               {0} Runtime dependency
  ╠          ##               {1} Post dependency
  ╠          ##               {2} Manually added (by staff) dependency
  ╠          ##               {3} Build dependency
  ╠          ## Conflicts:
  ╠          ##               <app-arch/lzma-4.63
  ╠          ##               <app-arch/p7zip-4.57
  ╠          ##               app-arch/lzma-utils
  ╠          Homepage:        https://tukaani.org/xz/
  ╠          Description:     utils for managing LZMA compressed
  ╠                           files
  ╠          USE flags:       -+extra-filters -+threads -abi_mips_n32
  ╠                           -abi_mips_n64 -abi_mips_o32
  ╠                           -abi_ppc_32 -abi_ppc_64 -abi_s390_32
  ╠                           -abi_s390_64 -abi_x86_32 -abi_x86_64
  ╠                           -abi_x86_x32 -elibc_FreeBSD
  ╠                           -static-libs arm armv5te armv6
  ╠                           armv6t2 big-endian cpu_flags_arm_edsp
  ╠                           cpu_flags_arm_thumb cpu_flags_arm_thumb2
  ╠                           cpu_flags_arm_v4 cpu_flags_arm_v5
  ╠                           cpu_flags_arm_v6 cpu_flags_arm_v7
  ╠                           cpu_flags_arm_vfp elibc_glibc
  ╠                           kernel_linux nls userland_GNU

USE flags extra-filters and threads MUST in the format:

╠          USE flags:       -abi_mips_n32 -abi_mips_n64
╠                           -abi_mips_o32 -abi_ppc_32 -abi_ppc_64
╠                           -abi_s390_32 -abi_s390_64 -abi_x86_32
╠                           -abi_x86_64 -abi_x86_x32 -elibc_FreeBSD
╠                           -static-libs arm armv5te armv6
╠                           armv6t2 big-endian cpu_flags_arm_edsp
╠                           cpu_flags_arm_thumb cpu_flags_arm_thumb2
╠                           cpu_flags_arm_v4 cpu_flags_arm_v5
╠                           cpu_flags_arm_v6 cpu_flags_arm_v7
╠                           cpu_flags_arm_vfp elibc_glibc
╠                           extra-filters kernel_linux nls
╠                           threads userland_GNU
2019-07-12 22:20:49 +02:00
Ettore Di Giacinto 6628e0dd81 Merge pull request #72 from geaaru/equo-generate
Improve equo generate subcommand for CI
2019-03-14 20:25:43 +01:00
Daniele Rondina cdaffff03b Improve equo generate subcommand for CI
Add option --force-non-interactive to generate
sub command to avoid use of expect tool.
2019-03-14 18:44:47 +01:00
Ettore Di Giacinto 35a3fa3c75 Merge pull request #68 from Enlik/modules-reorg
Make Entropy able to work from within Python site directory
2019-03-13 22:48:40 +01:00
Ettore Di Giacinto cd640cebd3 Merge pull request #71 from geaaru/inject-reset-revision
eit: Add --reset-revision option to inject command
2019-03-06 21:07:47 +01:00
Daniele Rondina 215e5b019e eit: Add --reset-revision option to inject command 2019-03-01 19:02:56 +01:00
Sławomir Nizio 545b5a7ca4 [tests] fix import path
It couldn't find and load _entropy.solo.commands.pkg.
2018-11-26 21:09:08 +01:00
Sławomir Nizio 7fe54dc2e0 [entropy_path_loader] make _add_import_path private 2018-11-26 20:15:36 +01:00
Sławomir Nizio ed93a3737d update RigoDaemon imports 2018-11-26 20:15:36 +01:00
Sławomir Nizio 503e7077f3 update rigo imports 2018-11-26 20:15:36 +01:00
Sławomir Nizio 3e74fa847c update matter imports 2018-11-26 20:15:36 +01:00
Sławomir Nizio 321d59614f update eit imports + minor rename in entropy_path_loader 2018-11-26 20:15:36 +01:00
Sławomir Nizio 713cf0e927 usage magneto imports 2018-11-26 20:15:36 +01:00
Sławomir Nizio 7cf7e1f6b7 convert solo imports, with needed changes to entropy_path_loader
The module entropy_path_loader (used only for running from within the
checkout; otherwise not even installed) is made to provide the _entropy
namespace.

(Other ideas instead of this entropy_path_loader change would be to
reorganise files layout; drop support for running from the checkout as
is - and perhaps require virtualenvs; require sourcing a script that
sets PYTHONPATH. However, as implemented, it is not intrusive, and the
good part is that it is quite isolated, not used in normal usage after
installation. Basically, it only does sys.path + provides _entropy
namespace.)
2018-11-26 20:15:36 +01:00
Sławomir Nizio 6d4a3f09e6 makefiles: establish a layout for sitedir installs
The idea is that:
- entropy.* imports will work as before (so any 3rd party clients will
  work as always) - installed in "entropy" package,
- new "_entropy" package to hold a namespace for private modules (like
  ones that required adding special directories to sys.path).
  (Underscored name for a top level Python module is not very common...
  anyway, it was inspired by "_emerge.")

Layout:
site-packages/
    entropy (backwards compatible)
	const.py
	...
    kswitch (also toplevel to keep compatibility)
	...
    _entropy
	eit
	magneto
	matter
	rigo
	RigoDaemon
	solo

(Note that site-packages does not need to be actually Python's
site-packages directory but anything as it is controlled by an argument
to make. It is however intended to be the sitedir.)

Another idea for a layout would be one that mimics sources checkout, but
the layout there is somewhat scattered. (And some ugliness would be
needed to make them modules before implicit namespaces from Python 3.3.
Anyway, imports would be long and ugly.)

Now, the layout of installed Entropy is lean; installation to virtualenv
is also possible (though there would be a need to call scripts like
"python equo.py" as shebangs are not converted).

Follow up changes are needed to make it work.
2018-11-26 20:15:36 +01:00
Sławomir Nizio 252c260f06 use entropy_path_loader only for running from the checkout
After this commit alone it would not work when installed (unless module
paths are set in a special way). Next changes will introduce
installation to site-packages so no custom PYTHONPATH will be necessary.
2018-11-26 20:15:36 +01:00
Ettore Di Giacinto 7a4cf787b8 Tagging Entropy version 319 319 2018-11-22 21:59:21 +01:00
Ettore Di Giacinto e16a1585ec Release Entropy 319 2018-11-22 21:59:03 +01:00
Ettore Di Giacinto 6eedde7237 Merge pull request #67 from Enlik/fasterxpak
[entropy.spm] speed up xpak finding
2018-11-16 18:30:32 +01:00
Ettore Di Giacinto 450456a4ec Merge pull request #65 from Enlik/modules-reorg
Preparation for installation in Python-specific directories
2018-11-16 18:29:44 +01:00
Sławomir Nizio a0d8c18b49 [entropy.spm] speed up xpak finding
Now it's chunk based, so fewer reads and seeks, and searching itself
is improved as well.
2018-11-14 09:10:34 +01:00
Fabio Erculiani 1c083477dc Merge pull request #66 from geaaru/eit-push-py36
Fix vacuum on py3.6
2018-11-05 10:07:02 +01:00
Geaaru 4b728b998e Fix vacuum on py3.6
pysqlite has a bug on use VACUUM with py3.6 (see https://github.com/ghaering/pysqlite/issues/109)

Hereinafter, exception related to eit push --quick --force <REPO> command:

Traceback (most recent call last):
  File "/usr/lib/entropy/lib/entropy/db/sql.py", line 166, in _proxy_call
    return method(*args, **kwargs)
sqlite3.OperationalError: cannot VACUUM from within a transaction

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/eit", line 17, in <module>
    main()
  File "/usr/lib/entropy/server/eit/main.py", line 114, in main
    exit_st = func(*func_args)
  File "/usr/lib/entropy/server/eit/commands/command.py", line 237, in _call_exclusive
    return func(server)
  File "/usr/lib/entropy/server/eit/commands/push.py", line 172, in _push
    rc = self._push_repo(entropy_server, repository_id)
  File "/usr/lib/entropy/server/eit/commands/push.py", line 184, in _push_repo
    rc = self.__push_repo(entropy_server, repository_id)
  File "/usr/lib/entropy/server/eit/commands/push.py", line 309, in __push_repo
    sts = self.__sync_repo(entropy_server, repository_id)
  File "/usr/lib/entropy/server/eit/commands/push.py", line 262, in __sync_repo
    enable_download = False, force = self._force)
  File "/usr/lib/entropy/lib/entropy/server/interfaces/mirrors.py", line 1673, in sync_repository
    enable_upload, enable_download, force = force)
  File "/usr/lib/entropy/lib/entropy/server/interfaces/db.py", line 231, in update
    enable_upload, enable_download, force = force).update()
  File "/usr/lib/entropy/lib/entropy/server/interfaces/db.py", line 404, in update
    rc, fine_uris, broken_uris = self._sync()
  File "/usr/lib/entropy/lib/entropy/server/interfaces/db.py", line 1873, in _sync
    broken_uris = self._upload(uris)
  File "/usr/lib/entropy/lib/entropy/server/interfaces/db.py", line 1529, in _upload
    self._shrink_and_close(dbconn)
  File "/usr/lib/entropy/lib/entropy/server/interfaces/db.py", line 1234, in _shrink_and_close
    entropy_repository.vacuum()
  File "/usr/lib/entropy/lib/entropy/db/sqlite.py", line 703, in vacuum
    self._cursor().execute("vacuum")
  File "/usr/lib/entropy/lib/entropy/db/sqlite.py", line 58, in execute
    cur = self._proxy_call(self._cur.execute, *args, **kwargs)
  File "/usr/lib/entropy/lib/entropy/db/sql.py", line 173, in _proxy_call
    raise OperationalError(err)
entropy.db.exceptions.OperationalError: cannot VACUUM from within a transaction
2018-11-04 21:50:50 +01:00
Fabio Erculiani 2c1e3855b9 Tagging Entropy version 318 318 2018-11-03 20:18:26 +01:00
Fabio Erculiani c0b065fbff Release Entropy 318 2018-11-03 20:18:26 +01:00
Fabio Erculiani 5097f7d7a4 Rigo: fix LTS and non-LTS kernel menu.
Since Gentoo EAPI=7, old-style virtual packages have been removed.
We will use KernelSwitcher to get a list of kernel packages to show.
2018-11-03 20:15:44 +01:00
Fabio Erculiani abb7800e86 kswitch: allow to pass the preferred kernel virtual.
It's possible to choose between LTS and non-LTS kernels via list() now.
2018-11-03 20:14:34 +01:00
Sławomir Nizio f4332c76c8 [magneto] import entropy modules at upper level
Otherwise "entropy" module loading logic was delayed, excluding this
import (which was done early, before entropy_path_loader logic):

    from entropy.locks import SimpleFileLock

and it failed when system wide PYTHONPATH is dropped.

There was a comment not to do an early import due to --no-pid-handling.
The comment was added in:

    commit 59e5fd737e
    Date:   Tue Mar 1 13:13:18 2011 +0100

	[magneto] fix lock file handling

but then the logic was reworked in:

    commit 5d315c70bd
    Date:   Sun Feb 24 23:34:49 2013 +0100

	[entropy.const] drop /var/run/entropy/entropy.lock file and directory handling

and then passing --no-pid-handling (which was unused at this point) from
mangeto file was removed in:

    commit 83b8991c95
    Date:   Wed Feb 27 20:59:14 2013 +0000

	[magneto] rewrite systray icons management, improve KDE, GNOME and MATE integration
2018-11-03 19:13:19 +01:00
Sławomir Nizio 110b590fc5 [magneto] import also magneto (fix) 2018-11-03 17:48:38 +01:00
Sławomir Nizio 4297d17530 [misc, services] remove useless setting of PYTHONPATH 2018-10-28 21:56:41 +01:00
Sławomir Nizio 65b634adb2 [entropy.const] comment on the 'installdir' key 2018-10-28 21:54:28 +01:00
Sławomir Nizio 33966f4f31 [*] allow setting PYTHON_SITEDIR for make
This way a proper separation between Python installs can be achieved.

With no PYTHON_SITEDIR, installation paths are exactly the same as
before this change.

In practise, passing nonstandard path will break Entropy but so it is
also with the currently available LIBDIR. This is a concern of a future
improvement (at least the PYTHON_SITEDIR path, not necessarily LIBDIR as
PYTHON_SITEDIR *will* be different if it's installed in Python specific
directories).
2018-10-28 21:44:54 +01:00
Sławomir Nizio 0ccbc1f093 [Rigo] update ("reformat" only) translations
Due to a change of a .py file.
2018-10-28 19:53:53 +01:00
Sławomir Nizio 96909f6d29 [rigo/po] add RigoDaemon_app.py to POTFILES.in 2018-10-28 19:50:46 +01:00
Sławomir Nizio b44be655b2 [magneto] remove wrapper, install the main Python file to PATH directly
The wrapper was making it more difficult to use the correct system wide
Python implementation.
2018-10-28 19:28:21 +01:00
Sławomir Nizio 90ecb5b00d [RigoDaemon] make the application part be in /usr/libexec
This way there is no hardcoded /usr/lib/rigo, and the "executable" part
is in a well known location which can be replicated on system for
different Python implementations. (As in: it will be like /usr/bin/foo.py
which on Gentoo links to a system wrapper making it use configured
Python.)
2018-10-28 19:16:54 +01:00
Ettore Di Giacinto d44d473b19 Merge pull request #63 from Enlik/modules-reorg
[*] be strict about Python modules paths being loaded
2018-10-28 14:21:27 +01:00
Sławomir Nizio 41ba9b6d63 [*] be strict about Python modules paths being loaded
For convenience (seemingly, and it really is convenient) equo and other
tools can be run from the checkout, and Entropy modules are loaded from
the checkout. Now there is a strict separation when system paths and
when paths from the checkout are used.

It makes it a bit more robust, secure and preditable at the cost of
a little more complexity.

A pleasant side effect of this change is that it is not required to
change directory to the tool (to use non-system one), as paths in the
checkout are relative to scripts.

Imports in lib/tests were not adjusted.
2018-10-27 13:03:58 +02:00