AOSC-Archive / autobuild3

AOSC OS package maintenance toolkit (version 3)
https://aosc.io
GNU General Public License v2.0
24 stars 17 forks source link

qa/post/permission.sh: add file type check for *.so.* #131

Closed CamberLoid closed 2 years ago

CamberLoid commented 2 years ago

The PR will fix a problem that when running qa/post/permission.sh. An example is that in the post-build QA phase of building ocaml-ctypes 0.16.0, autobuild3 will mistakenly treat some *.so.owner ASCII text file as shared object and fail the test.

Commit 93f7388a will add a check command to determine whether the file is an ELF shared object or something else.

Tests

The commit is tested via a dummy test package.

spec

VER=1
DUMMYSRC=1

defines

PKGNAME=testpkg
PKGDESC="Test package"
PKGSEC=admin

prepare

mkdir -vp $PKGDIR/usr/lib

cp -v /usr/lib/libffi.so $PKGDIR/usr/lib/THIS_SHOULD_FAIL.so.1
cp -v /usr/lib/libffi.so $PKGDIR/usr/lib/THIS_SHOULD_FAIL_TOO.so.2
echo "Never gonna give you up~" > $PKGDIR/usr/lib/BUT_THIS_SHOULD_NOT_FAIL.so.owner

chmod -x $PKGDIR/usr/lib/THIS_SHOULD_FAIL*

Image prove

image

Signed-off-by: Camber Huang camber@aosc.io