Project

General

Profile

Packaging Request #2036

[Feature] Find a way to run generic tests in PKGBUILDS

GNUtoo - over 5 years ago - . Updated over 5 years ago.

Status:
open
Priority:
bug
Assignee:
-
% Done:

0%


Description

Many packages are broken on i686, and require recompilation.

The last one I found is evolution. This can easily be detected by something like that:

$ ldd /usr/bin/evolution  | grep -i " => not found$" 
    libprotobuf.so.16 => not found

Some distributions and/or build systems have tools to scan binaries in order to rebuild them when something broke. For instance Gentoo has the 'revdep-rebuild' tool to do that.

You could also test that in some simple way with shell scripts:

# Copyright (C) 2018  Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
#
# 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 program 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/>.
set -e
usage()
{
    echo "$0 <path/to/binary>" 
    exit 1
}

if [ $# -ne 1 ] ; then
    usage
fi

file="$1" 
file "${file}" | grep ": ELF " 
ldd "${file}" | grep -i " => not found$" 
output=$(pacman -Q -o ${file})
echo "${output}" | grep " is owned by " 
package="$(echo ${output} | awk '{print $5}')" 
pacman -sS "^${package}\$" | head -n1 | awk '{print $1}'

If you want to reuse the code above to integrate it in a project that has a different license, just ask and I'll relicense it under the free software license of your choice.

Denis.

History

#1

Updated by GNUtoo over 5 years ago

Sorry the title of the bug is missleading as it might not make sense to run the tests inside the PKGBUILDS (as some packages are imported as-is from other distributions). Could someone change it (I can't).

The idea here would be to run the test after rebuilding or importing packages to ensure that everything works correctly.

Denis.

Also available in: Atom PDF