4ec9a8183d
taking over slighlty generified helpers and types: - subscription info and status - checking subscription status with shop - reading/writing local subscription-related files the perl-based code uses base64 with newlines for the data, and base64 without padding for the checksum. accordingly, calculate the checksum with and without newlines, and compare the decoded checksum instead of the encoded one. furthermore, the perl-based code encodes the subscription status using Capitalized values instead of lowercase, so alias those for the time being. PVE also stores the serverid as 'validdirectory', so add that as alias as well. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
84 lines
1.5 KiB
Makefile
84 lines
1.5 KiB
Makefile
# Shortcut for common operations:
|
|
|
|
CRATES = \
|
|
proxmox-api-macro \
|
|
proxmox-async \
|
|
proxmox-borrow \
|
|
proxmox-compression \
|
|
proxmox-http \
|
|
proxmox-io \
|
|
proxmox-lang \
|
|
proxmox-router \
|
|
proxmox-schema \
|
|
proxmox-serde \
|
|
proxmox-shared-memory \
|
|
proxmox-section-config \
|
|
proxmox-sortable-macro \
|
|
proxmox-subscription \
|
|
proxmox-sys \
|
|
proxmox-tfa \
|
|
proxmox-time \
|
|
proxmox-uuid
|
|
|
|
# By default we just run checks:
|
|
.PHONY: all
|
|
all: check
|
|
|
|
.PHONY: deb
|
|
deb: $(foreach c,$(CRATES), $c-deb)
|
|
echo $(foreach c,$(CRATES), $c-deb)
|
|
lintian build/*.deb
|
|
|
|
.PHONY: autopkgtest
|
|
autopkgtest: $(foreach c,$(CRATES), $c-autopkgtest)
|
|
|
|
.PHONY: dinstall
|
|
dinstall:
|
|
$(MAKE) clean
|
|
$(MAKE) deb
|
|
sudo -k dpkg -i build/librust-*.deb
|
|
|
|
%-deb:
|
|
./build.sh $*
|
|
touch $@
|
|
|
|
%-autopkgtest:
|
|
autopkgtest build/$* build/*.deb -- null
|
|
touch $@
|
|
|
|
.PHONY: check
|
|
check:
|
|
cargo test
|
|
|
|
# Run the api-test server, serving the api-test/www/ subdir as 'www' dir over
|
|
# http:
|
|
.PHONY: apitest
|
|
apitest:
|
|
cargo run -p api-test -- api-test/www/
|
|
|
|
# Prints a diff between the current code and the one rustfmt would produce
|
|
.PHONY: fmt
|
|
fmt:
|
|
cargo +nightly fmt -- --check
|
|
|
|
# Doc without dependencies
|
|
.PHONY: doc
|
|
doc:
|
|
cargo doc --no-deps
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
cargo clean
|
|
rm -rf build *-deb *-autopkgtest
|
|
|
|
.PHONY: update
|
|
update:
|
|
cargo update
|
|
|
|
%-upload: %-deb
|
|
cd build; \
|
|
dcmd --deb rust-$*_*.changes \
|
|
| grep -v '.changes$$' \
|
|
| tar -cf "$@.tar" -T-; \
|
|
cat "$@.tar" | ssh -X repoman@repo.proxmox.com upload --product devel --dist bullseye
|