various improvements

This commit is contained in:
ge
2023-11-23 02:34:02 +03:00
parent b9d089dd78
commit 05f90b14f2
200 changed files with 15968 additions and 84 deletions

View File

@ -0,0 +1,93 @@
# compute bash completion script
_compute_root_cmd="
--version
--verbose
--connect
--log-level
init
exec
ls
start
shutdown
reboot
reset
powrst
pause
resume
status
setvcpus
setmem
setpasswd"
_compute_init_opts=""
_compute_exec_opts="
--timeout
--executable
--env
--no-join-args"
_compute_ls_opts=""
_compute_start_opts=""
_compute_shutdown_opts="--method"
_compute_reboot_opts=""
_compute_reset_opts=""
_compute_powrst_opts=""
_compute_pause_opts=""
_compute_resume_opts=""
_compute_status_opts=""
_compute_setvcpus_opts=""
_compute_setmem_opts=""
_compute_setpasswd_opts="--encrypted"
_compute_complete_instances()
{
for file in /etc/libvirt/qemu/*.xml; do
nodir="${file##*/}"
printf '%s ' "${nodir//\.xml}"
done
}
_compute_compreply()
{
if [[ "$current" = [a-z]* ]]; then
_compute_compwords="$(_compute_complete_instances)"
else
_compute_compwords="$*"
fi
COMPREPLY=($(compgen -W "$_compute_compwords" -- "$current"))
}
_compute_complete()
{
local current previous nshift
current="${COMP_WORDS[COMP_CWORD]}"
case "$COMP_CWORD" in
1) COMPREPLY=($(compgen -W "$_compute_root_cmd" -- "$current"))
;;
2|3|4|5)
nshift=$((COMP_CWORD-1))
previous="${COMP_WORDS[COMP_CWORD-nshift]}"
case "$previous" in
init) COMPREPLY=($(compgen -f -- "$current"));;
exec) _compute_compreply "$_compute_exec_opts";;
ls) COMPREPLY=($(compgen -W "$_compute_ls_opts" -- "$current"));;
start) _compute_compreply "$_compute_start_opts";;
shutdown) _compute_compreply "$_compute_shutdown_opts";;
reboot) _compute_compreply "$_compute_reboot_opts";;
reset) _compute_compreply "$_compute_reset_opts";;
powrst) _compute_compreply "$_compute_powrst_opts";;
pause) _compute_compreply "$_compute_pause_opts";;
resume) _compute_compreply "$_compute_resume_opts";;
status) _compute_compreply "$_compute_status_opts";;
setvcpus) _compute_compreply "$_compute_setvcpus_opts";;
setmem) _compute_compreply "$_compute_setmem_opts";;
setpasswd) _compute_compreply "$_compute_setpasswd_opts";;
*) COMPREPLY=()
esac
;;
*) COMPREPLY=($(compgen -W "$_compute_compwords" -- "$current"))
esac
}
complete -F _compute_complete compute
# vim: ft=bash

48
packaging/files/control Normal file
View File

@ -0,0 +1,48 @@
Source: compute
Section: admin
Priority: optional
Maintainer: ge <ge@nixhacks.net>
Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 13),
dh-sequence-python3,
bash-completion,
pybuild-plugin-pyproject,
python3-poetry-core,
python3-setuptools,
python3-all,
python3-sphinx,
python3-sphinx-multiversion,
python3-libvirt,
python3-lxml,
python3-yaml,
python3-pydantic
Standards-Version: 4.6.2
Homepage: https://git.lulzette.ru/hstack/compute
Package: compute
Architecture: all
Depends:
${python3:Depends},
${misc:Depends},
qemu-system,
qemu-utils,
libvirt-daemon-system,
libvirt-clients,
python3-libvirt,
python3-lxml,
python3-yaml,
python3-pydantic
Recommends:
dnsmasq
Suggests:
compute-doc
Description: Compute instances management library and tools (Python 3)
Package: compute-doc
Section: doc
Architecture: all
Depends:
${sphinxdoc:Depends},
${misc:Depends},
Description: Compute instances management library and tools (documentation)

32
packaging/files/copyright Normal file
View File

@ -0,0 +1,32 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://git.lulzette.ru/hstack/compute
Upstream-Name: compute
Files:
*
Copyright:
2023 ge <ge@nixhacks.net>
License: GPL-3.0+
Files:
debian/*
Copyright:
2023 ge <ge@nixhacks.net>
License: GPL-3.0+
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Comment:
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

1
packaging/files/docs Normal file
View File

@ -0,0 +1 @@
README.md

20
packaging/files/rules Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1
export PYBUILD_DESTDIR_python3=debian/compute
%:
dh $@ --with python3,sphinxdoc,bash-completion --buildsystem=pybuild
override_dh_auto_test:
@echo No tests there
override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
http_proxy=127.0.0.1:9 https_proxy=127.0.0.1:9 \
HTTP_PROXY=127.0.0.1:9 HTTPS_PROXY=127.0.0.1:9 \
PYTHONPATH=. PYTHON=python3 python3 -m sphinx $(SPHINXOPTS) -b html \
../docs/source \
$(CURDIR)/debian/compute-doc/usr/share/doc/compute-doc/html
dh_sphinxdoc
endif