dyn_spec: account for empty $FILESDIR
authorZac Medico <zmedico@gentoo.org>
Fri, 29 Oct 2010 09:55:19 +0000 (02:55 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 29 Oct 2010 09:55:19 +0000 (02:55 -0700)
This should fix bug 342721.

bin/misc-functions.sh

index b266764f9909e6877f963a5e556163cc8e9e7a09..79ce4362883b990b8fd1e0a78d309e9632d67721 100755 (executable)
@@ -907,8 +907,10 @@ dyn_package() {
 dyn_spec() {
        local sources_dir=/usr/src/rpm/SOURCES
        mkdir -p "${sources_dir}"
+       declare -a tar_args=("${EBUILD}")
+       [[ -d ${FILESDIR} ]] && tar_args=("${EBUILD}" "${FILESDIR}")
        tar czf "${sources_dir}/${PF}.tar.gz" \
-               "${EBUILD}" "${FILESDIR}" || \
+               "${tar_args[@]}" || \
                die "Failed to create base rpm tarball."
 
        cat <<__END1__ > ${PF}.spec