Identifying possible situations for interactivity

Eric Gallager egall at gwmail.gwu.edu
Sat Sep 1 16:12:11 UTC 2018


So I was going thru my drafts folder and found this unsent message in
it from a few years ago; much of it may no longer be relevant now that
MacPorts has already added interactivity, but I figured I might as
well send this anyways for the archives so what I wrote doesn't die
stuck in my drafts.

The old part of this message starts below here:

That seems like a good start and includes most of the situations that
I thought to recommend at first.
Here are some more situations inspired by tickets on trac:

 - after running `selfupdate`, MacPorts could ask the user if they
next want to upgrade
   all their outdated ports. Right now MacPorts just suggests that the user
   do this manually, which can be confusing when running MacPorts interactively:
   https://trac.macports.org/ticket/27097
 - the "prompt to install dependencies" idea got brought up in a ticket:
   https://trac.macports.org/ticket/5001
   I will get to more on that later though.

And here are some more situations inspired by Fink:

 - after a download fails, MacPorts could ask the user how to proceed.
   This is what Fink does. For example:
{{{
curl --connect-timeout 30 -f -L -A 'fink/0.36.4' -O
http://distfiles.master.finkmirrors.net/distfiles/fltk-1.3.2-source.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 85 4161k   85 3560k    0     0  1335k      0  0:00:03  0:00:02
0:00:01 1335k^C### execution of curl failed, exit code 2
Downloading the file "fltk-1.3.2-source.tar.gz" failed.

(1)	Give up
(2)	Retry the same mirror
(3)	Retry another mirror from your country
(4)	Retry another mirror from your continent
(5)	Retry another mirror
(6)	Retry using next mirror set "Custom (package-defined) servers"

Default answer will be chosen in 120 seconds...
How do you want to proceed? [3] ^C
Failed: User interrupt.
}}}
   The output varies depending on the mirrors available in the mirror set.
   I am not sure if MacPorts knows the same things about its mirrors
that Fink does,
   (i.e. what continent/country they are located on), so you might want to check
 - Along those lines, if a download is incomplete, MacPorts could ask
what to do with it.
   Fink asks this like this:
{{{
The checksum of the file fltk-1.3.2-source.tar.gz of package
fltk13-aqua-1.3.2-3 is incorrect. The most likely cause for this is a
corrupted or incomplete download
Expected: 9f7e707d4fb7a5a76f0f9b73ff70623d
Actual: MD5(506e2922ceac589a2cfeac2f6f6a0a0f)
        SHA1(384faeb2a9a21863f0d7606847cc888af33b88e0)
        SHA256(44f17f0fe8b8b05c4a6ff0956a0330d6706f4b7fa68b419b5cc40aa39583e3c3)
It is recommended that you download it again. How do you want to proceed?

(1)	Give up
(2)	Delete it and download again
(3)	Assume it is a partial download and try to continue
(4)	Don't download, use existing file

Make your choice:  [2]
}}}
 - modifications to configuration files:
{{{
Configuration file `/sw64/etc/shells'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : background this process to examine the situation
 The default action is to keep your current version.
*** shells (Y/I/N/O/D/Z) [default=N]
}}}


On 5/12/14, Shashwat Pandey <devshashwatpandey at gmail.com> wrote:
> Hi all
>
> I am working on the Interactive Port Command project for GSoC 2014. To
> begin with my project i first need to identify places where implementing
> interactivity(user decisions/approvals) will stop Macports from quitting as
> the user input will resolve any conflicts. In general terms i have to
> identify any place where interactivity makes sense.
>
> For this I need the help of the list. Below are all places known to me.
> Please help me by adding to it.
>
> - When trying to install a port that conflicts with a port you already
>    have installed, ask the user whether the conflicting port should be
>    disabled.
> - When trying to install a port but one of the files installed by this
>    port is already present, ask the user whether the file should be
>    overwritten.
> - When a user tries to install a port, display a list of ports that
>    will be installed as dependencies and ask for confirmation (unless
>    there aren't any dependencies to be installed), like apt-get does.
> - Asking for permission in a situation where uninstalling a package will
> break another package that's still installed and depends on the
> to-be-uninstalled package.
>


More information about the macports-dev mailing list