# Distfile with Spaces in it



## rnejdl (Jan 16, 2011)

I am trying to make a port of ASSP version 2 as I am the maintainer of ASSP V1.  However, the V2 is proving difficult for me since the distfile looks like:

ASSP 2.0.1 2.0.12 install.ZIP

I am open to suggestions about how to setup the Makefile to account for that.  I've tried this but this doesn't work:


```
PORTNAME=       assp2
PORTVERSION=    2.0.1
PORTSUBVERSION= 2.0.12
CATEGORIES=     mail
MASTER_SITES=   SF
MASTER_SITE_SUBDIR=assp/ASSP%20V2%20multithreading/${PORTVERSION}%20${PORTSUBVERSION}/ASSP%20${PORTVERSION}%20${PORTSUBVERSION}%20Install.ZIP/
DISTNAME=       ${PORTNAME:U}" "${PORTVERSION}" "${PORTSUBVERSION}-Install
```

So, how does one do spaces in a file name when building a port?

Thanks!
Rusty Nejdl


----------



## tingo (Jan 16, 2011)

Have you tried quotes around the file name?


----------



## rnejdl (Jan 16, 2011)

Thanks!  I tried both single and double quotes and it really didn't like it:


```
DISTNAME=       "${PORTNAME:U} ${PORTVERSION} ${PORTSUBVERSION}-Install"
```
Gives:


```
> sudo make
"/usr/ports/Mk/bsd.sites.mk", line 1462: Malformed conditional (${_site_url_} == 2.0.12-Install"  CSME && !defined(MASTER_SITE_SUBDIR))
"/usr/ports/Mk/bsd.sites.mk", line 1462: Malformed conditional (${_site_url_} == 2.0.12-Install"  GNOME && !defined(MASTER_SITE_SUBDIR))
"/usr/ports/Mk/bsd.port.mk", line 6446: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 6449: if-less endif
make: fatal errors encountered -- cannot continue
```


And :

```
DISTNAME=       '${PORTNAME:U} ${PORTVERSION} ${PORTSUBVERSION}-Install'
```

Gives the same thing:


```
> sudo make
"/usr/ports/Mk/bsd.sites.mk", line 1462: Malformed conditional (${_site_url_} == 2.0.12-Install'  CSME && !defined(MASTER_SITE_SUBDIR))
"/usr/ports/Mk/bsd.sites.mk", line 1462: Malformed conditional (${_site_url_} == 2.0.12-Install'  GNOME && !defined(MASTER_SITE_SUBDIR))
"/usr/ports/Mk/bsd.port.mk", line 6446: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 6449: if-less endif
make: fatal errors encountered -- cannot continue
```
As you can see, I am also trying PORTSUBVERSION in my Makefile as well.

Rusty Nejdl


----------



## phoenix (Jan 16, 2011)

Host the file on your own server, renamed using _ instead of spaces, and point the Makefile at that.

Or, ask that the ports committer add the renamed file to the FreeBSD ports mirror servers.

Or, contact the upstream devs, and ask them to provide a file without spaces.

Really, there shouldn't be spaces in filenames on the Internet.  It just causes too many little weird things to happen, even if it is technically allowed.


----------



## rnejdl (Jan 16, 2011)

That's about what I was thinking myself and just send an email to the dev list requesting just that.  This is just going to break way too much with spaces in it.

Rusty Nejdl


----------



## wblock@ (Jan 17, 2011)

Spaces with filenames suck.  That said, it can be done.  This particular one is also complicated by sourceforge's mirror redirect and double HTML escapes like %2520.

```
PORTNAME=       assp2
PORTVERSION=    2.0.1
PORTSUBVERSION= 2.0.12
CATEGORIES=     mail
MASTER_SITES=   SF
MASTER_SITES=   SF/assp/ASSP%20V2%20multithreading/${PORTVERSION}%20${PORTSUBVERSION}
DISTNAME=       ASSP%20${PORTVERSION}%20${PORTSUBVERSION}%20install
EXTRACT_SUFX=   .ZIP
```

Tested, and now I feel dirty.


----------

