typedef enum ReadDefinitionsFlags {
READ_DEFINITIONS_REQUIRES_ENABLED_TRANSFERS = 1 << 0,
+ READ_DEFINITIONS_REQUIRES_ANY_TRANSFERS = 1 << 1,
} ReadDefinitionsFlags;
static int context_read_definitions(Context *c, const char* node, ReadDefinitionsFlags flags) {
log_warning("As of v257, transfer definitions should have the '.transfer' extension.");
}
- if (c->n_transfers + (FLAGS_SET(flags, READ_DEFINITIONS_REQUIRES_ENABLED_TRANSFERS) ? 0 : c->n_disabled_transfers) == 0) {
+ if (FLAGS_SET(flags, READ_DEFINITIONS_REQUIRES_ANY_TRANSFERS) &&
+ c->n_transfers + (FLAGS_SET(flags, READ_DEFINITIONS_REQUIRES_ENABLED_TRANSFERS) ? 0 : c->n_disabled_transfers) == 0) {
if (arg_component)
return log_error_errno(SYNTHETIC_ERRNO(ENOENT),
"No transfer definitions for component '%s' found.",
/* Like context_make_offline(), but also communicates with the update source looking for new
* versions (as long as --offline is not specified on the command line). */
- r = context_make_offline(&context, node, READ_DEFINITIONS_REQUIRES_ENABLED_TRANSFERS);
+ r = context_make_offline(&context, node,
+ READ_DEFINITIONS_REQUIRES_ENABLED_TRANSFERS | READ_DEFINITIONS_REQUIRES_ANY_TRANSFERS);
if (r < 0)
return r;
if (r < 0)
return r;
- r = context_make_offline(&context, loop_device ? loop_device->node : NULL, 0);
+ r = context_make_offline(&context, loop_device ? loop_device->node : NULL,
+ READ_DEFINITIONS_REQUIRES_ANY_TRANSFERS);
if (r < 0)
return r;
if (r < 0)
return r;
- r = context_make_offline(&context, loop_device ? loop_device->node : NULL, 0);
+ r = context_make_offline(&context, loop_device ? loop_device->node : NULL,
+ READ_DEFINITIONS_REQUIRES_ANY_TRANSFERS);
if (r < 0)
return r;
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"The --root=/--image= switches may not be combined with the '%s' operation.", argv[0]);
- r = context_make_offline(&context, /* node= */ NULL, READ_DEFINITIONS_REQUIRES_ENABLED_TRANSFERS);
+ r = context_make_offline(&context, /* node= */ NULL,
+ READ_DEFINITIONS_REQUIRES_ENABLED_TRANSFERS | READ_DEFINITIONS_REQUIRES_ANY_TRANSFERS);
if (r < 0)
return r;