Stéphane Graber
4eff7bcdeb
Merge pull request #3974 from brauner/2021-09-15.fixes.2
...
tools: use correct include for Android
2021-09-15 15:15:41 -04:00
Christian Brauner
402f6adb5c
tools: use correct include for Android
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 20:26:11 +02:00
Stéphane Graber
cf5599324d
Merge pull request #3972 from brauner/2021-09-15.fixes
...
build: ensure all relevant calls are checked for availability at buil…
2021-09-15 10:15:53 -04:00
Christian Brauner
25dff4d158
build: support lto
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 10:42:04 +02:00
Christian Brauner
a9502f5dc9
cgroups: fix declarations and headers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 10:28:50 +02:00
Christian Brauner
df0834edba
network: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 10:12:41 +02:00
Christian Brauner
7a7f9a1453
build: ensure all relevant calls are checked for availability at build time
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 09:08:15 +02:00
Stéphane Graber
e758399067
Merge pull request #3966 from denisfa/improve-bash-completion-ext
...
Improve bash completion - part 2.
2021-09-14 23:33:57 -04:00
Stéphane Graber
9985804066
Merge pull request #3963 from brauner/2021-09-03.build
...
build: add basic meson support
2021-09-14 22:41:55 -04:00
Christian Brauner
ea6da2577b
build: show more detailed information
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-14 11:01:59 +02:00
Christian Brauner
e282c460af
build: record meson version
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-14 10:34:05 +02:00
Christian Brauner
589e116754
build: use correct minimal meson version requirement
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-14 10:23:37 +02:00
Christian Brauner
ec5d2163f3
build: remove pointless prefixdir validation
...
Meson will handle this internall and treat a non-absolute path as an
error.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-14 10:03:12 +02:00
Stéphane Graber
efbe49c674
Merge pull request #3968 from brauner/2021-09-03.fixes.2
...
tests: fix config file tests
2021-09-13 08:41:41 -04:00
Stéphane Graber
332a0a8f47
Merge pull request #3967 from brauner/2021-09-03.fixes
...
log: fix cross-compilation with %m modifier
2021-09-13 08:37:25 -04:00
Christian Brauner
b967f9e8d5
tests: fix config file tests
...
Link: https://bugs.launchpad.net/bugs/1943441
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 13:59:42 +02:00
Christian Brauner
8a046c4c56
log: fix cross-compilation with %m modifier
...
Fixes : #3961
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 12:30:52 +02:00
Christian Brauner
bf1f3470fd
build: set more variables and print summary
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 11:21:23 +02:00
Christian Brauner
dcfe4e135d
build: add more global config variables
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 11:03:34 +02:00
Christian Brauner
455dae78dc
build: set diagnostic colours directly in default_options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:15:01 +02:00
Christian Brauner
1531f8d53d
build: add single option directly to static library
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:14:45 +02:00
Christian Brauner
4ad3a929d9
build: remove unneeded variables
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:09:45 +02:00
Christian Brauner
c6ea1dec85
build: use common dependencies variable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:05:48 +02:00
Christian Brauner
e8ef4deae0
build: libdir and bindir are the default for shared libraries and executables
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:01:46 +02:00
Christian Brauner
4ce4aac494
build: set find_library('libcap', require : false)
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:58:44 +02:00
Christian Brauner
305490ba8e
build: -fPIC and -shared are handled automatically
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:57:53 +02:00
Christian Brauner
e4384f1cbb
build: use dependency() where possible
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:54:17 +02:00
Christian Brauner
5e0a302b1e
build: set as-needed in default_options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:44:32 +02:00
Christian Brauner
98f3b52712
build: set pie in default_options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:43:29 +02:00
Edênis Freindorfer Azevedo
d9be2feb09
Fix lxc-cgroup
smart completion.
...
Also make bash function more readable for itself.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-08 10:40:49 -03:00
Edênis Freindorfer Azevedo
b3dcb19407
Refactor __lxc_check_name_present()
.
...
Print name of container found, if any.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
c227466673
Check completion for prefixes names.
...
If a name is a prefix of another word available for completion, adjust
to show all words with given prefix.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
83ca245532
Add __lxc_cgroup_state_object()
.
...
Support cgroup state-object completion values for `lxc-cgroup`.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
d36b3a3a9a
Update _lxc_usernsexec
.
...
Not really much can be done for this function, as `-m` requires an ID
mapping that has to be manually input, since it will use
`/etc/sub{g,u}id` if not specified.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
2b86aa4c23
Add completion for lxc-copy
param --fssize
.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
a33d86d20b
Add __lxc_get_selinux_contexts()
.
...
List SElinux contexts available. Not clear if this could be only for
root or if normal user with `sudo` is also supported.
Using `Fedora34` for basic testing.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
4cd0915e76
Refactor __lxc_groups()
to __lxc_get_groups()
.
...
Make code logic be more clear to what it is being done.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
f73bcca529
Another round of more bash-like syntax.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
b73b4ec7fb
Fix lxc-create
completion.
...
Do not append a name of an existing container.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
d72a39a528
Add support for comma as a completion word.
...
For `lxc-ls --groups` and `lxc-autostart --groups`.
Support leading comma, trailing comma, embedded double comma.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
66e8c08985
Refactor __lxc_piped_args
.
...
Use bash functions for common array operations. Keep code logic somewhat
easy to read for bug hunting.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
53431db944
Fix lxc-snapshot
completion.
...
For options `-r,--restore` and `-d,--destroy`, we need the container
name to create the list of completion values.
Therefore, it is needed to scan the current command line to check if
there is a container name available.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
8617586740
Use more bash-like syntax.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:46 -03:00
Edênis Freindorfer Azevedo
6139460643
Add support for container composed names.
...
When a container name has whitespace in it
(e.g. created by `lxc-create -t download -n "arch linux"` ),
the completion for other commands should be able to work by adding a
backslash to escape it.
Although it may be interesting to support names between quotes, this
would probably means to have to add quotes to all names. Might not be
interesting just due to an edge case.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
8e4c68e67a
Add completion output for lxc-ls --fancy-format
.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
8aa4490505
Improve name completion handling.
...
Use regex to handle short option `-n`, since short options can be
combined (e.g. `-nd`) as long as at max one requires an argument.
Also consider the case when the arg for the long option is not given
together with `--name=`.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
db8b9df555
Add compopt
call to __lxc_piped_args
.
...
On pair with how other functions do it. Also, be smarter about adding
whitespace when there are no more completions available for the
parameter.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
2173e808ca
Use --running
instead of --active
.
...
Commands block if container is frozen.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
4246469f8b
Fill missing commands on name completion.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Christian Brauner
297e5f9693
build: add tools to meson
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 19:06:09 +02:00