FS#8890 - separate download and build stages for offline mode (cvs/svn PKGBUILDs)

Attached to Project: Pacman
Opened by Mildred (mildred) - Tuesday, 11 December 2007, 01:27 GMT
Last edited by Allan McRae (Allan) - Friday, 10 August 2012, 04:56 GMT
Task Type Feature Request
Category makepkg
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 3.0.6
Due in Version 4.1.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently, cvs/svn packages do the checkout 'or the update) in the build function regardless of whenever the user is connected to the Internet and can fetch the sources. So I propose to add an option to makepkg that would tell him not to download the sources and use what's already downloaded (and of course if something is missing, stop the buid process).


And to allow cvs/svn/whatever package to be built this way, a variable like $do_download should be set to tell the PKGBUILD whenever it is allowed to connect to the internet to fetch the source or whenever it should only use what has been downloaded so far.


To allow someone to download the source but not build it (just keep it there for a later build), makepkg would need another option like --onlydownload. And we have to figure out a way to tell PKGBUILD to act acordingly. We could set like previously a variable $do_build if you have better ideas, please tell.


This task depends upon

Closed by  Allan McRae (Allan)
Friday, 10 August 2012, 04:56 GMT
Reason for closing:  Implemented
Additional comments about closing:  https://projects.archlinux.org/pacman.gi t/commit/?id=024bc44a
Comment by Dan McGee (toofishes) - Tuesday, 11 December 2007, 02:13 GMT
Why don't we start by looking at the current makepkg options...

$ makepkg --help
makepkg (pacman) 3.1.0devel

Usage: /usr/bin/makepkg [options]

Options:
<snip>
-e, --noextract Do not extract source files (use existing src/ dir)
<snip>
-o, --nobuild Download and extract files only
<snip>

I think we could generalize the way makepkg works a bit more. Andrew had a patch for a while that added a separate install() function that would be the only part of makepkg to run under fakeroot. Perhaps we could add an optional prep() section as well?
Comment by Mildred (mildred) - Tuesday, 11 December 2007, 09:57 GMT
Yes, i forgot avout --nobuild. But --noextract is not the same as --nodownload

Your solution seems great, just add pref and install functions. And to be backwards compatible, provide default implementation that does nothing.
Comment by Dan McGee (toofishes) - Tuesday, 11 December 2007, 16:14 GMT
Heh, my solution? Patches welcome. :P
Comment by Aaron Griffin (phrakture) - Tuesday, 11 December 2007, 17:43 GMT
Well, there's another bug report that suggests adding handlers for SCM-based source in the source=() array somehow. Perhaps, if that is done, --noextract would make sense, as the cvs co wouldn't be part of the build function.
Comment by Gavin Bisesi (Daenyth) - Wednesday, 16 April 2008, 19:49 GMT
Personally I like the idea of a prep() function or similar that would be run prior to build(). More splitting only makes it more versatile IMO
Comment by Gavin Bisesi (Daenyth) - Monday, 11 August 2008, 18:24 GMT
After thinking more on this, I think handling it in the source array would be better... I'll try to make a patch to use git:// urls in the source array. I don't know how to handle $_gitname though. I'll see about using some magic maybe.
Comment by Gavin Bisesi (Daenyth) - Tuesday, 12 August 2008, 15:16 GMT
Also a note, Aaron was referring to  FS#7816 

Loading...