Permalink
Browse files

Updates

  • Loading branch information...
1 parent 88ef56f commit dfe4c21709aaa160b3ab2ebf4a351b613ecf2c11 @dagwieers committed Oct 19, 2007
Showing with 427 additions and 15 deletions.
  1. +2 −1 ChangeLog
  2. +2 −1 Makefile
  3. +4 −2 config/dists/nld9.conf
  4. +43 −0 docs/you-support.txt
  5. +51 −3 mrepo
  6. +9 −8 rhnget
  7. +316 −0 youget
View
@@ -1,4 +1,4 @@
-* 0.8.4svn - ... - released 30/12/2006
+* 0.8.4svn - ... - released 19/10/2007
- Fixed a few typos (Ian Forde)
- Added promoteepoch directive to disable it for older distributions (rhel2.1, rh7.3)
- Fixed a problem with the disabled directive (disabled = no was ignored)
@@ -19,6 +19,7 @@
- Get rid of variables named 'list' that override python's list() builtin (Alexander Bergolth)
- Synchronize symlinks instead of deleting and recreating them (Alexander Bergolth)
- Added unit tests (Alexander Bergolth)
+- Added youget tool to download packages from Yast Online Update
* 0.8.4 - Sint-Jacobsplein - released 13/12/2006
- Renamed Yam to mrepo (Matthew Hannigan)
View
@@ -23,8 +23,9 @@ all:
install:
install -Dp -m0755 gensystemid $(DESTDIR)$(bindir)/gensystemid
- install -Dp -m0755 rhnget $(DESTDIR)$(bindir)/rhnget
install -Dp -m0755 mrepo $(DESTDIR)$(bindir)/mrepo
+ install -Dp -m0755 rhnget $(DESTDIR)$(bindir)/rhnget
+ install -Dp -m0755 youget $(DESTDIR)$(bindir)/youget
[ ! -f $(DESTDIR)$(sysconfdir)/mrepo.conf ] && install -D -m0600 config/mrepo.conf $(DESTDIR)$(sysconfdir)/mrepo.conf || :
install -d -m0755 $(DESTDIR)$(sysconfdir)/mrepo.conf.d/
install -Dp -m0644 config/httpd/mrepo.conf $(DESTDIR)$(httpddir)/mrepo.conf
View
@@ -7,10 +7,12 @@
[nld9]
name = Novell Linux Desktop $release SP3 ($arch)
release = 9
-arch = i386 x86_64
+arch = i386
### ISO images
iso = NLD$release-SP3-$arch-CD?.iso
### Additional repositories
-you = file:///var/yast2/you/
+updates = you://update.novell.com/data/$RCE/nld9/getPackage/nld-9-i586/
+extras = you://update.novell.com/data/$RCE/nld9-extras/getPackage/nld-9-i586/
+sdk = you://update.novell.com/data/$RCE/nld9-sdk/getPackage/nld-9-i586/
View
@@ -0,0 +1,43 @@
+= Using YOU (Yast Online Update) support in mrepo
+Dag Wieers <dag@wieers.com>
+0.8.4svn, 19 october 2007
+
+// Please send me improvements to this document.
+
+This document describes how to set up a Yast Online Update mirror for
+various Novell/SUSE distributions and architectures.
+
+== Requirements
+The youget python script needs cElementTree support.
+
+
+== Novell update credentials
+To be able to download updates from update.novell.com (or another YOU server)
+you need to copy the files _/etc/ximian/mcookie_ and _/etc/ximian/partnernet_
+from a registered/activated system to your +$srcdir/$dist-$arch/+ directory.
+
+So for NLD9, you would have eg:
+
+ /var/mrepo/nld9-i586/mcookie
+ /var/mrepo/nld9-i586/partnernet
+
+These are used by youget to authenticate with the YOU server.
+
+
+== YOU configuration
+Having done that, you can enable multiple channels for these credentials by
+adding a configuration like the one below:
+
+----
+[nld9]
+name = Novell Linux Desktop $release SP3 ($arch)
+release = 9
+arch = i386
+iso = NLD$release-SP3-$arch-CD?.iso
+updates = you://update.novell.com/data/$RCE/nld9/getPackage/nld-9-i586/
+extras = you://update.novell.com/data/$RCE/nld9-extras/getPackage/nld-9-i586/
+sdk = you://update.novell.com/data/$RCE/nld9-sdk/getPackage/nld-9-i586/
+----
+
+After that, mrepo should be able to successfully log on and download
+all packages for the configured channels.
View
54 mrepo
@@ -28,12 +28,13 @@ archs = {
'alpha': ('alpha', 'alphaev5', 'alphaev56', 'alphaev6', 'alphaev67'),
'i386': ('i386', 'i486', 'i586', 'i686', 'athlon'),
'ia64': ('i386', 'i686', 'ia64'),
+ 'ppc': ('ppc', ),
'ppc64': ('ppc', 'ppc64', 'ppc64pseries', 'ppc64iseries'),
'x86_64': ('i386', 'i486', 'i586', 'i686', 'athlon', 'x86_64', 'amd64', 'ia32e'),
'sparc64': ('sparc', 'sparcv8', 'sparcv9', 'sparc64'),
'sparc64v': ('sparc', 'sparcv8', 'sparcv9', 'sparcv9v', 'sparc64', 'sparc64v'),
's390': ('s390', ),
- 's390x': ('s390', 's390x', ),
+ 's390x': ('s390', 's390x'),
}
variables = {}
@@ -42,7 +43,7 @@ enable = ('yes', 'on', 'true', '1')
disable = ('no', 'off', 'false', '0')
### Register rhn and rhns as a known schemes
-for scheme in ('rhn', 'rhns'):
+for scheme in ('rhn', 'rhns', 'you'):
urlparse.uses_netloc.insert(0, scheme)
urlparse.uses_query.insert(0, scheme)
@@ -109,7 +110,7 @@ class Options:
self.update = True
if not self.types:
- self.types = ['file', 'fish', 'ftp', 'http', 'https', 'mc', 'rhn', 'rhns', 'rsync', 'sftp', 'mrepo']
+ self.types = ['file', 'fish', 'ftp', 'http', 'https', 'mc', 'rhn', 'rhns', 'rsync', 'sftp', 'mrepo', 'you']
for arg in args:
self.dists = self.dists + arg.split(',')
@@ -197,6 +198,7 @@ class Config:
self.cmd['rhnget'] = self.getoption('main', 'rhngetcmd', '/usr/bin/rhnget')
self.cmd['rsync'] = self.getoption('main', 'rsynccmd', '/usr/bin/rsync')
self.cmd['umount'] = self.getoption('main', 'umountcmd', '/bin/umount')
+ self.cmd['youget'] = self.getoption('main', 'yougetcmd', '/usr/bin/youget')
self.cmd['yumarch'] = self.getoption('main', 'yumarchcmd', '/usr/bin/yum-arch')
self.createrepooptions = self.getoption('main', 'createrepo-options', '-p')
@@ -623,6 +625,8 @@ class Repo:
mirrormirrordir(url, self.srcdir)
elif s in ('rhn', 'rhns'):
mirrorrhnget(url, self.srcdir, self.dist)
+ elif s in ('you', ):
+ mirroryouget(url, self.srcdir, self.dist)
else:
error(2, 'Scheme %s:// not implemented yet (in %s)' % (s, url))
except mrepoMirrorException, e:
@@ -1310,6 +1314,50 @@ def mirrorrhnget(url, path, dist):
if ret:
raise(mrepoMirrorException('Failed with return code: %s' % ret))
+def mirroryouget(url, path, dist):
+ "Mirror everything from a you:// URL"
+ if not cf.cmd['youget']:
+ error(1, 'youget was not found. YOU support is therefor disabled.')
+ return
+ mkdir(path)
+
+ url = url.replace('you://', 'https://')
+
+ opts = cf.rhngetoptions
+ if op.verbose >= 3:
+ opts = opts + ' -v' * (op.verbose - 3)
+ if op.dryrun:
+ opts = opts + ' --dry-run'
+ if cf.rhngetcleanup:
+ opts = opts + ' --delete'
+ if cf.rhngetdownloadall:
+ opts = opts + ' --download-all'
+
+ credpath = os.path.join(cf.srcdir, dist.nick)
+ if os.path.isdir(credpath):
+ opts = opts + ' --credpath="%s"' % credpath
+
+# if dist.rhnrelease:
+# opts = opts + ' --release="%s"' % dist.rhnrelease
+
+# if cf.rhnlogin:
+# rhnlogin = cf.rhnlogin.split(':')
+# if len(rhnlogin) > 0:
+# opts = opts + ' --username="%s"' % rhnlogin[0]
+# if len(rhnlogin) > 1:
+# opts = opts + ' --password="%s"' % rhnlogin[1]
+
+## opts = opts + ' -I \"*.rpm\"'
+# opts = opts + ' -G \"headers\" -G \"repodata\"'
+# if cf.mirrordirexclsrpm:
+# opts = opts + ' -G \"*.src.rpm\" -G \"SRPMS\"'
+# if cf.mirrordirexcldebug:
+# opts = opts + ' -G \"*-debuginfo-*.rpm\" -G \"debug\"'
+
+ ret = run("%s %s '%s' '%s'" % (cf.cmd['youget'], opts, url, path), dryrun=True)
+ if ret:
+ raise(mrepoMirrorException('Failed with return code: %s' % ret))
+
def hardlink(srcdir):
info(1, 'Hardlinking duplicate packages in %s.' % srcdir)
opts = ''
View
17 rhnget
@@ -413,6 +413,7 @@ def mirrorrhn(url, path):
for pkg in package_list:
### FIXME: Check if not already on ISO-file or repository as well
filename = '%s-%s-%s.%s.rpm' % (pkg[0], pkg[1], pkg[2], pkg[4])
+ filesize = pkg[5]
### Filter packagelist
if op.filter and not fnmatch.fnmatch(filename, op.filter):
@@ -427,11 +428,11 @@ def mirrorrhn(url, path):
### If file (or symlink target) exists
if os.path.isfile(os.path.join(path, filename)):
stat = os.stat(os.path.join(path, filename))
- if stat.st_size == int(pkg[5]):
+ if stat.st_size == int(filesize):
info(3, 'File %s is already in %s' % (filename, path))
continue
else:
- info(2, 'File %s has wrong size (found: %s, expected: %s), refetching.' % (filename, stat.st_size, pkg[5]))
+ info(2, 'File %s has wrong size (found: %s, expected: %s), refetching.' % (filename, stat.st_size, filesize))
remove(os.path.join(path, filename))
### If symlink target does not exist, remove symlink
@@ -477,22 +478,22 @@ def mirrorrhn(url, path):
for file in glob.glob(os.path.join(path, '*.rpm')):
if os.path.exists(file):
filename = os.path.basename(file)
- size = os.stat(file).st_size
- receiver.add( (filename, size) )
+ filesize = os.stat(file).st_size
+ receiver.add( (filename, filesize) )
receiver.sort()
### Collect sender side
sender = Set()
for pkg in package_list:
filename = '%s-%s-%s.%s.rpm' % (pkg[0], pkg[1], pkg[2], pkg[4])
- size = int(pkg[5])
- sender.add( (filename, size) )
+ filesize = int(pkg[5])
+ sender.add( (filename, filesize) )
sender.sort()
### Remove difference between receiver and sender
cleanse = receiver.difference(sender)
- for filename, size in cleanse.list:
- info(3, 'Cleaning up obsolete file %s (%d kiB)' % (filename, size))
+ for filename, filesize in cleanse.list:
+ info(3, 'Cleaning up obsolete file %s (%d kiB)' % (filename, filesize))
remove(os.path.join(path, filename))
def main():
Oops, something went wrong.

0 comments on commit dfe4c21

Please sign in to comment.