On Tue, 2007-09-25 at 14:15 +0000, Hans van der Merwe wrote:
On Tue, 2007-09-25 at 15:40 +0200, Sylvester Lykkehus wrote:
It's ugly, but it works for now: /smart-update is exported as NFS on the local machine, and mounted on /smart-update on the remote User has access to smart with NOPASSWD in sudoer's on both.
#!/bin/bash DUMP_L="/smart-update/updates_local.txt" DUMP_R="/smart-update/updates_remote.txt" PKGDIR="/smart-update/packages" # Get local list sudo smart upgrade --update --dump 2> $DUMP_L # Get remote list ssh 10.0.0.2 sudo smart upgrade --update --dump 2> $DUMP_R # Download packages smart download --target=$PKGDIR $(tr '\n' ' ' < $DUMP_L) $(tr '\n' ' ' < $DUMP_R) # Upgrade local packages cd $PKGDIR;sudo smart install -y $(tr '@' '.' < $DUMP_L | xargs -i echo {}.rpm | tr '\n' ' ') # Upgrade remote packages ssh 10.0.0.2 "cd $PKGDIR;sudo smart install -y $(tr '@' '.' < $DUMP_R | xargs -i echo {}.rpm | tr '\n' ' ')"
Not very glamorous, but it does what I want it to do. And I know the text processing of package names is not optimal, feel free to post better ways to do it :)
I know you can add a local path (shared NFS path) as a channel in Smart. Maybe that can help you simplify things?
Hans
Scratch that, try this instead (havent done this myself yet):
Do the following on all the machines:
1. execute> sudo smart config --set remove-packages=false (this will
keep the downloaded packages in /var/lib/smart/packages)
2. have all the machines point to one /var/lib/smart/packages share
(NFS, SMB etc)
Now update the machines one after the other - because the next PC will
see the already downloaded packages in the
shared /var/lib/smart/packages dir it will not download it again.
Downside is that