WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Anyone interested in a perl script to maintain a local extension repository ?  (Read 5525 times)

Offline AlabamaPaul

  • Newbie
  • *
  • Posts: 34
I started using TC a few weeks ago, and think it's great.

In my environment, my machine(s) are on an isolated network without access to the internet or the TC Extension Repository.

I have a couple of servers that are connected to the isolated network, and have access to the internet, so I followed the wiki docs on creating a local repository on one of these servers.

Everything was working great, then I realized I needed a better way to keep my local repo in sync with the remote mirror, so I created a perl script that runs on the server that will keep the local modules in sync with the remote modules. In addition to keeping the extensions in sync, the script will also  build the local info.lst  required for App Browser, and an index.html file similar to http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/tcz_2x.html for human consumption.

I know I can use wget or something similar to mirror the repository, but I also have some local-only extensions that I do not want overwritten.

If anyone is interested, let me know and I will post it, or send it to you.

Paul


Offline DoRight

  • Newbie
  • *
  • Posts: 3
Yes I have exactly the same situation.  Would you please send me your script.
Thank you, Do

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
I always wanted to do that. Can you post the script or e-mail to me please
thank you so much. Where do I install the script?
How do I start the script?
t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline H-H-H

  • Newbie
  • *
  • Posts: 5
I realize this is a long shot but I would also be interested in this script :)
Linux is what you make it! And with Linux you can make it what you want :)

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
OK great I am still waiting
t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline chazzam

  • Newbie
  • *
  • Posts: 1
Here is the script I use for maintaining a local mirror. It isn't perl, and I believe it may require bash (untested on anything else at least). It also wasn't written with the idea of being run automatically, but it could probably be thrown in a cron job.

I don't mirror everything in my situation, just the packages my application needs. I create some packages locally, so it has some methodology of not trying to delete or download those local packages from the web. I only use tcz packages and the core.iso, so this is all this script handles currently.

Requires some manual adjustment of variables at the top of the script before using to set up directories, local packages, the web mirror to use etc.

tc-mirror-utils.sh
* with no parameters it just updates info.lst and tags.db (this happens with the other two modes of running too)
* with '-U' or '--update' it downloads the md5.txt of all packages in the local mirror from the web mirror, compares them, and if it gets a failure will redownload that package. (prompts before deleting the old package) This must be the first command line argument if you want this to work.
* also accepts a list of package names as a command line argument, it will try to download each package listed in this way from the web mirror.

You can pass new packages to download after the '-U' command to update. It will just fail and md5 check for the non-existant .md5.txt file, and then prompt to download the new package.

It also tries to do dependency resolution as well.
« Last Edit: January 11, 2013, 04:58:20 PM by chazzam »