I'm looking for hints and criticism for a package installation script. I do a full install, and then install a set of packages. To get the list of packages to install on another machine, I just grabbed a directory listing from /var/db/pkg, put them in my script, and then run that script on a fresh machine. Questions: 1. Packages get installed in a sub-optimal order. Quite often one package on the list will have already been installed as a dependency. I think my script downloads the redundant package before deciding that it was already installed. Good ways to stop that? 2. Any way to wild-card the package version numbers? I'd like to be able to get the most recent version.
Here is the script: #!/bin/sh # Please change this to a local mirror GETME="ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/i386/" packages=$(cat << EOF ORBit2-2.12.2 atk-1.10.1 bzip2-1.0.3 cdparanoia-3.a9.8 control-center2-2.10.1 desktop-file-utils-0.10p0 docbook-4.2p1 docbook-dsssl-1.72 eel-2.10.1 epiphany-1.4.8 esound-0.2.34 gail-1.8.4 gconf2-2.10.0 gettext-0.10.40p3 glib2-2.6.4 gnome-applets2-2.10.1p0 gnome-desktop-2.10.1 gnome-icon-theme-2.10.1 gnome-keyring-0.4.2 gnome-menus-2.10.1 gnome-mime-data-2.4.2 gnome-panel-2.10.1p0 gnome-session-2.10.0 gnome-terminal-2.10.0 gnome-themes-2.10.1 gnome-utils-2.10.1p0 gnome-vfs2-2.10.1 gstreamer-0.8.10 gstreamer-plugins-0.8.8p0 gtk+2-2.6.9 gtk-engines2-2.6.3p0 hicolor-icon-theme-0.5 iso8879-1986 jpeg-6bp2 libIDL-0.8.5 libart-2.3.17 libaudiofile-0.2.6 libbonobo-2.8.1 libbonoboui-2.8.1 libgcrypt-1.2.0 libglade2-2.5.1 libgnome-2.10.0 libgnomecanvas-2.10.1 libgnomeprint-2.10.3 libgnomeprintui-2.10.2 libgnomeui-2.10.0 libgpg-error-0.7 libgsf-1.11.1p0 libgtkhtml-2.6.3 libgtop2-2.10.1 libiconv-1.9.2p1 librsvg-2.9.5p1 libwnck-2.10.0 libxklavier-2.0 libxml-2.6.16p5 libxslt-1.1.12p1 metacity-2.10.1 mozilla-1.7.8-gtk2 nautilus-2.10.1 pango-1.8.1 png-1.2.8 popt-1.7 scrollkeeper-0.3.14 shared-mime-info-0.15 startup-notification-0.8 tiff-3.7.3 vte-0.11.12 xscreensaver-4.21-no_gle yelp-2.6.5 EOF) #packages=`ls /var/db/pkg` for i in $packages; do full=$GETME$i.tgz; pkg_add -v $full; done -- Will Backman - Network Administrator Coastal Enterprises, Inc. http://www.ceimaine.org

