* For bug 227625, automatically create the /usr/src/rpm/SOURCES directory when
authorZac Medico <zmedico@gentoo.org>
Sat, 26 Jul 2008 06:17:54 +0000 (06:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 26 Jul 2008 06:17:54 +0000 (06:17 -0000)
  necessary.

* Add `cd "${T}"` at the beginning of dyn_rpm() since the spec file is written
  to $PWD.

svn path=/main/trunk/; revision=11194

bin/misc-functions.sh

index b19a75b12a16ae0aa700431e3add11327c4b3494..80dd9d724427bf609128bc23de88ffd43a7371df 100755 (executable)
@@ -624,7 +624,9 @@ dyn_package() {
 }
 
 dyn_spec() {
-       tar czf "/usr/src/rpm/SOURCES/${PF}.tar.gz" \
+       local sources_dir=/usr/src/rpm/SOURCES
+       mkdir -p "${sources_dir}"
+       tar czf "${sources_dir}/${PF}.tar.gz" \
                "${EBUILD}" "${FILESDIR}" || \
                die "Failed to create base rpm tarball."
 
@@ -658,6 +660,7 @@ __END1__
 }
 
 dyn_rpm() {
+       cd "${T}" || die "cd failed"
        addwrite /usr/src/rpm
        addwrite "${RPMDIR}"
        dyn_spec