# Automating *do not* --delete-build-only



## AngusBuchanan (Feb 6, 2011)

I'm trying to script some installs using portmaster.  However the default behaviour seems to be to ask me if I want to delete ports that are build only dependencies.

I understand, from reading the manual pages, that I can specify --delete-build-only to say 'yes' to this question.  I want to say 'no'.  However, I want to say know non-interactively.  I can't find any refererences to this, or any relevant questions in the archives.

Any ideas?


----------



## AngusBuchanan (Feb 6, 2011)

In fact --delete-build-only doesn't work either.  I still get:



```
===>   Registering installation for gettext-0.18.1.1
===>>> Creating a package for new version gettext-0.18.1.1
===>>> Package saved to /usr/ports/packages/All
===>  Cleaning for gettext-0.18.1.1
Installation of devel/gettext (gettext-0.18.1.1) succeeded
===>>> Delete gettext-1.05.tar.gz? y/n [n]
```

The commands I issued were:



```
sh -c '
portsnap fetch
portsnap extract
BATCH=yes
export BATCH
cd /usr/ports/ports-mgmt/portmaster
make install
echo "RUBY_DEFAULT_VER=1.9" >> /etc/make.conf
portmaster -gG --no-confirm --delete-build-only lang/ruby19 converters/ruby-iconv'
```


----------



## AngusBuchanan (Feb 6, 2011)

Solved.

I misread the manual page and confused distfiles and build packages.

Use the -d or -D options to specify whether to keep or remove the dist files.


----------

