Commit 9333a00a authored by Thayne Harbaugh's avatar Thayne Harbaugh

Add openSuSE

* Change package recognition so that it won't be confused by similarly
  named packages - namely the openSuSE "-32bit" packages.

* Add --pkg-dir option so that all config files can be redirected from the
  command line.

* Add cache_dir to the environment passed to the scripts so a command-line
  specified cache-dir can be used rather than always using
  '/var/cache/rinse'.
parent 21b9f44e
......@@ -40,6 +40,8 @@ rinse - RPM Installation Entity.
--clean-cache Clean our cache of .rpm files.
--config Specify a different configuration file.
(Default is /etc/rinse/rinse.conf)
--pkgs-dir Specify a different directory containing
<distribution>.packages files.
--list-distributions Show installable distributions.
--print-uris Only show the RPMs which should be downloaded.
default files in /usr/lib/rinse/$distro
......@@ -201,6 +203,7 @@ $CONFIG{ 'arch' } = 'i386';
$CONFIG{ 'cache' } = 1;
$CONFIG{ 'cache-dir' } = "/var/cache/rinse/";
$CONFIG{ 'config' } = "/etc/rinse/rinse.conf";
$CONFIG{ 'pkgs-dir' } = "/etc/rinse";
#
......@@ -391,7 +394,8 @@ sub parseCommandLineArguments
GetOptions(
# configuration options
"config=s", \$CONFIG{ 'config' },
"config=s", \$CONFIG{ 'config' },
"pkgs-dir=s", \$CONFIG{ 'pkgs-dir' },
# Main options
"directory=s", \$CONFIG{ 'directory' },
......@@ -516,7 +520,7 @@ sub listDistributions
#
# 2. A scripts directory. (Even if empty!)
#
foreach my $file ( glob("/etc/rinse/*.packages") )
foreach my $file ( glob("$CONFIG{'pkgs-dir'}/*.packages") )
{
#
......@@ -589,7 +593,7 @@ sub getDistributionPackageList
{
my ($distribution) = (@_);
my $file = "/etc/rinse/$distribution.packages";
my $file = "$CONFIG{'pkgs-dir'}/$distribution.packages";
my @additional;
my $adt_file = $CONFIG{ 'add-pkg-list' };
......@@ -809,10 +813,9 @@ sub downloadPackagesToDirectory
#
# Process each package we're supposed to fetch.
#
PACKAGE:
foreach my $package (@packages)
{
my $found = 0;
$CONFIG{ 'verbose' } && print "-Download $package\n";
#
......@@ -820,62 +823,90 @@ sub downloadPackagesToDirectory
#
foreach my $key ( keys %links )
{
# Matching a package to a key from the URL relies on packages
# being named in the defacto RPM way:
#
# If we have haven't found the package yet, and the name
# of the link is *longer* than the name of the package we're
# looking for.
# <name>-<version>-<release>.<arch>.rpm
#
# (ie. to cope with -$ver.$arch.$rpm).
#
if ( ( !$found ) &&
( length($key) > length($package) ) )
# Unfortunately the version and release are unknown (and can
# change) and therefore cannot be used to compare - they must
# be discarded. The string can be split on '-' to find the
# version and release. The name portion should exactly match
# the package and the remainder
# See if the key is long enough to be split and still have
# '-<version>-<release>.<arch>.rpm'
if ( length($key) <= length($package) )
{
next;
}
# get the substring of the link we've got
my $pre = substr( $key, 0, length($package) );
my $post = substr( $key, length($package), 2 );
my $name_part = substr($key, 0, length($package));
if ( ( lc($pre) eq lc($package) ) &&
$post =~ /-[0-9]/ )
{
$found += 1;
if ( $CONFIG{ 'print-uris' } )
{
print $mirror . "/" . $key . "\n";
}
else
{
#
# Print message and padding.
#
my $msg = "\r[$count:$total] Downloading: $key ..";
while ( length($msg) < ( $CONFIG{ 'width' } - 1 ) )
{
$msg .= " ";
}
print $msg;
# download - unless already present.
if ( !-e "$dir/$key" )
{
system("wget --quiet -O $dir/$key $mirror/$key");
}
}
}
# See if the name part compares
if ( $name_part ne $package )
{
next;
}
}
my $remainder_part = substr($key, length($package));
my @remainder_parts = split(/-/, $remainder_part);
if ( !$found )
{
print "[Harmless] Failed to find download link for $package\n";
}
# See if there are exactly three elements leftover and if they are
# a reasonable approximation of what is expected:
#
# '' The remainder part starts with '-'
# <version>
# <release>.<arch>.rpm
my $arch = $CONFIG{'arch'};
if ($CONFIG{'arch'} eq 'amd64')
{
$arch = 'x86_64';
}
$CONFIG{ 'verbose' } && print "+Download $package\n";
if ( $#remainder_parts != 2
|| $remainder_parts[0] ne ''
|| $remainder_parts[1] !~ /^[\d\w][\d\w.+]*$/
|| $remainder_parts[2] !~ /^[\d\w][\d\w.+]*\.$arch\.rpm$/
)
{
# Don't have enough parts or they don't look right
next;
}
# Match found!
if ( $CONFIG{ 'print-uris' } )
{
print $mirror . "/" . $key . "\n";
}
else
{
#
# Print message and padding.
#
my $msg = "\r[$count:$total] Downloading: $key ..";
while ( length($msg) < ( $CONFIG{ 'width' } - 1 ) )
{
$msg .= " ";
}
print $msg;
# download - unless already present.
if ( !-e "$dir/$key" )
{
system("wget --quiet -O $dir/$key $mirror/$key");
}
}
$CONFIG{ 'verbose' } && print "+Download $package\n";
next PACKAGE;
}
print "[Harmless] Failed to find download link for $package\n";
}
continue
{
$count += 1;
}
......@@ -970,13 +1001,13 @@ sub findMirrorContents
{
# i386/i486/i586/i686 packages when we're dealing with amd64 installs.
if ( ( $key =~ /\.i[3456]86\./ ) && !$i386 )
if ( ( $key =~ /\.i[3456]86\.rpm/ ) && !$i386 )
{
delete( $links{ $key } );
}
# amd64 packages when we're dealing with i386 installs.
if ( $key =~ /\.x86_64\./ && ($i386) )
if ( $key =~ /\.x86_64\.rpm/ && ($i386) )
{
delete( $links{ $key } );
}
......@@ -1139,6 +1170,7 @@ sub postInstallationCustomization
$ENV{ 'mirror' } = $CONFIG{ 'mirror' };
$ENV{ 'dist' } = $CONFIG{ 'distribution' };
$ENV{ 'directory' } = $CONFIG{ 'directory' };
$ENV{ 'cache_dir' } = $CONFIG{ 'cache-dir' };
#
......
#
# Packages which we'll need to download for a minimal installation
# OpenSuSE 10.1
#
aaa_base
audit-libs
bash
boost
bzip2
coreutils
cpio
cracklib
curl
cyrus-sasl
db
dbus-1
dbus-1-glib
device-mapper
diffutils
dirmngr
e2fsprogs
ethtool
expat
filesystem
fillup
findutils
gawk
gdbm
glib2
glibc
gpg2
grep
gzip
hal
info
insserv
krb5
libacl
libattr
libcom_err
libicu
libgcc
libgcrypt
libgpg-error
libidn
libksba
libnscd
libreiserfs
libstdc++
libusb
libxcrypt
libxml2
libxml2-python
libzio
libzypp
mingetty
module-init-tools
ncurses
neon
net-tools
openldap2-client
openslp
pam
pam-modules
parted
pciutils
pcre
perl
permissions
pinentry
pmtools
popt
procps
psmisc
pwdutils
python
python-elementtree
python-sqlite
python-urlgrabber
rpm
rpm-python
sed
setserial
sqlite
suse-release
sysvinit
termcap
udev
util-linux
yum
zlib
#
# Packages which we'll need to download for a minimal installation
# OpenSuSE 10.2
#
aaa_base
aaa_skel
audit-libs
bash
boost
bzip2
coreutils
cpio
cracklib
curl
cyrus-sasl
db
dbus-1
dbus-1-glib
device-mapper
diffutils
dirmngr
e2fsprogs
ethtool
expat
filesystem
fillup
findutils
gawk
gdbm
glib2
glibc
gpg
gpg2
grep
gzip
hal
info
insserv
keyutils-libs
krb5
libacl
libattr
libcom_err
libicu
libgcc41
libgcrypt
libgpg-error
libidn
libksba
libnscd
libreiserfs
libstdc++41
libusb
libvolume_id
libxcrypt
libxml2
libxml2-python
libzio
libzypp
logrotate
mingetty
mktemp
module-init-tools
ncurses
neon
net-tools
openldap2-client
openSUSE-release
openslp
pam
pam-config
pam-modules
parted
pciutils
pcre
perl
permissions
pinentry
pm-utils
pmtools
PolicyKit
popt
procps
psmisc
pwdutils
python
python-urlgrabber
rpm
rpm-python
sed
setserial
sqlite
strace
sysvinit
termcap
udev
util-linux
zlib
zypper
#
# Packages which we'll need to download for a minimal installation
# OpenSuSE 10.3
#
aaa_base
audit-libs
bash
boost
bzip2
ConsoleKit
coreutils
cpio
cracklib
cracklib-dict-small
cyrus-sasl
dbus-1
dbus-1-glib
device-mapper
diffutils
dirmngr
e2fsprogs
ethtool
expat
filesystem
fillup
findutils
gawk
gdbm
glib2
glib2-lang
glibc
gpg2
grep
gzip
hal
info
insserv
keyutils-libs
krb5
libacl
libattr
libbz2-1
libcom_err2
libcurl4
libdb-4_5
libexpat1
libicu
libgcc42
libgcrypt
libgpg-error
libidn
libksba
libnscd
libopenssl0_9_8
libreadline5
libreiserfs
libstdc++42
libusb
libuuid1
libvolume_id
libxcrypt
libxml2
libxml2-python
libzio
libzypp
mingetty
module-init-tools
ncurses
neon
net-tools
openldap2-client
openSUSE-release
openslp
pam
pam-config
pam-modules
parted
pciutils
pcre
perl-base
permissions
pinentry
pm-utils
pmtools
PolicyKit
popt
procps
psmisc
pth
pwdutils
python
python-urlgrabber
rpm
rpm-python
sed
setserial
sqlite
sysvinit
termcap
udev
util-linux
zlib
zypper
#
# Packages which we'll need to download for a minimal installation
# OpenSuSE 11.0
#
aaa_base
audit-libs
bash
bzip2
ConsoleKit
coreutils
coreutils-lang
cpio
cpio-lang
cracklib
cracklib-dict-small
cyrus-sasl
dbus-1
dbus-1-glib
device-mapper
diffutils
dirmngr
e2fsprogs
ethtool
expat
filesystem
fillup
findutils
gawk
gdbm
glib2
glib2-lang
glib2-branding-upstream
glibc
gpg2
gpg2-lang
grep
gzip
hal
info
insserv
keyutils-libs
krb5
libacl
libattr
libbz2-1
libcom_err2
libcurl4
libdb-4_5
libexpat1
libgcc43
libgcrypt11
libglib-2_0-0
libgobject-2_0-0
libgthread-2_0-0
libgpg-error0
libidn
libksba
libncurses5
libnscd
libopenssl0_9_8
libreadline5
libreiserfs
libstdc++43
libusb
libuuid1
libvolume_id
libxcrypt
libxml2
libxml2-python
libzio
libzypp
login
mingetty
module-init-tools
ncurses-utils
neon
net-tools
openldap2-client
openSUSE-release
openslp
pam
pam-config
pam-modules
parted
pciutils
pcre
perl-base
permissions
pinentry
pm-utils
pmtools
PolicyKit
popt
procps
psmisc
pth
pwdutils
python
python-urlgrabber
rpm
rpm-python
satsolver-tools
sed
setserial
sysvinit
termcap
terminfo-base
udev
util-linux
uuid-runtime
zlib
zypper
#
# Packages which we'll need to download for a minimal installation
# OpenSuSE 11.1
#
aaa_base
audit-libs
bash
boost-license
bzip2
ConsoleKit
coreutils
coreutils-lang
cpio
cpio-lang
cracklib
cracklib-dict-small
cyrus-sasl
dbus-1
dbus-1-glib
device-mapper
diffutils
dirmngr
e2fsprogs
ethtool
expat
filesystem
fillup
findutils
gawk
gdbm
glib2
glib2-lang
glib2-branding-upstream
glibc
gpg2
gpg2-lang
grep
gzip
hal
info
insserv
keyutils-libs
krb5
libacl
libattr
libboost_signals1_36_0
libbz2-1
libcom_err2
libcurl4
libdb-4_5
libexpat1
libgcc43
libgcrypt11
libglib-2_0-0
libgobject-2_0-0
libgthread-2_0-0
libgpg-error0
libidn
libksba
libldap-2_4-2
libncurses5
libnscd
libopenssl0_9_8
libreadline5
libreiserfs
libselinux1
libsepol1
libsmbios2
libstdc++43
libusb-0_1-4
libuuid1
libvolume_id1
libxcrypt
libxml2
libxml2-python
libzio
libzypp
login
mingetty
module-init-tools
ncurses-utils
neon
net-tools
openSUSE-release
openSUSE-release-ftp
openslp
pam
pam-config
pam-modules
parted
pciutils
pcre
perl-base
permissions
pinentry
pm-utils
pmtools
PolicyKit
popt
procps
psmisc
pth
pwdutils
python
python-urlgrabber
rpm
rpm-python
satsolver-tools
sed
setserial
sysvinit
termcap
terminfo-base
udev
util-linux
uuid-runtime
zlib
zypper
......@@ -55,3 +55,28 @@ mirror.amd64 = http://mirror.bytemark.co.uk/fedora/linux/releases/9/Fedora/x86_6
mirror = http://mirrors.vexs.net/pub/fedora/linux/releases/10/Fedora/i386/os/Packages/
mirror.amd64 = http://mirrors.vexs.net/pub/fedora/linux/releases/10/Fedora/x86_64/os/Packages/
[opensuse-10.1]
mirror = http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/SL-10.1/inst-source/suse/i686/
mirror.amd64 = http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/SL-10.1/inst-source/suse/x86_64/
[opensuse-10.2]
mirror = http://download.opensuse.org/distribution/10.2/repo/oss/suse/i686/
mirror.amd64 = http://download.opensuse.org/distribution/10.2/repo/oss/suse/x86_64/
[opensuse-10.3]
mirror = http://download.opensuse.org/distribution/10.3/repo/oss/suse/i686/
mirror.amd64 = http://download.opensuse.org/distribution/10.3/repo/oss/suse/x86_64/
[opensuse-11.0]
mirror = http://download.opensuse.org/distribution/11.0/repo/oss/suse/i686/
mirror.amd64 = http://download.opensuse.org/distribution/11.0/repo/oss/suse/x86_64/
[opensuse-11.1]
mirror = http://download.opensuse.org/distribution/11.1/repo/oss/suse/i686/
mirror.amd64 = http://download.opensuse.org/distribution/11.1/repo/oss/suse/x86_64/