1
0
mirror of https://git.dpkg.org/git/dpkg/dpkg-repack.git synced 2025-08-22 15:02:31 +00:00
Files
dpkg-repack/debian/tests/repack
Guillem Jover 3f7037173b debian: Fix and call cmp_listfile in autopkgtest
Remove unused variable, massage files list contents, and call the check
function so that we can test the file list contents.
2021-10-19 03:18:21 +02:00

47 lines
923 B
Bash

#!/bin/sh
set -e
set -u
cmp_ctrlfile()
{
local pkg=$1
local ctrl=$2
dpkg-query --control-show $pkg $ctrl >$pkg-inst.$ctrl
dpkg-deb --info ${pkg}_*.deb $ctrl >$pkg-pack.$ctrl
diff -u $pkg-inst.$ctrl $pkg-pack.$ctrl
}
cmp_listfile()
{
local pkg=$1
dpkg-query --listfiles $pkg | sort >$pkg-inst.list
dpkg-deb --fsys-tarfile ${pkg}_*.deb | tar -tf - | cut -c2- \
| sed -e 's,^/$,/.,;s,/$,,g' | sort >$pkg-pack.list
diff -u $pkg-inst.list $pkg-pack.list
}
test_pkgs="dpkg dpkg-repack"
cd $AUTOPKGTEST_TMP
fakeroot -u dpkg-repack $test_pkgs
for pkg in $test_pkgs; do
for ctrl in $(dpkg-query --control-list $pkg); do
cmp_ctrlfile $pkg $ctrl
done
cmp_listfile $pkg
done
cmp_ctrlfile dpkg conffiles
# FIXME: check control file
# FIXME: check diverted files
# FIXME: check obsolete conffiles
# FIXME: check --generate
# FIXME: check --arch
# FIXME: check --deb-option
# FIXME: check --root