I have long dealt with this problem: I have a local mirror of TCL's official repository, which includes some custom extensions. Every time I sync my local mirror with upstream, my custom extensions are wiped away. My local metadata files (which contain information about my custom extensions) are also wiped away.
One solution would be to create two local repositories (one a TCL mirror with only official extensions, and a second one containing only custom extensions). The problem with this is that I'd have to change /opt/tcemirror back and forth on all my TCL boxes, depending on whether I want to install/upgrade official extensions or custom ones. I do not like this solution.
[An aside: Unfortunately, in TCL there is no ability to use multiple repositories concurrently à la /etc/apt/sources.list.d/ in Debian. This is in keeping with TCL's minimalism and I totally respect that.]
So, after mulling over this problem for several days, I came up with a solution.
My http server still has its usual tinycorelinux/14.x/x86_64/tcz directory. But now it also has a tinycorelinux/14.x/x86_64/tcz-extra directory (for custom extensions) and a script in my PATH called
add-tcz-extra.
Now, after I sync my tcz directory with upstream, all I have to do is run
add-tcz-extra on my http server. The script copies over all the *tcz* files from tcz-extra directory to tcz directory, then adds the metadata of my custom extensions back into the metadata files in the tcz directory. This allows my local mirror to stay in sync with upstream, without losing my custom extensions
I will attach the script here in case it is useful to anyone.