Allan McRae wrote: > FC wrote:
>> >From ae3dd41af891f059b0aa1cc888eed873684b5580 Mon Sep 17 00:00:00 2001 >> From: Francois Charette <[email protected]> <[email protected]> >> Date: Tue, 18 Aug 2009 22:10:56 +0200 >> Subject: [PATCH] makepkg -R: allow unpacking when pkgdir is empty >> >> Also fixed some typos :) >> > > When you "additional" part of your patch is as large as the patch > itself, just make two patches. I have not reviewed the typo fixes. Fair enough. Should I resend as two separate patches? >> create_package() { >> if [ ! -d "$pkgdir" ]; then >> - error "$(gettext "Missing pkg/ directory.")" >> - plain "$(gettext "Aborting...")" >> - exit 1 # $E_MISSING_PKGDIR >> + if [ "$REPKG" -eq 1 -a -f >> $PKGDEST/${pkg}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT} ]; then >> + mkdir "$pkgdir" && cd "$pkgdir" >> + if ! bsdtar -xf >> $PKGDEST/${pkg}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT} ; then >> > > Please keep test style consistent with the rest of the code base. Not sure what you mean... > >> + error "$(gettext "Failed to extract package for >> repackaging")" >> + exit 1 # TODO: error code >> + fi >> + cd .. >> > > Do not "cd .." as $startdir and $pkgdir are not always related like > that. Especially with split packages. ok > >> + else >> + error "$(gettext "Missing pkg/ directory.")" >> + plain "$(gettext "Aborting...")" >> + exit 1 # $E_MISSING_PKGDIR >> + fi >> fi >> >> cd "$pkgdir" >> > > General comment: > Have you tested this with PKGBUILDs that define a package() function > (including split packages)? These PKGBUILDs run the package() > function when using the -R option. Without actually testing, I think > this will fail. Right, this will certainly not work with split packages... Before I spend more time on this, do you think this is worth implementing? I thought it coult be useful in situations where you build a pkg (with makepkg -c) that takes a long time compiling, and then realize you forgot one dependency, for instance. Then makepkg -R would work even if the pkgdir is empty. Of course it is also no big deal to unpack manually first... F
