Skip to content

Problem with verifier command caching #198

@opyh

Description

@opyh

Verifiers seem to cache their commands in the prepare method, which is an issue for me:

I want to write a package that downloads files generated on server to my local machine, using the matches_local verifier to see if the md5 sums match. To make the matcher work, I had to touch the files first so it doesn't fail because they don't exist.

While the package is run, the file is downloaded, but this changes the local file, changing its md5 sum too — so after the download, instead of the changed file, the empty file is compared to the server's version.

I could write my own verifier, maybe overriding the commands method like this:

def commands
    @prepared = false
    prepare
    @commands
end

…but this looks a bit hacky.

Is the caching a necessary optimization? Would it be sensible to take it out to not make it dependent on the state before a package is installed? Or is my approach nonsense and there's a better approach?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions