Michal Marek 3efbe7
#!/bin/bash
Michal Marek 3efbe7
Michal Marek 3efbe7
#############################################################################
Michal Marek 3efbe7
# Copyright (c) 2003-2009 Novell, Inc.
Michal Marek 3efbe7
# All Rights Reserved.
Michal Marek 3efbe7
#
Michal Marek 3efbe7
# This program is free software; you can redistribute it and/or
Michal Marek 3efbe7
# modify it under the terms of version 2 of the GNU General Public License as
Michal Marek 3efbe7
# published by the Free Software Foundation.
Michal Marek 3efbe7
#
Michal Marek 3efbe7
# This program is distributed in the hope that it will be useful,
Michal Marek 3efbe7
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Michal Marek 3efbe7
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   See the
Michal Marek 3efbe7
# GNU General Public License for more details.
Michal Marek 3efbe7
#
Michal Marek 3efbe7
# You should have received a copy of the GNU General Public License
Michal Marek 3efbe7
# along with this program; if not, contact Novell, Inc.
Michal Marek 3efbe7
#
Michal Marek 3efbe7
# To contact Novell about this file by physical or electronic mail,
Michal Marek 3efbe7
# you may find current contact information at www.novell.com
Michal Marek 3efbe7
#############################################################################
Michal Marek 3efbe7
Michal Marek 3efbe7
# generate a kernel-source rpm package
Michal Marek 3efbe7
Michal Marek 3efbe7
# if this is SLE11_BRANCH and earlier, hand over to scripts/tar-up-old.sh
Michal Marek 3efbe7
if test ! -x rpm/mkspec; then
Michal Marek 3efbe7
    exec ${0%.sh}-old.sh "$@"
Michal Marek 3efbe7
fi
Michal Marek 3efbe7
Michal Marek 3efbe7
. ${0%/*}/wd-functions.sh
Michal Marek 3efbe7
Michal Marek 26b24c
sort()
Michal Marek 26b24c
{
Michal Marek 26b24c
	LC_ALL=C command sort "$@"
Michal Marek 26b24c
}
Michal Marek 3efbe7
Michal Marek 3efbe7
tolerate_unknown_new_config_options=
Michal Marek 3efbe7
ignore_kabi=
Michal Marek 3efbe7
mkspec_args=()
Egbert Eich 8e5a8e
arch=
Egbert Eich 8e5a8e
flavor=
Michal Marek fc1894
source rpm/config.sh
Michal Marek 3efbe7
until [ "$#" = "0" ] ; do
Michal Marek 3efbe7
  case "$1" in
Michal Marek 3efbe7
    --dir=*)
Michal Marek 3efbe7
      build_dir=${1#*=}
Michal Marek 3efbe7
      shift
Michal Marek 3efbe7
      ;;
Michal Marek 3efbe7
    -d|--dir)
Michal Marek 3efbe7
      build_dir=$2
Michal Marek 3efbe7
      shift 2
Michal Marek 3efbe7
      ;;
Michal Marek 3efbe7
    --embargo)
Michal Marek 3efbe7
      # obsolete
Michal Marek 3efbe7
      shift
Michal Marek 3efbe7
      ;;
Michal Marek 3efbe7
    -nf|--tolerate-unknown-new-config-options)
Michal Marek 3efbe7
      tolerate_unknown_new_config_options=1
Michal Marek 3efbe7
      shift
Michal Marek 3efbe7
      ;;
Michal Marek 3efbe7
    -i|--ignore-kabi)
Michal Marek 3efbe7
      ignore_kabi=1
Michal Marek 3efbe7
      shift
Michal Marek 3efbe7
      ;;
Michal Marek 3efbe7
    -iu|--ignore-unsupported-deps)
Michal Marek 3efbe7
      # ignored, set %supported_modules_check in the spec instead
Michal Marek 3efbe7
      shift
Michal Marek 3efbe7
      ;;
Michal Marek 3efbe7
    -rs|--release-string)
Michal Marek 3efbe7
      case "$2" in
Michal Marek 3efbe7
      *' '*)
Michal Marek 3efbe7
        echo "$1 option argument must not contain spaces" >&2
Michal Marek 3efbe7
        exit 1
Michal Marek 3efbe7
      esac
Michal Marek 3efbe7
      mkspec_args=("${mkspec_args[@]}" --release "$2")
Michal Marek 3efbe7
      shift 2
Michal Marek 3efbe7
      ;;
Egbert Eich 8e5a8e
    -a|--arch)
Egbert Eich 8e5a8e
      arch=$2; shift 2 ;;
Egbert Eich 8e5a8e
    -f|--flavor|--flavour)
Egbert Eich 8e5a8e
      flavor=$2; shift 2 ;;
Egbert Eich 8e5a8e
    --vanilla) flavor="vanilla"; shift ;;
Michal Marek 3efbe7
    -h|--help|-v|--version)
Michal Marek 3efbe7
	cat <
Michal Marek 3efbe7
Michal Marek 3efbe7
${0##*/} perpares a 'kernel-source' package for submission into autobuild
Michal Marek 3efbe7
Michal Marek 3efbe7
these options are recognized:
Michal Marek 3efbe7
    -nf                to proceed if a new unknown .config option is found during make oldconfig
