Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 49358 - emerge don't give an error message if the /usr/portage/distfiles/xyz-0.9.8.tar.bz2 ist not correct
Summary: emerge don't give an error message if the /usr/portage/distfiles/xyz-0.9.8.ta...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-29 01:13 UTC by Maurel
Modified: 2004-04-30 12:20 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maurel 2004-04-29 01:13:51 UTC
Let say, I try to
emerge xyz
Calculating dependencies ...done!
>>> emerge (1 of 1) media-sound/xyz-0.9.8 to /
...

If the file is corrupt or incomplete, emerge recognise it and try to make
a new download, but didn't give any error message.

*I* have *no* internet connection, so I have to make the download myself
and transfer the file with a memory stick. BUT my file was incomplete and
emerge don't say it to me!

As in the case the md5 is not correct, I suggest a ligth modification of
the emerge command, in the file "portage.py" such we get a better error message
and can do the necessary about the xyz-file, and restart the emerge:

============================
File: portage.py
				if mydigests!=None and mydigests.has_key(myfile):
					#if we have the digest file, we know the 
                              #final size 
					if mystat[ST_SIZE]<mydigests[myfile]["size"]:
						#fetched=1
						print
						print red("!!! File is corrupt or incomplete. (Length do not match)")
						print green(">>> our recorded length:"),mydigests[myfile]["size"]
						print green(">>>  your file's length:"),mystat[ST_SIZE]
						print red("!!! File: "),mysettings["DISTDIR"]+"/"+myfile
						print
						return 0
==========================

The line
fetched=1

is no more necessary.

With this modification, I get:
# emerge xyz                       
Calculating dependencies ...done!
>>> emerge (1 of 1) media-sound/xyz-0.9.8 to /
!!! File is corrupt or incomplete. (Length do not match)
>>> our recorded length: 1491132
>>>  your file's length: 757632
!!! File:  /usr/portage/distfiles/xyz-0.9.8.tar.bz2

Have a nice day

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Chris White (RETIRED) gentoo-dev 2004-04-29 12:44:27 UTC
Test Case:

1) emerge -pf ftp to get a listing of places to download the ftp package from.

2) use wget to get the file.

3) Transfer that file to /tmp for now.

4) Create a file with nano/vi/cat/echo that says the following:

This is a test.

5) mv that file to /usr/portage/distfiles with the same name as the file downloaded in step 2

6) emerge ftp

7) emerge should compalin about a corrupted file
Comment 2 Chris White (RETIRED) gentoo-dev 2004-04-29 12:46:04 UTC
oops, forgot the rest:

8) Just to make sure, move the file from step 3 to /usr/portage/distfiles, making sure it's replaced.

9) emerge ftp and emerge should not complain.
Comment 3 Chris White (RETIRED) gentoo-dev 2004-04-29 12:50:56 UTC
Results of the test case for me:

bash-2.05b# emerge ftp
Calculating dependencies ...done!
>>> emerge (1 of 1) net-ftp/ftp-0.17-r3 to /
>>> Resuming download...
>>> Downloading http://mirrors.tds.net/gentoo/distfiles/netkit-ftp-0.17.tar.gz
--04:42:37--  http://mirrors.tds.net/gentoo/distfiles/netkit-ftp-0.17.tar.gz
           => `/usr/portage/distfiles/netkit-ftp-0.17.tar.gz'
mirrors.tds.net &#12434;DNS&#12395;&#21839;&#12356;&#12354;&#12431;&#12379;&#12390;&#12356;&#12414;&#12377;... 216.170.153.145
mirrors.tds.net[216.170.153.145]:80 &#12395;&#25509;&#32154;&#12375;&#12390;&#12356;&#12414;&#12377;... &#25509;&#32154;&#12375;&#12414;&#12375;&#12383;&#12290;
HTTP &#12395;&#12424;&#12427;&#25509;&#32154;&#35201;&#27714;&#12434;&#36865;&#20449;&#12375;&#12414;&#12375;&#12383;&#12289;&#24540;&#31572;&#12434;&#24453;&#12387;&#12390;&#12356;&#12414;&#12377;... 206 Partial Content
&#38263;&#12373;: 53,934 (&#12398;&#12371;&#12426;53,918) [application/x-gzip]

100%[====================================>] 53,934       182.87K/s             

04:42:38 (182.84 KB/s) - `/usr/portage/distfiles/netkit-ftp-0.17.tar.gz' &#12434;&#20445;&#23384;&#12375;&#12414;&#12375;&#12383; [53934/53934]


!!! File is corrupt or incomplete. (Digests do not match)
>>> our recorded digest: 94441610c9b86ef45c4c6ec609444060
>>>  your file's digest: 618f0fa0da136e870ff64cf781e77dda
!!! File does not exist: /usr/portage/distfiles//netkit-ftp-0.17.tar.gz

One note I may add is that portage here tries to resume the file.  If your computer does not have internet access, that may be the issue.  Please let me know by running this test case with the output.  Also:

sys-apps/portage-2.0.50-r6 *

Is my version of portage.
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2004-04-30 12:20:22 UTC
The fetched=1 is necessary to resume aborted downloads. If you don't have internet access at the box in general I't probably an idea to change FETCHCOMMAND and RESUMECOMMAND in make.conf to "echo trying to download ${URI}" so portage will just print the URL instead of trying to fetch it.