From df12c9ec4ed88ca74a525389e347fef4e78d5c6a Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 2 Sep 2021 10:32:29 +0200 Subject: [PATCH] add proxmox-backup-debug debian package Signed-off-by: Wolfgang Bumiller --- Makefile | 14 +++++---- debian/control | 7 +++++ debian/proxmox-backup-debug.bash-completion | 1 + debian/proxmox-backup-debug.bc | 8 +++++ debian/proxmox-backup-debug.install | 3 ++ debian/rules | 1 + docs/Makefile | 10 ++++++- docs/proxmox-backup-debug/description.rst | 3 ++ docs/proxmox-backup-debug/man1.rst | 33 +++++++++++++++++++++ zsh-completions/_proxmox-backup-debug | 13 ++++++++ 10 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 debian/proxmox-backup-debug.bash-completion create mode 100644 debian/proxmox-backup-debug.bc create mode 100644 debian/proxmox-backup-debug.install create mode 100644 docs/proxmox-backup-debug/description.rst create mode 100644 docs/proxmox-backup-debug/man1.rst create mode 100644 zsh-completions/_proxmox-backup-debug diff --git a/Makefile b/Makefile index 23f2d057..40a80493 100644 --- a/Makefile +++ b/Makefile @@ -70,10 +70,12 @@ CLIENT_DEB=${PACKAGE}-client_${DEB_VERSION}_${ARCH}.deb CLIENT_DBG_DEB=${PACKAGE}-client-dbgsym_${DEB_VERSION}_${ARCH}.deb RESTORE_DEB=proxmox-backup-file-restore_${DEB_VERSION}_${ARCH}.deb RESTORE_DBG_DEB=proxmox-backup-file-restore-dbgsym_${DEB_VERSION}_${ARCH}.deb +DEBUG_DEB=${PACKAGE}-debug_${DEB_VERSION}_${ARCH}.deb +DEBUG_DBG_DEB=${PACKAGE}-debug-dbgsym_${DEB_VERSION}_${ARCH}.deb DOC_DEB=${PACKAGE}-docs_${DEB_VERSION}_all.deb DEBS=${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \ - ${RESTORE_DEB} ${RESTORE_DBG_DEB} + ${RESTORE_DEB} ${RESTORE_DBG_DEB} ${DEBUG_DEB} ${DEBUG_DBG_DEB} DSC = rust-${PACKAGE}_${DEB_VERSION}.dsc @@ -150,7 +152,8 @@ clean-deb: rm -rf *.deb *.dsc *.tar.gz *.buildinfo *.changes build/ .PHONY: dinstall -dinstall: ${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} +dinstall: ${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \ + ${DEBUG_DEB} ${DEBUG_DBG_DEB} dpkg -i $^ # make sure we build binaries before docs @@ -220,10 +223,11 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) endif .PHONY: upload -upload: ${SERVER_DEB} ${CLIENT_DEB} ${RESTORE_DEB} ${DOC_DEB} +upload: ${SERVER_DEB} ${CLIENT_DEB} ${RESTORE_DEB} ${DOC_DEB} ${DEBUG_DEB} # check if working directory is clean git diff --exit-code --stat && git diff --exit-code --stat --staged - tar cf - ${SERVER_DEB} ${SERVER_DBG_DEB} ${DOC_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} | \ - ssh -X repoman@repo.proxmox.com upload --product pbs --dist bullseye + tar cf - ${SERVER_DEB} ${SERVER_DBG_DEB} ${DOC_DEB} ${CLIENT_DEB} \ + ${CLIENT_DBG_DEB} ${DEBUG_DEB} ${DEBUG_DBG_DEB} \ + | ssh -X repoman@repo.proxmox.com upload --product pbs --dist bullseye tar cf - ${CLIENT_DEB} ${CLIENT_DBG_DEB} | ssh -X repoman@repo.proxmox.com upload --product "pve,pmg,pbs-client" --dist bullseye tar cf - ${RESTORE_DEB} ${RESTORE_DBG_DEB} | ssh -X repoman@repo.proxmox.com upload --product "pve" --dist bullseye diff --git a/debian/control b/debian/control index 73442a6d..e49e9499 100644 --- a/debian/control +++ b/debian/control @@ -175,3 +175,10 @@ Description: Proxmox Backup single file restore tools for pxar and block device This package contains the Proxmox Backup single file restore client for restoring individual files and folders from both host/container and VM/block device backups. It includes a block device restore driver using QEMU. + +Package: proxmox-backup-debug +Architecture: any +Depends: ${misc:Depends}, + ${shlibs:Depends}, +Description: Proxmox Backup debug tool + Provides a tool to inspect the files of a Proxmox Backup datastore. diff --git a/debian/proxmox-backup-debug.bash-completion b/debian/proxmox-backup-debug.bash-completion new file mode 100644 index 00000000..b977f953 --- /dev/null +++ b/debian/proxmox-backup-debug.bash-completion @@ -0,0 +1 @@ +debian/proxmox-backup-debug.bc proxmox-backup-debug diff --git a/debian/proxmox-backup-debug.bc b/debian/proxmox-backup-debug.bc new file mode 100644 index 00000000..51c992fb --- /dev/null +++ b/debian/proxmox-backup-debug.bc @@ -0,0 +1,8 @@ +# proxmox-backup-debug bash completion + +# see http://tiswww.case.edu/php/chet/bash/FAQ +# and __ltrim_colon_completions() in /usr/share/bash-completion/bash_completion +# this modifies global var, but I found no better way +COMP_WORDBREAKS=${COMP_WORDBREAKS//:} + +complete -C 'proxmox-backup-debug bashcomplete' proxmox-backup-debug diff --git a/debian/proxmox-backup-debug.install b/debian/proxmox-backup-debug.install new file mode 100644 index 00000000..0e788b9a --- /dev/null +++ b/debian/proxmox-backup-debug.install @@ -0,0 +1,3 @@ +usr/sbin/proxmox-backup-debug +usr/share/man/man1/proxmox-backup-debug.1 +usr/share/zsh/vendor-completions/_proxmox-backup-debug diff --git a/debian/rules b/debian/rules index 1a00a100..9ce8a2b7 100755 --- a/debian/rules +++ b/debian/rules @@ -54,6 +54,7 @@ override_dh_strip: debian/proxmox-backup-client/usr \ debian/proxmox-backup-server/usr \ debian/proxmox-backup-file-restore \ + debian/proxmox-backup-debug/usr \ -executable -type f); do \ debian/scripts/elf-strip-unused-dependencies.sh "$$exe" || true; \ done diff --git a/docs/Makefile b/docs/Makefile index 233421fd..5e37f7d1 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,6 +5,7 @@ GENERATED_SYNOPSIS := \ proxmox-backup-client/synopsis.rst \ proxmox-backup-client/catalog-shell-synopsis.rst \ proxmox-backup-manager/synopsis.rst \ + proxmox-backup-debug/synopsis.rst \ proxmox-file-restore/synopsis.rst \ pxar/synopsis.rst \ pmtx/synopsis.rst \ @@ -27,7 +28,8 @@ MAN1_PAGES := \ proxmox-backup-proxy.1 \ proxmox-backup-client.1 \ proxmox-backup-manager.1 \ - proxmox-file-restore.1 + proxmox-file-restore.1 \ + proxmox-backup-debug.1 MAN5_PAGES := \ media-pool.cfg.5 \ @@ -199,6 +201,12 @@ proxmox-file-restore/synopsis.rst: ${COMPILEDIR}/proxmox-file-restore proxmox-file-restore.1: proxmox-file-restore/man1.rst proxmox-file-restore/description.rst proxmox-file-restore/synopsis.rst rst2man $< >$@ +proxmox-backup-debug/synopsis.rst: ${COMPILEDIR}/proxmox-backup-debug + ${COMPILEDIR}/proxmox-backup-debug printdoc > proxmox-backup-debug/synopsis.rst + +proxmox-backup-debug.1: proxmox-backup-debug/man1.rst proxmox-backup-debug/description.rst proxmox-backup-debug/synopsis.rst + rst2man $< >$@ + .PHONY: onlinehelpinfo onlinehelpinfo: @echo "Generating OnlineHelpInfo.js..." diff --git a/docs/proxmox-backup-debug/description.rst b/docs/proxmox-backup-debug/description.rst new file mode 100644 index 00000000..0b263e8c --- /dev/null +++ b/docs/proxmox-backup-debug/description.rst @@ -0,0 +1,3 @@ +Implements debugging functionality to inspect Proxmox Backup datastore +files, verify the integrity of chunks. + diff --git a/docs/proxmox-backup-debug/man1.rst b/docs/proxmox-backup-debug/man1.rst new file mode 100644 index 00000000..89e666df --- /dev/null +++ b/docs/proxmox-backup-debug/man1.rst @@ -0,0 +1,33 @@ +========================== +proxmox-backup-debug +========================== + +.. include:: ../epilog.rst + +------------------------------------------------------------- +Debugging command line tool for Backup and Restore +------------------------------------------------------------- + +:Author: |AUTHOR| +:Version: Version |VERSION| +:Manual section: 1 + + +Synopsis +========== + +.. include:: synopsis.rst + +Common Options +============== + +.. include:: ../output-format.rst + + +Description +============ + +.. include:: description.rst + + +.. include:: ../pbs-copyright.rst diff --git a/zsh-completions/_proxmox-backup-debug b/zsh-completions/_proxmox-backup-debug new file mode 100644 index 00000000..d73c023f --- /dev/null +++ b/zsh-completions/_proxmox-backup-debug @@ -0,0 +1,13 @@ +#compdef _proxmox-backup-debug() proxmox-backup-debug + +function _proxmox-backup-debug() { + local cwords line point cmd curr prev + cworkds=${#words[@]} + line=$words + point=${#line} + cmd=${words[1]} + curr=${words[cwords]} + prev=${words[cwords-1]} + compadd -- $(COMP_CWORD="$cwords" COMP_LINE="$line" COMP_POINT="$point" \ + proxmox-backup-debug bashcomplete "$cmd" "$curr" "$prev") +}