TSI Package Repository
TSI uses a local package repository to store package definitions. The repository is located at ~/.tsi/packages/ by default.
Repository Structure
~/.tsi/packages/
├── pkg-config.json
├── zlib.json
├── openssl.json
├── cmake.json
├── curl.json
└── ... (other package definitions)
Each package is defined as a JSON file. The filename should match the package name (e.g., pkg-config.json for the pkg-config package).
Updating the Repository
Default Update
Update from the official TSI repository:
This will:
1. Clone or update the TSI repository from GitHub
2. Copy all .json files from the packages/ directory
3. Update your local repository at ~/.tsi/packages/
Custom Repository
Update from a custom Git repository:
The repository should have a packages/ directory containing JSON package definitions.
Local Directory
Update from a local directory (useful for development):
This will copy all .json files from the specified directory to your repository.
Custom Prefix
Update repository for a custom TSI installation:
Repository Sources
Official Repository
The default repository is:
- URL: https://github.com/PanterSoft/tsi.git
- Location: packages/ directory
- Packages: Essential packages (pkg-config, zlib, openssl, cmake, curl, etc.)
Custom Repositories
You can create your own package repository:
- Create a Git repository
- Add a
packages/directory - Add JSON package definitions
- Update TSI:
tsi update --repo <your-repo-url>
Package Discovery
After updating, TSI will automatically discover all packages in the repository:
# List all available packages (from repository)
ls ~/.tsi/packages/*.json
# Get info about a package
tsi info pkg-config
# Install a package
tsi install pkg-config
Repository Caching
TSI caches the repository clone in ~/.tsi/tmp-repo-update/ to speed up subsequent updates. The cache is automatically updated on each tsi update run.
Manual Repository Management
You can also manually manage the repository:
# Add a package manually
cp my-package.json ~/.tsi/packages/
# Remove a package
rm ~/.tsi/packages/package-name.json
# Edit a package
vim ~/.tsi/packages/package-name.json
Best Practices
- Regular Updates: Run
tsi updateregularly to get new packages and updates - Version Control: Keep your custom packages in a Git repository
- Backup: Backup
~/.tsi/packages/if you have custom packages - Testing: Use
--localfor testing package definitions before committing
Troubleshooting
Update Fails
Problem: tsi update fails with "Failed to clone/update repository"
Solutions:
- Check internet connection
- Ensure git is installed
- Try updating manually: git clone https://github.com/PanterSoft/tsi.git ~/.tsi/tmp-repo-update
No Packages Found
Problem: Update succeeds but no packages are available
Solutions:
- Check if packages/ directory exists in the repository
- Verify JSON files are valid: cat ~/.tsi/packages/*.json | jq .
- Try updating from local: tsi update --local /path/to/packages
Custom Repository Not Working
Problem: Custom repository update fails
Solutions:
- Ensure repository is publicly accessible (or use SSH for private repos)
- Verify packages/ directory exists
- Check repository URL is correct