csomh / source-git / rpm

Forked from source-git/rpm 4 years ago
Clone
2ff057
#! /bin/sh
2ff057
2ff057
# Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
2ff057
#  
2ff057
# This program is free software; you can redistribute it and/or modify
2ff057
# it under the terms of the GNU General Public License as published by
2ff057
# the Free Software Foundation; version 2 of the License.
2ff057
#  
2ff057
# This program is distributed in the hope that it will be useful,
2ff057
# but WITHOUT ANY WARRANTY; without even the implied warranty of
2ff057
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2ff057
# GNU General Public License for more details.
2ff057
#  
2ff057
# You should have received a copy of the GNU General Public License
2ff057
# along with this program; if not, write to the Free Software
2ff057
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
2ff057
2ff057
2ff057
test -z "$QA_SKIP_BUILD_ROOT" || exit 0
2ff057
2ff057
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
2ff057
        exit 0
2ff057
fi
2ff057
2ff057
tmp=$(mktemp ${TMPDIR:-/tmp}/cbr.XXXXXX)
2ff057
trap "rm -f $tmp" EXIT
Florian Festi 696e5e
NCPUS=${RPM_BUILD_NCPUS:-1}
2ff057
2ff057
find "$RPM_BUILD_ROOT" \! \( \
2ff057
    -name '*.pyo' -o -name '*.pyc' -o -name '*.elc' -o -name '.packlist' \
2ff057
    \) -type f -print0 | \
Florian Festi 696e5e
    LANG=C xargs -0r -P$NCPUS -n16 grep -F "$RPM_BUILD_ROOT" >>$tmp
2ff057
2ff057
test -s "$tmp" && {
2ff057
    cat "$tmp"
2ff057
    echo "Found '$RPM_BUILD_ROOT' in installed files; aborting"
2ff057
    exit 1
2ff057
} || :