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

Implement repo import for prepackged CRS packages #140

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

maxtruxa
Copy link
Contributor

Right now, importing CRS packages created with bpt pkg create into a repository is kind of awkward, because you have to manually expand them first before running bpt repo import.
The description of bpt repo import already states Import a directory or package into a CRS repository and the header of bpt::crs::repository already contained a method prototype for import_targz(), making it obvious that the intention to provide "direct" imports was there already.

Notable changes:

  • Implemented bpt::crs::repository::import_targz(). Note that import_targz() and import_dir() share most of the implementation.
  • bpt repo import (bpt::cli::cmd::<anon>::_import_file()) checks if the provided path is a (potentially symlinked) regular file or a directory and then calls either bpt::crs::repository::import_targz() or bpt::crs::repository::import_dir().
  • Renamed bpt::crs::e_repo_importing_dir to bpt::crs::e_repo_importing_path and changed various occurences of the word dir to path.

The import algorithm for CRS packages is basically:

  • extract the archive to a temporary location ($repo/tmp/...)
  • do a "normal" import from that location

I experimented with a different approach for a bit, extracting just the pkg.json and storing the original archive in the repository. This has the downside (upside?) that packages containing arbitrary files can be stored in the repository. The current approach would discard any unsupported files during the import, because the archive is rebuilt from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant