logo       

generating Package download entries automatically: msg#00011

package-management.wpkg.user

Subject: generating Package download entries automatically

Hi

I've made some shell scripts for our samba server to automatically generate the package download entries for our environment which is configured like this:

1. [wpkg] samba share pointing to /usr/wpkg, where wpkg.js is located.
2. pkg directory in [wpkg] share where every package gets its own directory. e.g. Acrobat Reader is in [wpkg]\pkg\acrobat
3. Soft linked /usr/wpkg/pkg to Apaches DocumentRoot/pkg, so you can get packages like this: http://apache/pkg/acrobat/[filename.ext]
4. Made an Unix shell script called md5gen.sh which can be called in /usr/wpkg/pkg. This will output XML for use in packages.xml for every package in this directory. It will do some kind of paging with the output so you can cut&paste it into the right place in the packages.xml file. Further automation can be done by automatically generating the whole packages.xml (maybe by having standard install.js scripts in every package or thelike to allow standard <install> cmds). The urlprefix variable in md5gen.sh should point to your URL prefix for the package download urls.

--[md5gen.sh]-----------8<-----------------------------------------------
#!/bin/sh
# generate WPKG xml code for downloading files

urlprefix="http://www.mikisoft.com/pkg";
for packname in *; do
echo "Package: $packname"
echo
cd $packname
for i in * ; do
sum=`md5 -q "$i"`
echo "<file name=\"$i\" timeout=\"600\" md5=\"$sum\">"
echo " <source url=\"$urlprefix/$packname/$i\" />"
echo "</file>"
done
cd -
echo -n "Show next entry? <Enter>=Yes <Ctrl>+<c>=No "
echo
read bla
done
------------------------------------------------->8---------------------

Hope its useful for someone. :)

Greets,
Andre

Attachment: ai.vcf
Description: Vcard

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise