# Download all distfiles only for amd64



## heraldo (Nov 29, 2021)

Hello everybody... 

How can I download all distfiles just for my platform (amd64). 
Using "make fetch" every time it finds a port to another platform, for example sparc64, the command stops the process... 
Any tips?


----------



## SirDice (Nov 29, 2021)

The ports tree works for all architectures and versions. Very few distfiles are actually architecture dependent.


----------



## covacat (Nov 29, 2021)

[ X$(make -V __ARCH_OK) == "X1" ] && make fetch
but as SirDice said, there are very few ports that depend on $ARCH


----------



## heraldo (Nov 29, 2021)

covacat said:


> [ X$(make -V __ARCH_OK) == "X1" ] && make fetch
> but as SirDice said, there are very few ports that depend on $ARCH


Can you give more details on how to use?

For example:

root@n43s:/usr/ports/sysutils # make fetch
...
===>   adtool-1.3.3_3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by adtool-1.3.3_3 for building
===> afbinit
===>  afbinit-1.0_4 is only for sparc64, while you are running amd64.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/sysutils/afbinit
*** Error code 1

Stop.

root@n43s:/usr/ports/sysutils # make fetch-recursive
make: don't know how to make fetch-recursive. Stop

make: stopped in /usr/ports/sysutils
root@n43s:/usr/ports/sysutils #

"FREEBSD HANDBOOK...
5.5.1.1. Customizing Ports Installation​Some ports provide build options which can be used to      enable or disable application components, provide security      options, or allow for other customizations.  Examples      include www/firefox,      security/gpgme, and      mail/sylpheed-claws.      If the port depends upon other ports which have configurable      options, it may pause several times for user interaction      as the default behavior is to prompt the user to select      options from a menu.  To avoid this, run make        config-recursive within the port skeleton to do      this configuration in one batch.  Then, run make        install [clean] to compile and install the      port.

Tip:​When using        config-recursive, the list of        ports to configure are gathered by the        all-depends-list target.  It is        recommended to run make          config-recursive until all dependent ports        options have been defined, and ports options screens no        longer appear, to be certain that all dependency options        have been configured.
There are several ways to revisit a port's build options      menu in order to add, remove, or change these options after      a port has been built.  One method is to      cd into the directory containing the      port and type make config.  Another      option is to use make showconfig.      Another option is to execute make        rmconfig which will remove all selected options      and allow you to start over.  All of these options, and      others, are explained in great detail in      ports(7).

The ports system uses fetch(1) to download the      source files, which supports various environment variables.      The FTP_PASSIVE_MODE,      FTP_PROXY, and FTP_PASSWORD      variables may need to be set if the FreeBSD system is behind      a firewall or FTP/HTTP proxy.  See fetch(3) for the      complete list of supported variables.

For users who cannot be connected to the Internet all      the time, make fetch can be run within      /usr/ports, to fetch all distfiles, or      within a category, such as      /usr/ports/net, or within the specific      port skeleton.  Note that if a port has any dependencies,      running this command in a category or ports skeleton will      _not_ fetch the distfiles of ports from      another category.  Instead, use make        fetch-recursive to also fetch the distfiles for      all the dependencies of a port.

... "


----------



## covacat (Nov 29, 2021)

look at the output of 
make -V __ARCH_OK
it should be 1 if you can build, an empty string if not


----------



## covacat (Nov 29, 2021)

just paste my 1st post in the terminal, should work if you are using bourne shell


----------



## heraldo (Nov 29, 2021)

covacat said:


> just paste my 1st post in the terminal, should work if you are using bourne shell


root@n43s:/usr/ports/sysutils # [ X$(make -V __ARCH_OK ) == "X1" ] && make fetch
Illegal variable name.

I'm using it in the bourne shell


----------



## SirDice (Nov 29, 2021)

heraldo said:


> I'm using it in the bourne shell


You're using the csh(1) for root.


----------



## a6h (Nov 29, 2021)

heraldo said:


> root@n43s:/usr/ports/sysutils # [ X$(make -V __ARCH_OK ) == "X1" ] && make fetch
> Illegal variable name.
> 
> I'm using it in the bourne shell


Correct verion, I think -- the *X *character:
`[ X$(make -V __ARCH_OK ) == X"1" ] && make fetch`


----------



## SirDice (Nov 29, 2021)

No, that's not the problem. The problem is that `$(...)` doesn't work in a C shell (produces an Illegal variable name error). 


```
dice@molly:~ % echo $(id)
Illegal variable name.
dice@molly:~ % sh
$ echo $(id)
uid=1001(dice) gid=1001(dice) groups=1001(dice),0(wheel)
```

This will work in both C shell and Bourne shells: `[ X`make -V __ARCH_OK` == "X1" ] && make fetch` (but those backticks are often mangled when copy/pasting from webpages).


----------



## heraldo (Nov 29, 2021)

SirDice said:


> You're using the csh(1) for root.


root@n43s:/usr/ports/sysutils # echo "$SHELL"
/bin/csh

You're right... I have the csh...
I'll change and test...
I thought FreeBSD was installed with the default shell...


----------



## heraldo (Nov 29, 2021)

root@n43s:/usr/ports/sysutils # echo "$SHELL"
/bin/sh
root@n43s:/usr/ports/sysutils # [ X$(make -V __ARCH_OK) == "X1" ] && make fetch
root@n43s:/usr/ports/sysutils #
Did nothing...

root@n43s:/usr/ports/sysutils # [ X$(make -V __ARCH_OK ) == X"1" ] && make fetch
root@n43s:/usr/ports/sysutils # 
Did nothing...


I use CCACHE...Any influence?
My /etc/make.conf:
WITH_CCACHE_BUILD=yes

.if ${.CURDIR:M*/ports/devel/ccache}
  NO_CCACHE= yes
.endif


----------



## covacat (Nov 29, 2021)

only works in a port dir not in a category dir


----------



## T-Daemon (Nov 29, 2021)

You could

```
/usr/ports/sysutils: # mv Makefile  Makefile.orig

# cp Makefile.orig  Makefile

edit Makefile, delete line

25     SUBDIR += afbinit
```

After `make fetch` is completed: 

```
#  mv  Makefile.orig  Makefile
```


----------



## grahamperrin@ (Dec 2, 2021)

heraldo said:


> … I thought FreeBSD was installed with the default shell…











						Current proposal to make /bin/sh the default shell for root
					

For those who would not otherwise see it - From the FreeBSD Current mailing list:   Date: Wed, 22 Sep 2021 10:36:45 +0200 From: Baptiste Daroussin  To: current@freebsd.org, arch@FreeBSD.org Subject: [HEADSUP] making /bin/sh the default shell for root  Hello,  TL;DR: this is not a proposal to...




					forums.freebsd.org


----------

