Tiny Core Extensions > TCE Tips & Tricks

[Solved] secondary repository? script to create repository metadata?

(1/5) > >>

GNUser:
I have some custom extensions that I'd like to add to my local TCL repository so that multiple machines can have access to them. 

Back in my days of being a Devuan user, I'd create a small local repository containing only the custom packages, then would append a line to /etc/apt/sources.list. Would a similar strategy work in TCL? Alas, additional lines in /opt/tcemirror seem to have no effect (i.e., only the first line is parsed).

Also, if custom extensions were added to a local repository mirror or to local secondary repository, either way it would be burdensome to manually update/create all the repository metadata files:

--- Code: ---info.lst
info.lst.gz
md5.db.gz
provides.db
provides.db.gz
provides.db.zsync
sizelist
sizelist.gz
tags.db.gz

--- End code ---

So I'd like to ask two quick questions to my TCL friends, please:

1. Is there some way for  tce-load  to look in two different repositories (e.g., official repo and secondary local repo)?

2. Is there a script that parses  .tcz*  files in a directory and automatically creates/updates the repository metadata files listed above?

Sashank999:
1) I think you can edit the mirrors.tcz extension's files to add your repository
Then tce-load the edited mirror.tcz and then select your mirror from the Apps Program.
2)I think we can create a script for that but I don't have enough knowledge about that.
Maybe this works :

--- Code: ---#!/bin/bash
package=$1
gunzip info.lst.gz
echo "$package.info" >> info.lst
sort info.lst
gzip info.lst
md5sum $package >>  md5.db.gz
sort md5.db.gz

--- End code ---
I don't know how the other files are structured  :P

Rich:
Hi GNUser

--- Quote from: GNUser on June 22, 2020, 04:01:39 PM --- ... 1. Is there some way for  tce-load  to look in two different repositories (e.g., official repo and secondary local repo)? ...
--- End quote ---
It's clumsy, but you could script it. Create a script called  tce-load  in  ~/.local/bin.  Have that script call  /usr/bin/tce-load  twice
changing the contents of  /opt/tcemirror  in between calls. Since  ~/.local/bin  precedes  /usr/bin  in $PATH  running  tce-load
will default to your script.

A better way might be to do it from your local server. For instance, when  tce-load  requests  info.lst  from your server:
1. wget TinycoreRepo/Version/Arch/tcz/info.lst -O RemoteInfo.lst
2. cat RemoteInfo.lst LocalInfo.lst | sort > info.lst
3. Return the combined sorted info files to  tce-load.

When  tce-load  requests an extension:
1. grep extension.tcz LocalInfo.lst
2. If not found, fetch it from the Tinycore repo.

Greg Erskine:
This might seem obvious but it took a while for the penny to drop for me. The tce* tools work great but they assume the repositories are really up-to-date mirrors of each other, hence the term "mirror" everywhere. duh.

If not, if you have an "modified" extension in your private repository with the same name as one in the official repository /opt/tcemirror has to be set correctly if you do an update for example. Once an extension is downloaded there is no indication from where it originally came from. I think it would be nice if the extension information file had the download URL in it.

So generally if /opt/tcemirror is pointing to the official repository and your try to use tce* info, search tools etc on a private repository extension you may get nothing or if it is a duplicate name you will get info about the wrong version of the extension. This situation is OK for the developers but confusing for users.

A couple of suggestions:

1. Warn the user if the "default" repository is not set in /opt/tcemirror
2. During a boot, reset /opt/tcemirror. It is probably also stored in mydata as well.
3. Add a prefix to the name of extensions in the private repository if possible.

There are scripts to generate the extra information in repositories.

curaga:
Only one repo supported right now, yes. The server scripts aren't public currently.

Navigation

[0] Message Index

[#] Next page

Go to full version