Michal Marek 3efbe7
    -i                 ignore kabi failures
Michal Marek fc1894
    -d, --dir=DIR      create package in DIR instead of default kernel-source$VARIANT
Egbert Eich 8e5a8e
    -a, --arch=ARCH    create package for architecture ARCH only
Egbert Eich 8e5a8e
    -f, --flavor=FLAVOR create package for FLAVOR only
Egbert Eich 8e5a8e
    --vanilla	       like --flavor=vanilla
Michal Marek 3efbe7
Michal Marek 3efbe7
EOF
Michal Marek 3efbe7
	exit 1
Michal Marek 3efbe7
	;;
Michal Marek 3efbe7
    *)
Michal Marek 3efbe7
      echo "unknown option '$1'" >&2
Michal Marek 3efbe7
      exit 1
Michal Marek 3efbe7
      ;;
Michal Marek 3efbe7
  esac
Michal Marek 3efbe7
done
Michal Marek 3efbe7
export LANG=POSIX
Michal Marek 3efbe7
Michal Marek 8f65b2
case "$build_dir" in
Michal Marek 8f65b2
"")
Michal Marek 8f65b2
	build_dir=kernel-source$VARIANT
Michal Marek 8f65b2
	;;
Michal Marek 8f65b2
/* | ./*) ;;
Michal Marek 8f65b2
*)
Michal Marek 8f65b2
	build_dir=./$build_dir
Michal Marek 8f65b2
esac
Michal Marek 3efbe7
Michal Marek 3efbe7
check_for_merge_conflicts() {
Michal Marek 3efbe7
    set -- $(grep -lP '^<{7}(?!<)|^>{7}(?!>)' "$@" 2> /dev/null)
Michal Marek 3efbe7
    if [ $# -gt 0 ]; then
Michal Marek 3efbe7
	printf "Merge conflicts in %s\n" "$@" >&2
Michal Marek 3efbe7
	return 1
Michal Marek 3efbe7
    fi
Michal Marek 3efbe7
}
Michal Marek 3efbe7
Michal Marek ecce67
suffix=$(sed -rn 's/^Source0:.*\.(tar\.[a-z0-9]*)$/\1/p' rpm/kernel-source.spec.in)
Michal Marek e6728e
# Dot files are skipped by intention, in order not to break osc working
Michal Marek 19bc12
# copies. The linux tarball is not deleted if it is already there.
Michal Marek e6728e
for f in "$build_dir"/*; do
Michal Marek 4de9d6
	case "${f##*/}" in
Michal Marek 19bc12
	"linux-$SRCVERSION.$suffix")
Michal Marek e6728e
		continue
Michal Marek e56f67
		;;
Michal Suchanek cb2465
	"linux-$SRCVERSION.tar.sign")
Michal Suchanek cb2465
		continue
Michal Suchanek cb2465
		;;
Michal Marek 4de9d6
	patches.*)
Michal Marek e56f67
		rm -rf "$f"
Michal Marek e6728e
	esac
Michal Marek e6728e
	rm -f "$f"
Michal Marek e6728e
done
Michal Marek e6728e
mkdir -p "$build_dir"
Michal Marek 73a373
echo "linux-$SRCVERSION.$suffix"
67bee1
get_tarball "$SRCVERSION" "$suffix" "$build_dir" "$URL"
Michal Marek 3efbe7
Michal Marek 3efbe7
# list of patches to include.
Michal Marek 3efbe7
install -m 644 series.conf $build_dir/
Michal Marek 3efbe7
Michal Marek 3efbe7
# All config files and patches used
Michal Marek 3efbe7
referenced_files="$( {
Michal Marek 3efbe7
	$(dirname $0)/guards --list < $build_dir/series.conf
Michal Marek 3efbe7
	$(dirname $0)/guards --prefix=config --list < config.conf
Michal Marek 3efbe7
    } | sort -u )"
Michal Marek 3efbe7
Michal Marek 03d141
for file in $referenced_files; do
Michal Marek 03d141
	case $file in
Michal Marek 03d141
	config/* | patches.*/*)
Michal Marek 03d141
		;;
Michal Marek 03d141
	*)
Michal Marek 03d141
		echo "Error: Patches must be placed in the patches.*/ subdirectories: $file" >&2
Michal Marek 03d141
		exit 1
Michal Marek 03d141
	esac
Michal Marek 03d141
done
Jeff Mahoney e8a693
Egbert Eich 8e5a8e
[ "$flavor" == "vanilla" ] &&  \
Egbert Eich 8e5a8e
    sed -i '/^$\|\s*#\|patches\.\(kernel\.org\|rpmify\)/b; s/\(.*\)/#### \1/' \
Egbert Eich 8e5a8e
    $build_dir/series.conf
Jeff Mahoney e8a693
Michal Marek 3efbe7
inconsistent=false
Michal Marek 3efbe7
check_for_merge_conflicts $referenced_files kernel-source.changes{,.old} || \
Michal Marek 3efbe7
	inconsistent=true
Michal Marek 3efbe7
scripts/check-conf || inconsistent=true
Michal Marek 3efbe7
scripts/check-cvs-add --committed || inconsistent=true
Michal Marek 3efbe7
Michal Marek 3efbe7
tsfile=source-timestamp
Michal Marek 3efbe7
if ! scripts/cvs-wd-timestamp > $build_dir/$tsfile; then
Michal Marek 3efbe7
    exit 1
Michal Marek 3efbe7
fi
Michal Marek 3efbe7
2a75a6
localversion=$(get_localversion $SRCVERSION)
2a75a6
[ -n "$localversion" ] && echo -n "$localversion" > $build_dir/localversion
2a75a6
Michal Marek 3efbe7
if $using_git; then
Michal Marek 3efbe7
    # Always include the git revision
Michal Marek 3efbe7
    echo "GIT Revision: $(git rev-parse HEAD)" >> $build_dir/$tsfile
Michal Marek 3efbe7
    tag=$(get_branch_name)
Michal Marek 3efbe7
    if test -n "$tag"; then
Michal Marek 3efbe7
	echo "GIT Branch: $tag" >>$build_dir/$tsfile
Michal Marek 3efbe7
    fi
Michal Marek 3efbe7
fi
Michal Marek 3efbe7
Michal Marek 3efbe7
CLEANFILES=()
Michal Marek 3efbe7
trap 'if test -n "$CLEANFILES"; then rm -rf "${CLEANFILES[@]}"; fi' EXIT
Michal Marek 3efbe7
tmpdir=$(mktemp -dt ${0##*/}.XXXXXX)
Michal Marek 3efbe7
CLEANFILES=("${CLEANFILES[@]}" "$tmpdir")
Michal Suchanek 70993c
rpmfiles=$(ls rpm/* | grep -v "~$")
Michal Suchanek bd4920
rpmstatus=$(for i in $rpmfiles ; do git status -s $i ; done)
Michal Suchanek bd4920
[ -z "$rpmstatus" ] || { inconsistent=true ; echo "$rpmstatus" ; }
Michal Suchanek bd4920
Michal Suchanek bd4920
# FIXME: someone should clean up the mess and make this check fatal
Michal Suchanek bd4920
if $inconsistent; then
Michal Suchanek bd4920
    echo "Inconsistencies found."
Michal Suchanek bd4920
    echo "Please clean up series.conf and/or the patches directories!"
Michal Suchanek bd4920
    echo
Michal Suchanek bd4920
fi
Michal Marek 3efbe7
Michal Suchanek 70993c
cp -p $rpmfiles config.conf supported.conf doc/* $build_dir
Egbert Eich 8e5a8e
match="${flavor:+\\/$flavor$}"
Michal Suchanek 1d17b6
match="${arch:+^+\\($(echo -n "${arch}" | sed 's/[, ]\+/\\\|/g')\\)\\>${match:+.*}}${match}"
Egbert Eich 8e5a8e
[ -n "$match" ] && sed -i "/^$\|\s*#\|${match}/b; s/\(.*\)/#### \1/" $build_dir/config.conf
Michal Marek a7c664
if test -e misc/extract-modaliases; then
Michal Marek a7c664
	cp misc/extract-modaliases $build_dir
Michal Marek a7c664
fi
Brandon Philips 644fec
# install this file only if the spec file references it
Brandon Philips 644fec
if grep -q '^Source.*:[[:space:]]*log\.sh[[:space:]]*$' rpm/kernel-source.spec.in; then
Brandon Philips 644fec
	cp -p scripts/rpm-log.sh "$build_dir"/log.sh
Brandon Philips 644fec
fi
Takashi Iwai 18a975
rm -f "$build_dir/kernel-source.changes.old" "$build_dir/gitlog-fixups" "$build_dir/gitlog-excludes"
Michal Marek a84a58
if test -e "$build_dir"/config-options.changes; then
Michal Marek a84a58
	# Rename to  avoid triggering a build service rule error
Michal Marek a84a58
	mv "$build_dir"/config-options.changes \
Michal Marek a84a58
		"$build_dir"/config-options.changes.txt
Michal Marek a84a58
fi
Michal Marek 4b9a78
rm -f "$build_dir/config-subst"
Michal Marek 3efbe7
Michal Marek 3efbe7
changelog=$build_dir/kernel-source$VARIANT.changes
Michal Marek 3efbe7
if test -e kernel-source.changes; then
Michal Marek 3efbe7
    cat kernel-source.changes{,.old} >"$changelog"
Michal Marek 3efbe7
elif $using_git; then
Michal Marek 3efbe7
    exclude=()
Michal Marek 3efbe7
    # Exclude commits in the scripts branch, these are rarely interesting for
Michal Marek 3efbe7
    # users of the rpm packages.
Michal Marek 3efbe7
    # FIXME: the remote might have a different name than "origin" or there
Michal Marek 3efbe7
    # might be no remote at all.
Olaf Hering b98fb0
    for remote in $(git remote)
Olaf Hering b98fb0
    do
Olaf Hering b98fb0
        if git cat-file -e ${remote}/scripts 2>/dev/null; then
Olaf Hering b98fb0
            exclude[${#exclude[@]}]=^${remote}/scripts
Olaf Hering b98fb0
        fi
Olaf Hering b98fb0
    done
Michal Marek 3efbe7
    if git cat-file -e scripts 2>/dev/null; then
Michal Marek 3efbe7
        exclude[${#exclude[@]}]=^scripts
Michal Marek 3efbe7
    fi
Michal Marek 3efbe7
    if test ${#exclude[@]} -eq 0; then
Michal Marek 3efbe7
        echo "warning: no scripts or origin/scripts branch found" >&2
Michal Marek 3efbe7
        echo "warning: rpm changelog will have some useless entries" >&2
Michal Marek 3efbe7
    fi
Michal Marek 3efbe7
    changes_stop=$(sed 1q rpm/kernel-source.changes.old)
Michal Marek 3efbe7
    case "$changes_stop" in
Michal Marek 3efbe7
    last\ commit:\ *)
Michal Marek 3efbe7
        exclude[${#exclude[@]}]=^${changes_stop#*: }
Michal Marek 3efbe7
        ;;
Michal Marek 3efbe7
    *)
Michal Marek 3efbe7
        echo "expected \"last commit: <commit>\" in rpm/kernel-source.changes.old" >&2
Michal Marek 3efbe7
        exit 1
Michal Marek 3efbe7
    esac
Takashi Iwai 18a975
    if test -e rpm/gitlog-excludes; then
Takashi Iwai 2d2481
	exclude=(--excludes "$_" "${exclude[@]}")
Takashi Iwai 2d2481
    fi
Michal Marek 94e5c6
    if test -e rpm/gitlog-fixups; then
Michal Marek 94e5c6
	    exclude=(--fixups "$_" "${exclude[@]}")
Michal Marek 94e5c6
    fi
Michal Marek 3efbe7
    scripts/gitlog2changes "${exclude[@]}" HEAD -- >"$changelog"
Michal Marek 3efbe7
    sed 1d rpm/kernel-source.changes.old >>"$changelog"
Michal Marek bdc633
    scripts/rpm-changes-merge.pl -1 "$changelog"
Michal Marek 3efbe7
else
Michal Marek 3efbe7
    touch "$changelog"
Michal Marek 3efbe7
fi
Michal Marek 3efbe7
Michal Marek 3efbe7
if [ -e extra-symbols ]; then
Michal Marek 3efbe7
	install -m 755					\
Michal Marek 3efbe7
		extra-symbols				\
Michal Marek 3efbe7
		$build_dir
Michal Marek 3efbe7
fi
Michal Marek 3efbe7
Michal Marek 3efbe7
# Usage:
Michal Marek 3efbe7
# stable_tar [-t <timestamp>] [-C <dir>] [--exclude=...] <tarball> <files> ...
Michal Marek 3efbe7
# if -t is not given, files must be within a git repository
Michal Marek 3efbe7
stable_tar() {
Michal Marek c56654
    local tarball mtime chdir="." tar_opts=()
Michal Marek 3efbe7
Michal Marek 3efbe7
    while test $# -gt 2; do
Michal Marek 3efbe7
        case "$1" in
Michal Marek 3efbe7
        -t)
Michal Marek c56654
            mtime=$2
Michal Marek 3efbe7
            shift 2
Michal Marek 3efbe7
            ;;
Michal Marek 3efbe7
        -C)
Michal Marek 3efbe7
            chdir=$2
Michal Marek c56654
	    tar_opts=("${tar_opts[@]}" -C "$2")
Michal Marek 3efbe7
            shift 2
Michal Marek 3efbe7
            ;;
Michal Marek 3efbe7
        --exclude=*)
Michal Marek 3efbe7
            tar_opts=("${tar_opts[@]}" "$1")
Michal Marek 3efbe7
            shift
Michal Marek 3efbe7
            ;;
Michal Marek 3efbe7
        --exclude)
Michal Marek 3efbe7
            tar_opts=("${tar_opts[@]}" "$1" "$2")
Michal Marek 3efbe7
            shift 2
Michal Marek 3efbe7
            ;;
Michal Marek 3efbe7
        *)
Michal Marek 3efbe7
            break
Michal Marek 3efbe7
        esac
Michal Marek 3efbe7
    done
Michal Marek 3efbe7
    tarball=$1
Michal Marek 3efbe7
    shift
Michal Marek 3efbe7
Michal Marek c56654
    if test -z "$mtime" && $using_git; then
Michal Marek c82a3b
	local dirs=$(printf '%s\n' "$@" | sed 's:/.*::' | sort -u)
Michal Marek c56654
        mtime="$(cd "$chdir"
Michal Marek c82a3b
            echo "${dirs[@]}" | xargs git log -1 --pretty=tformat:%ct -- | sort -n | \
Michal Marek ba50b2
            tail -n 1)"
Michal Marek 3efbe7
    fi
Michal Marek 28e83c
    if test -n "$mtime"; then
Michal Marek 28e83c
        tar_opts=("${tar_opts[@]}" --mtime "$mtime")
Michal Marek 28e83c
    fi
Michal Marek 8cb5b4
    printf '%s\n' "$@" | \
Michal Marek 4cdfd1
	    scripts/stable-tar.pl "${tar_opts[@]}" -T - | bzip2 -9 >"$tarball"
Michal Marek 4cdfd1
    case "${PIPESTATUS[*]}" in
Michal Marek 4cdfd1
    *[1-9]*)
Michal Marek 4cdfd1
        exit 1
Michal Marek 4cdfd1
    esac
Michal Marek 3efbe7
}
Michal Marek 3efbe7
Michal Marek 7016bd
# create the *.tar.bz2 files in parallel: Spawn a job for each cpu
Michal Marek 7016bd
# present; wait for all of them to finish; submit a new set of jobs.
Michal Marek 7016bd
# This is not a very efficient algorithm and it can result in anomalies
Michal Marek 7016bd
# where adding a cpu slows the script down, so improvements are welcome.
Michal Marek 7016bd
slots=$(getconf _NPROCESSORS_ONLN)
Michal Marek 7016bd
if test 0$slots -lt 1; then
Michal Marek 7016bd
	slots=1
Michal Marek 7016bd
fi
Michal Marek 7016bd
used=0
Michal Marek 7016bd
wait_archives()
Michal Marek 7016bd
{
Michal Marek 7016bd
	if test $used -gt 0; then
Michal Marek 7016bd
		wait
Michal Marek 7016bd
		if grep -q '[^0]' "$tmpdir"/result-*; then
Michal Marek 7016bd
			exit 1
Michal Marek 7016bd
		fi
Michal Marek 7016bd
		used=0
Michal Marek 7016bd
		rm -f "$tmpdir"/result-*
Michal Marek 7016bd
	fi
Michal Marek 7016bd
}
Michal Marek 7016bd
do_archive()
Michal Marek 7016bd
{
Michal Marek 7016bd
	if test $slots -eq 1; then
Michal Marek 7016bd
		stable_tar "$@"
Michal Marek 7016bd
		return
Michal Marek 7016bd
	fi
Michal Marek 7016bd
	if test $used -eq $slots; then
Michal Marek 7016bd
		wait_archives
Michal Marek 7016bd
	fi
Michal Marek 7016bd
	(stable_tar "$@"; echo $? >"$tmpdir/result-$used") &
Michal Marek 7016bd
	let used++
Michal Marek 7016bd
}
Michal Marek 7016bd
Michal Marek 3efbe7
# The first directory level determines the archive name
Michal Marek 3efbe7
all_archives="$(
Michal Marek 3efbe7
    echo "$referenced_files" \
Michal Marek 3efbe7
    | sed -e 's,/.*,,' \
Michal Marek 3efbe7
    | uniq )"
Michal Marek 3efbe7
for archive in $all_archives; do
Michal Marek 3efbe7
    echo "$archive.tar.bz2"
Michal Marek 3efbe7
Michal Marek 6d5c47
    files="$(echo "$referenced_files" | sed -ne "\:^${archive//./\\.}/:p")"
Michal Marek 3efbe7
    if [ -n "$files" ]; then
Michal Marek 7016bd
	do_archive $build_dir/$archive.tar.bz2 $files
Michal Marek 3efbe7
    fi
Michal Marek 3efbe7
done
Michal Marek 3efbe7
Michal Marek 83a948
if test -d kabi; then
Michal Marek 83a948
    echo "kabi.tar.bz2"
Michal Marek 7016bd
    do_archive $build_dir/kabi.tar.bz2 kabi
Michal Marek 83a948
fi
Michal Marek 3efbe7
Michal Marek b7325c
if test -d sysctl && \
Michal Marek b7325c
	grep -q '^Source.*\
Michal Marek b7325c
then
Michal Marek b7325c
	echo "sysctl.tar.bz2"
Michal Marek 7016bd
	do_archive $build_dir/sysctl.tar.bz2 sysctl
Michal Marek b7325c
fi
Michal Marek 7016bd
wait_archives
Michal Marek b7325c
Michal Marek b7325c
Michal Marek 3efbe7
# Create empty dummys for any *.tar.bz2 archive mentioned in the spec file
Michal Marek 3efbe7
# not already created: patches.addon is empty by intention; others currently
Michal Marek 3efbe7
# may contain no patches.
Michal Marek 3efbe7
archives=$(sed -ne 's,^Source[0-9]*:.*[ \t/]\([^/]*\)\.tar\.bz2$,\1,p' \
Michal Marek 3efbe7
           $build_dir/kernel-source.spec.in | sort -u)
Michal Marek 3efbe7
for archive in $archives; do
Michal Marek a2559d
    case "$archive" in
Michal Marek a2559d
    *%*)
Michal Marek a2559d
        # skip archive names with macros
Michal Marek a2559d
        continue
Michal Marek a2559d
    esac
Michal Marek a2559d
    if test -e "$build_dir/$archive.tar.bz2"; then
Michal Marek a2559d
        continue
Michal Marek 3efbe7
    fi
Michal Marek a2559d
    echo "$archive.tar.bz2 (empty)"
Michal Marek a2559d
    tmpdir2=$(mktemp -dt ${0##*/}.XXXXXX)
Michal Marek a2559d
    CLEANFILES=("${CLEANFILES[@]}" "$tmpdir2")
Michal Marek a2559d
    mkdir -p $tmpdir2/$archive
Michal Marek c56654
    stable_tar -C $tmpdir2 -t 1234567890 $build_dir/$archive.tar.bz2 $archive
Michal Marek 3efbe7
done
Michal Marek 3efbe7
Michal Marek 3efbe7
if [ -n "$ignore_kabi" ]; then
Michal Marek 3efbe7
    echo > $build_dir/IGNORE-KABI-BADNESS
Michal Marek 3efbe7
fi
Michal Marek 3efbe7
if [ -n "$tolerate_unknown_new_config_options" ]; then
Michal Marek 3efbe7
    echo > $build_dir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS
Michal Marek 3efbe7
fi
Michal Marek 3efbe7
Michal Marek 3efbe7
echo "cd $build_dir; ./mkspec ${mkspec_args[@]}"
Michal Marek 3efbe7
patches=$PWD
Michal Marek 3efbe7
cd "$build_dir"
Michal Marek 3efbe7
./mkspec --patches "$patches" "${mkspec_args[@]}"