PDA

View Full Version : Linux : Scripting Help Please - Daz / Garp?


Desmo
03-02-2010, 20:23
Hi guys, got something that I'd like scripted it possible but not idea where to start.

It's for making iPhone packages to go into a repo. I'd like to be able to run the script from the main folder all files are in, and if that folder moves, the script still works.

1. Run terminal command "dpkg -b" on all folders contained within /apps
2. Move all /apps/*.deb files created to /upload/deb
3. Run terminal command "dpkg-scanpackages -m . /dev/null >Packages" within /upload
4. Create bz2 archive of Packages file in /upload
5. ftp /deb & Pakcages & Packages.bz2 to webspace.

I've tried to create some launchers to do this. No.1 works ok but I can't get a launcher for No.3 to work. If I could script the whole lot it would be so much quicker :)

Even if you can just sort it roughly and I can fill in the proper directories, that would be great :)

Mark
03-02-2010, 21:15
First four, might be bugs...

find /apps -type d -exec /bin/bash -c 'cd {}; dpkg -b' \;
find /apps -type f -name \*.deb -exec mv -f {} /upload/deb \;
cd /upload
dpkg-scanpackages -m . /dev/null | bzip2 >Packages.bz2

Desmo
04-02-2010, 11:40
Cheers Mark, it gives me a base to start from :)