daemon/os: check for download-only and dry-run conflict

Minor follow-up to previous commit. It seems a bit confusing to allow
specifying `download-only` and `dry-run`. The former already includes
all the steps in the latter but goes further, as documented. Let's check
for this combination.

Closes: #1155
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2017-12-15 14:21:26 +00:00 committed by Atomic Bot
parent 183399e1cd
commit 5ff69e10db
2 changed files with 4 additions and 1 deletions

View File

@ -286,7 +286,7 @@
Update rpmmd repo metadata cache and ostree refspec. Do not
perform any deployments. This is like "dry-run" except that
the latter does not download and import packages. Not valid
if "cache-only" is specified.
if "cache-only" or "dry-run" is specified.
-->
<method name="UpdateDeployment">
<arg type="a{sv}" name="modifiers" direction="in"/>

View File

@ -661,6 +661,9 @@ start_deployment_txn (GDBusMethodInvocation *invocation,
if (vardict_lookup_bool (&options_dict, "cache-only", FALSE) &&
vardict_lookup_bool (&options_dict, "download-only", FALSE))
return glnx_null_throw (error, "Can't specify cache-only and download-only");
if (vardict_lookup_bool (&options_dict, "dry-run", FALSE) &&
vardict_lookup_bool (&options_dict, "download-only", FALSE))
return glnx_null_throw (error, "Can't specify dry-run and download-only");
if (override_replace_pkgs)
return glnx_null_throw (error, "Non-local replacement overrides not implemented yet");