Tiny Core Extensions > TCE Tips & Tricks

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

<< < (3/5) > >>

Sashank999:
According to google, a .zsync file is used by a zsync program which is a partial/differential downloader.
If the local PC already has a provides.db.gz then zsync (in GUI Apps) compares it with the repo one and then downloads only new and modified parts of the repo's provides.db.gz and then appends those modified parts into the PC's provides.db.gz in the blocks's locations.
I think this is done to save the internet data of the User and also to save time instead of downloading whole provides.db.gz again.

GNUser:

--- Quote from: Rich on June 23, 2020, 12:28:27 AM ---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.

--- End quote ---
Thank you for this, Rich. It's probably the simplest solution. Here's a wrapper script that calls  /usr/bin/tce-load  a second time (using custom repo) only if the first call (using official repo) exits with an error:


--- Code: ---#!/bin/sh

# user variables:
custom_repo="http://tiny-is-better.com/tinycorelinux-custom/"
main_repo="http://repo.tinycorelinux.net/"

echo "$main_repo" >/opt/tcemirror
if /usr/bin/tce-load "$@"; then
exit 0
else
echo "Trying custom repo now..."
echo "$custom_repo" >/opt/tcemirror
/usr/bin/tce-load "$@"
fi
--- End code ---

GNUser:
Wow, the information in Reply #9 is really handy. Thank you, Rich.

This thread can be marked as solved. Reply #11 (based on Rich's idea) solves first question in OP. Reply #8 makes it trivial to solve second question in OP.

Rich:
Hi GNUser

--- Quote from: GNUser on June 23, 2020, 08:53:52 AM --- ... This thread can be marked as solved. ...
--- End quote ---
Done. :)

andyj:
If you ever do want to create these files, my quick look came up with this:

info.lst.gz - a simple list of files

--- Code: ---ls -1 *.tcz | sort -f | gzip > info.lst.gz
--- End code ---

md5.db.gz - all the md5sums
--- Code: ---cat *.tcz.md5.txt | sort -f -k2 | gzip > md5.db.gz
--- End code ---

tags.db.gz - all the tags from the info files
--- Code: ---grep "^Tags:" *.tcz.info | sed -E 's/\.info:Tags:[[:space:]]+/\t/' | sort -f -k2 | gzip > tags.db.gz
--- End code ---
might need more than one tab?

sizelist.gz - all the sizes of the .tcz files in bytes
--- Code: ---ls --full-time *.tcz | awk '{print $9 " " $5}' | sort -f | gzip > sizelist.gz
--- End code ---

provides.db.gz - all the files in each .tcz
--- Code: ---for a in $(ls -1 *.tcz| sort -f); do echo $a >> provides.db; cat $a.list >> provides.db; echo >> provides.db; done; gzip provides.db
--- End code ---

Since I don't have access to the secret ones, these are a clean-room implementation which you are free to use  8)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version