VirtualBox

Changeset 18223 in vbox


Ignore:
Timestamp:
Mar 24, 2009 7:39:47 PM (16 years ago)
Author:
vboxsync
Message:

OVF: implement EULAs in VBoxManage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp

    r18214 r18223  
    120120                  || (strThisArg == "-vmname")
    121121                  || (strThisArg == "-memory")
     122                  || (strThisArg == "-eula")
    122123                  || (fIsIgnore = (strThisArg == "-ignore"))
    123124                  || (strThisArg.substr(0, 5) == "-type")
     
    222223                                   ulVsys, cVirtualSystemDescriptions);
    223224        }
     225
     226        uint32_t cLicensesInTheWay = 0;
    224227
    225228        // dump virtual system descriptions and match command-line arguments
     
    290293                                        "\n    (change with \"-vsys %d -ostype <type>\"; use \"list ostypes\" to list all)\n",
    291294                                        a, bstrFinalValue.raw(), i);
     295                        break;
     296
     297                        case VirtualSystemDescriptionType_License:
     298                            ++cLicensesInTheWay;
     299                            if (findArgValue(strOverride, pmapArgs, "-eula"))
     300                            {
     301                                if (strOverride == "show")
     302                                {
     303                                    RTPrintf("%2d: End-user license agreement"
     304                                             "\n    (accept with \"-vsys %d -eula accept\"):"
     305                                             "\n\n%ls\n\n",
     306                                             a, i, bstrFinalValue.raw());
     307                                }
     308                                else if (strOverride == "accept")
     309                                {
     310                                    RTPrintf("%2d: End-user license agreement (accepted)\n",
     311                                             a);
     312                                    --cLicensesInTheWay;
     313                                }
     314                                else
     315                                    return errorSyntax(USAGE_IMPORTAPPLIANCE,
     316                                                       "Argument to -eula must be either \"show\" or \"accept\".");
     317                            }
     318                            else
     319                                RTPrintf("%2d: End-user license agreement"
     320                                        "\n    (display with \"-vsys %d -eula show\";"
     321                                        "\n    accept with \"-vsys %d -eula accept\")\n",
     322                                        a, i, i);
    292323                        break;
    293324
     
    491522            } // for (unsigned i = 0; i < cVirtualSystemDescriptions; ++i)
    492523
    493             if (fExecute)
     524            if (cLicensesInTheWay == 1)
     525                RTPrintf("ERROR: Cannot import until the license agreement listed above is accepted.\n");
     526            else if (cLicensesInTheWay > 1)
     527                RTPrintf("ERROR: Cannot import until the %c license agreements listed above are accepted.\n", cLicensesInTheWay);
     528
     529            if (!cLicensesInTheWay && fExecute)
    494530            {
    495531                // go!
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette