On Thu, 26 Mar 2015, L.R. D.S. wrote: > Is really boring write the package repository everytime we install. > Why not set the repository using the Time Zone as a reference? > For example, if you set Japan as your zone, then run > export PKG_PATH=http://www.ftp.ne.jp/OpenBSD/'uname -r'/packages/'uname -m'/
#!/usr/bin/perl -w use strict; chomp( my( $uname_r, $uname_m ) = ( `uname -r`, `uname -m` ) ); chomp( my $zone = join( '/', ( split('/', `ls -l /etc/localtime`) )[-2,-1] ) ); my %mirror = ( "Canada/Mountain" => "ftp://ftp.openbsd.org/pub/OpenBSD", # okay, I'm bored now... hopefully "L.R. D.S." will help ); print "$mirror{$zone}/$uname_r/packages/$uname_m/";