Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Macports: assume yes on "Continue Y/N" prompts?

I'm a complete noob when it comes to macports. I've just started a new job, they've given me a new work laptop and a basic bash script filled with just over 20,000 ports. I'm running macports 2.4.1 on OS X Sierra.

Occasionally a port wants my password, usually to allow a port to run on startup. So simply creating some sort of script to press y and enter over and over isn't going to work very well.

I've tried to search around but most people are looking for methods to stop macports installing dependencies altogether which is not what i'm after, I need it to simply assume that I do want to install all dependencies without asking for a prompt. I'm not sure if this is something I could do with an argument or by editing a config file somewhere.. or something that's possible at all.

Any help appreciated :)

like image 481
Zhenhir Avatar asked Jun 28 '17 06:06

Zhenhir


2 Answers

If you really want to answer yes, non-interactive mode is not necessarily the right answer. As mentioned in a comment by @neverpanic, non-interactive mode merely falls back to a safe default rather than assuming yes, an affirmative response.

In order to really answer in the affirmative, you can always fall back to the good old yes command:

$ sudo -s                                                           
Password:
root@host $ yes | port install ImageMagick GraphicsMagick
like image 142
GDP2 Avatar answered Oct 22 '22 18:10

GDP2


Add the -N flag to the port command so "interactive questions are not asked."

From man port:

   -N
       Non-interactive mode, interactive questions are not asked
like image 13
Craig Avatar answered Oct 22 '22 18:10

Craig