Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 10347 - Digest files, manually-downloaded packages
Summary: Digest files, manually-downloaded packages
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 10350
  Show dependency tree
 
Reported: 2002-11-06 16:13 UTC by CJ Kucera
Modified: 2011-10-30 22:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Diff of /usr/lib/python-2.2/site-packages/portage.py (nofetch-portage.diff,468 bytes, patch)
2002-11-06 16:25 UTC, CJ Kucera
Details | Diff
Diff of /usr/lib/portage/ebuild.sh (nofetch-ebuild.diff,416 bytes, patch)
2002-11-06 16:26 UTC, CJ Kucera
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description CJ Kucera 2002-11-06 16:13:54 UTC
I was creating an ebuild today which requires the manual download of a package.
 I had a nice message that would display on src_unpack() which told the users
where to go to download the package, and all was well.  I was about to upload it
here when I noticed that the digest file was zero-length.  After playing around
with the ebuild a bit more, I found that the only way to get the digest file to
contain an accurate digest of the file was to add in the filename to SRC_URI.

Unfortunately, when there's anything in the SRC_URI function, Portage will try
to download the package, fail, and end with an error message.  I tried putting
my check for the file in both pkg_setup() and src_unpack(), to no avail.  Next,
I tried adding 'RESTRICT="fetch"' to the ebuild, but that only displays an
uninformative message telling the user to "look at the ebuild for details."

So, unless I'm missing something big, you can *either:*
  1) Have a digest for the to-be-manually-downloaded file, or
  2) Have a nice message to tell the user where to download the file from.

Ideally, I'd like to be able to do both.  I think that the nicest solution would
be to create another user-overrideable function along the lines of src_fetch(),
and then ebuild authors could put the necessary messages in there.  Or possibly,
change the behavior of setting RESTRICT="fetch" so that it executes a
src_nofetch() command from tthe ebuild . . .  There are probably some other
solutions as well.  Anyway, what does everyone think?
Comment 1 CJ Kucera 2002-11-06 16:25:24 UTC
Created attachment 5429 [details, diff]
Diff of /usr/lib/python-2.2/site-packages/portage.py

I figured I might as well take a look to see how easy it would be to implement
something like this.  I'm probably doing a few things wrong here, but this
solution does work.

If RESTRICT="fetch" is defined in the ebuild, and the distfile is NOT present
in /usr/portage/distfiles, it'll execute the function "pkg_nofetch" (if it
exists) from the ebuild, wherein the ebuild author can provide a more
meaningful error message.  This patch I'm attaching now should be applied to
/usr/lib/python-2.2/site-packages/portage.py.  There's another patch which I'll
upload in a second which should be applied to /usr/lib/portage/bin/ebuild.sh.
Comment 2 CJ Kucera 2002-11-06 16:26:16 UTC
Created attachment 5430 [details, diff]
Diff of /usr/lib/portage/ebuild.sh

This patch is for /usr/lib/portage/ebuild.sh.

Like I said, simple stuff, but it does work.  Let me know what I'm doing wrong.
 :)
Comment 3 SpanKY gentoo-dev 2003-01-08 13:53:20 UTC
ebuild.sh now supports pkg_nofetch