Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store metadata with installed Casks. #3066

Merged
merged 1 commit into from
Dec 11, 2014

Conversation

rolandwalker
Copy link
Contributor

Step 1: Snapshot the Cask file used at install-time.

Using a simple filesystem-is-a-database approach, set up a
.metadata directory for each installed Cask in which we can
record any information, starting with a copy of the Cask
definition which was used at install-time.

This should be useful for various cases such as:

  • a fallback when the Cask was renamed/removed. We currently cannot recover any uninstall info in that scenario
  • installation of multiple versions of the same software

There might be a smarter way to discover the source filename
for the Cask through introspection or some deep Ruby voodoo.
All I could come up with was to pass the filename in on the
constructor, which seems perfectly reasonable if voodoo is
not available. The existing code was taking the title as an
argument to the constructor, which is dispensable.

This PR contains no code to actually make use of the metadata,
but only takes care of the relevant book-keeping: creation,
destruction, as well as organization of metadata according to
software version number and timestamp.

@@ -3,6 +3,11 @@ def destination_path
caskroom_path.children.first
end

def initialize(sourcefile_path=nil)
@sourcefile_path = sourcefile_path
@title = sourcefile_path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not @title = self.class.title like in cask.rb

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

@tapeinosyne
Copy link
Contributor

Storing metadata is very desirable for the gpg stanza as merged in #4848. Instinctively, I feel rather adamant about keeping the package signatures on disk, as opposed to discarding post-verification.

@rolandwalker rolandwalker force-pushed the snapshot_caskfiles branch 3 times, most recently from 881bf73 to 3e281e2 Compare September 25, 2014 15:41
@rolandwalker rolandwalker added core Issue with Homebrew itself rather than with a specific cask. and removed enhancement labels Oct 17, 2014
Step 2: Snapshot the Cask file used at install-time, using
the previously-merged metadata directory support.

Using a simple filesystem-is-a-database approach, we set up a
`.metadata` directory for each installed Cask in which we can
record any information, starting with a copy of the Cask
definition which was used at install-time.

This should be useful for various cases such as:
- a fallback when the Cask was renamed/removed.  We
  currently cannot recover any uninstall info in that
  scenario
- installation of multiple versions of the same software

There might be a smarter way to discover the source filename
for the Cask through introspection or some deep Ruby voodoo.
All I could come up with was to pass the filename in on the
constructor, which seems perfectly reasonable if voodoo is
not available.  The existing code was taking the title as an
argument to the constructor, which is dispensable.

This PR contains no code to actually make use of the metadata,
but only takes care of the relevant book-keeping: creation,
destruction, as well as organization of metadata according to
software version number and timestamp.
rolandwalker added a commit that referenced this pull request Dec 11, 2014
Store metadata with installed Casks.
@rolandwalker rolandwalker merged commit 6bed7f5 into Homebrew:master Dec 11, 2014
@rolandwalker rolandwalker deleted the snapshot_caskfiles branch December 11, 2014 00:40
@miccal miccal removed the core Issue with Homebrew itself rather than with a specific cask. label Dec 23, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants