Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#28568 closed defect (fixed)

Checksum fails on a distfile with spaces in its name

Reported by: l2g@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.0.2
Component: base Version: 1.9.2
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port:

Description

If an upstream file has spaces in the file name, even if the file is downloaded successfully and the correct checksums are set in the portfile, MacPorts will complain that no checksum has been set for that file, and the checksum operation will fail.

I discovered this when I had to work with just such a file. Renaming the file to eliminate the spaces (both the file itself and in the portfile) also eliminated the problem.

Attachments (1)

Portfile (953 bytes) - added by l2g@… 14 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Component: portsbase

comment:2 Changed 14 years ago by jmroot (Joshua Root)

Got a test case?

comment:3 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

Hmm, I guess I haven't tried that before. But see also #12429.

comment:4 Changed 14 years ago by l2g@…

Hmm, this does seem related. But interestingly, if I run the debug output of port checksum, it will figure out and report the expected checksums even if there are spaces in the filename.

The case where I was running into this isn't repeatable for more an hour or so--the site has a click-wrap download link even though it's open source. But I can make up an example with the mirror site I made.

Changed 14 years ago by l2g@…

Attachment: Portfile added

comment:5 Changed 14 years ago by l2g@…

Okay, the attached portfile-in-progress will demonstrate the bug. Put it in security/truecrypt.

Excerpt from output of port -d checksum truecrypt:

--->  Fetching truecrypt
DEBUG: fetch phase started at Sun Feb 27 22:46:48 PST 2011
DEBUG: Executing org.macports.fetch (truecrypt)
--->  TrueCrypt 7.0a Source.tar.gz doesn't seem to exist in /Users/larry/.macports/opt/local/var/macports/distfiles/truecrypt
DEBUG: Pinging truecrypt-mirror.l2g.to...
DEBUG: Pinging distfiles.macports.org...
DEBUG: Pinging aarnet.au.distfiles.macports.org...
DEBUG: Pinging cjj.kr.distfiles.macports.org...
DEBUG: Pinging lil.fr.distfiles.macports.org...
DEBUG: Pinging sea.us.distfiles.macports.org...
DEBUG: Pinging ykf.ca.distfiles.macports.org...
DEBUG: truecrypt-mirror.l2g.to ping time is 25.822
DEBUG: distfiles.macports.org ping time is 31.949
DEBUG: aarnet.au.distfiles.macports.org ping time is 199.301
DEBUG: cjj.kr.distfiles.macports.org ping time is 10000
DEBUG: lil.fr.distfiles.macports.org ping time is 160.422
DEBUG: sea.us.distfiles.macports.org ping time is 10000
DEBUG: ykf.ca.distfiles.macports.org ping time is 109.477
--->  Attempting to fetch TrueCrypt 7.0a Source.tar.gz from http://truecrypt-mirror.l2g.to/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1949k  100 1949k    0     0   390k      0  0:00:04  0:00:04 --:--:--  419k
DEBUG: Privilege de-escalation not attempted as not running as root.
--->  Verifying checksum(s) for truecrypt
DEBUG: checksum phase started at Sun Feb 27 22:46:56 PST 2011
DEBUG: Executing org.macports.checksum (truecrypt)
--->  Checksumming TrueCrypt 7.0a Source.tar.gz
Error: No checksum set for TrueCrypt 7.0a Source.tar.gz
Distfile checksum: TrueCrypt 7.0a Source.tar.gz md5 0a61616bc5c5ad90e876b4014c004ac9
Distfile checksum: TrueCrypt 7.0a Source.tar.gz sha1 42be0f333e6791e7a122b3e1183e014cd3860198
Distfile checksum: TrueCrypt 7.0a Source.tar.gz rmd160 92b01f87c725feb43aded666ba44fcbd3e3ac740
The correct checksum line may be:
checksums           md5     0a61616bc5c5ad90e876b4014c004ac9 \
                    sha1    42be0f333e6791e7a122b3e1183e014cd3860198 \
                    rmd160  92b01f87c725feb43aded666ba44fcbd3e3ac740
Error: Target org.macports.checksum returned: Unable to verify file checksums
DEBUG: Backtrace: Unable to verify file checksums
    while executing
"$procedure $targetname"

comment:6 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Yes I see... I guess something in portchecksum.tcl isn't right.

Totally unrelated, in your portfile, "distname ${name}-${version}-source" should be "worksrcdir ${name}-${version}-source" since on the subsequent "distfiles" line you already establish that your distfile is not named like distname, and "configure {}" should be "use_configure no".

comment:7 Changed 13 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

comment:8 Changed 13 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.0.2
Note: See TracTickets for help on using tickets.