Skip to content

Commit

Permalink
Changes to rhnget and mrepo to reflect rhn/up2date_client changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Aug 15, 2008
1 parent cb3ab3b commit 3773f52
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 25 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Expand Up @@ -24,7 +24,9 @@
- Fix elementtree for python 2.5 and higher (Leo Eraly)
- Added hardlinkpy support
- Added X-Mailer header to emails send
- Added unionfs patches for merged os repository
- Imported rhn and up2date_client libraries from the RHEL4 up2date package
- Made fuseiso the default way of mounting (if fuseiso and fuse are found)

* 0.8.4 - Sint-Jacobsplein - released 13/12/2006
- Renamed Yam to mrepo (Matthew Hannigan)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -40,8 +40,8 @@ install:

install -d -m0755 $(DESTDIR)$(datadir)/mrepo/rhn/
install -d -m0755 $(DESTDIR)$(datadir)/mrepo/up2date_client/repoBackends/
cp -av rhn/*.py $(DESTDIR)$(datadir)/mrepo/rhn/
cp -av up2date_client/*.py $(DESTDIR)$(datadir)/mrepo/up2date_client/
cp -av rhn/README rhn/*.py $(DESTDIR)$(datadir)/mrepo/rhn/
cp -av up2date_client/README up2date_client/*.py $(DESTDIR)$(datadir)/mrepo/up2date_client/
cp -av up2date_client/repoBackends/*.py $(DESTDIR)$(datadir)/mrepo/up2date_client/repoBackends/

[ "$(DESTDIR)" -o ! -f "$(DESTDIR)$(sysconfdir)/cron.d/mrepo" ] && install -Dp -m0644 config/mrepo.cron $(DESTDIR)$(sysconfdir)/cron.d/mrepo || :
Expand Down
12 changes: 6 additions & 6 deletions gensystemid
Expand Up @@ -2,12 +2,12 @@

import os, sys, getopt, getpass, urlparse

if os.path.exists('/usr/share/mrepo/rhn/') and os.path.exists('/usr/share/mrepo/rhn/up2date_client/'):
sys.path.insert(0, '/usr/share/mrepo/rhn/')
sys.path.insert(1, '/usr/share/mrepo/rhn/up2date_client/')
elif os.path.exists('/usr/share/rhn/') and os.path.exists('/usr/share/rhn/up2date_client/'):
sys.path.insert(0, '/usr/share/rhn/')
sys.path.insert(1, '/usr/share/rhn/up2date_client/')
if os.path.exists('/usr/share/mrepo/up2date_client/'):
sys.path.insert(-1, '/usr/share/mrepo/')
sys.path.insert(-1, '/usr/share/mrepo/up2date_client/')
elif os.path.exists('/usr/share/rhn/up2date_client/'):
sys.path.insert(-1, '/usr/share/rhn/')
sys.path.insert(-1, '/usr/share/rhn/up2date_client/')
else:
print >>sys.stderr, 'rhnget: up2date libraries are not installed. Aborting execution'
sys.exit(1)
Expand Down
20 changes: 12 additions & 8 deletions mrepo
Expand Up @@ -22,7 +22,7 @@ import time
__version__ = "$Revision$"
# $Source$

VERSION = '0.8.4svn'
VERSION = '0.8.5'

archs = {
'alpha': ('alpha', 'alphaev5', 'alphaev56', 'alphaev6', 'alphaev67'),
Expand Down Expand Up @@ -181,6 +181,7 @@ class Config:

self.hardlink = self.getoption('main', 'hardlink', 'no') not in disable

### FIXME: See if fuse module is loaded
self.unionfs = self.getoption('main', 'unionfs', 'yes') not in disable

self.no_proxy = self.getoption('main', 'no_proxy', None)
Expand Down Expand Up @@ -495,21 +496,24 @@ class Dist:
def mount(self):
"Loopback mount all ISOs"
discs = []
mountpoints = []
mountpoints = []
discnr = 0
if cf.shareiso:
mkdir(os.path.join(self.dir, 'iso'))
else:
remove(os.path.join(self.dir, 'iso'))
regexp = re.compile('.+[_-]CD[0-9]?\..+')
if cf.cmd['mount'].find('fuseiso') != -1:
### FIXME: See if fuse module is loaded
if cf.cmd['unionfs'] and cf.unionfs and self.unionfs:
opts = '-n'
extra_opts = '-oallow_other'
mount_cmd = cf.cmd['fuseiso']
else:
opts = '-o loop,ro'
extra_opts = ''
if readfile('/selinux/enforce') == '1' and cf.cmd['mount'].find('fuseiso') == -1:
opts = opts + ',context=system_u:object_r:httpd_sys_content_t'
mount_cmd = cf.cmd['mount']
if readfile('/selinux/enforce') == '1':
opts = opts + ',context=system_u:object_r:httpd_sys_content_t'
for iso in self.isos:
if cf.shareiso:
symlink(iso, os.path.join(self.dir, 'iso'))
Expand All @@ -529,7 +533,7 @@ class Dist:
mkdir(mount)
if not os.path.ismount(mount):
info(2, '%s: Mount ISO %s to %s' % (self.nick, os.path.basename(iso), mount))
run('%s %s %s %s %s' % (cf.cmd['mount'], opts, iso, mount, extra_opts))
run('%s %s %s %s %s' % (mount_cmd, opts, iso, mount, extra_opts))
mountpoints.append(mount)
else:
if mount2 != mount:
Expand All @@ -545,7 +549,7 @@ class Dist:
# We need to make sure that our directory isn't already mounted (in the case of mrepo -g)
if not mountpoint(unionfs_name):
# Create the 'os' directory for the merged trees.
unionfs_mountpoint = os.path.join(self.dir, 'os')
unionfs_mountpoint = os.path.join(self.dir, 'os')
mkdir(unionfs_mountpoint)
info(2, "%s -o allow_other,fsname=%s %s %s" % (cf.cmd['unionfs'], unionfs_name, ':'.join(mountpoints), unionfs_mountpoint))
run("%s -o allow_other,fsname=%s %s %s" % (cf.cmd['unionfs'], unionfs_name, ':'.join(mountpoints), unionfs_mountpoint))
Expand Down Expand Up @@ -1054,7 +1058,7 @@ def mountpoint(dev):

def distsort(a, b):
return cmp(a.nick, b.nick)

def reposort(a, b):
return cmp(a.name, b.name)

Expand Down
6 changes: 3 additions & 3 deletions mrepo.spec
Expand Up @@ -4,7 +4,7 @@

Summary: Tool to set up a Yum/Apt mirror from various sources (ISO, RHN, rsync, http, ftp, ...)
Name: mrepo
Version: 0.8.4svn
Version: 0.8.5
Release: 1
License: GPL
Group: System Environment/Base
Expand Down Expand Up @@ -110,8 +110,8 @@ fi
%{_localstatedir}/mrepo/

%changelog
* Sat Dec 30 2006 Dag Wieers <dag@wieers.com> - 0.8.4svn-1
- Updated to release 0.8.4svn.
* Fri Aug 15 2008 Dag Wieers <dag@wieers.com> - 0.8.5-1
- Updated to release 0.8.5.

* Wed Dec 13 2006 Dag Wieers <dag@wieers.com> - 0.8.4-1
- Updated to release 0.8.4.
Expand Down
10 changes: 4 additions & 6 deletions rhnget
Expand Up @@ -17,18 +17,16 @@
import os, sys, shutil, getopt, ConfigParser, urlparse, types
import signal, xmlrpclib, getpass, glob, fnmatch

if os.path.exists('/usr/share/mrepo/rhn/up2date_client/'):
sys.path.insert(-1, '/usr/share/mrepo/rhn/')
# sys.path.insert(1, '/usr/share/mrepo/rhn/up2date_client/')
if os.path.exists('/usr/share/mrepo/up2date_client/'):
sys.path.insert(-1, '/usr/share/mrepo/')
sys.path.insert(-1, '/usr/share/mrepo/up2date_client/')
elif os.path.exists('/usr/share/rhn/up2date_client/'):
sys.path.insert(-1, '/usr/share/rhn/')
# sys.path.insert(1, '/usr/share/rhn/up2date_client/')
sys.path.insert(-1, '/usr/share/rhn/up2date_client/')
else:
print >>sys.stderr, 'rhnget: up2date libraries are not installed. Aborting execution'
sys.exit(1)

print sys.path

from up2date_client import config, rpcServer, wrapperUtils, up2dateErrors, repoDirector
from rhn import rpclib

Expand Down

0 comments on commit 3773f52

Please sign in to comment.