[wpkg-users] generating Package download entries automatically

Andre Ilie ai at photonic-sense.com
Tue May 2 12:46:13 CEST 2006


	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.

# generate WPKG xml code for downloading files

for packname in *; do
     echo "Package: $packname"
     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>"
     cd -
     echo -n "Show next entry? <Enter>=Yes <Ctrl>+<c>=No "
     read bla

	Hope its useful for someone. :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ai.vcf
Type: text/x-vcard
Size: 377 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20060502/ce75d1b1/attachment-0001.vcf>

More information about the wpkg-users mailing list