View | Details | Raw Unified | Return to bug 25496
Collapse All | Expand All

(-)a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-update (-2 / +4 lines)
 Lines 58-64   _repo_base = os.path.join( _mirror_base, 'mirror', configRegistry.get( 'version/ Link Here 
58
58
59
def copy_repository( options, source, version ):
59
def copy_repository( options, source, version ):
60
	""" Copy packages and scripts belonging to version from source directory into local repository """
60
	""" Copy packages and scripts belonging to version from source directory into local repository """
61
	print >>options.teefile, 'Copying packages. Please be patient ...',
61
	print >>options.teefile, 'Please be patient, copying packages ...',
62
	sys.stdout.flush()
62
	sys.stdout.flush()
63
63
64
	version = _exp_version.match( version ).groupdict()
64
	version = _exp_version.match( version ).groupdict()
 Lines 76-87   def copy_repository( options, source, version ): Link Here 
76
	urepo.copy_package_files( source, dest_repo )
76
	urepo.copy_package_files( source, dest_repo )
77
77
78
	# create Packages files
78
	# create Packages files
79
	print >>options.teefile, 'Packages ...',
79
	urepo.update_indexes( dest_repo )
80
	urepo.update_indexes( dest_repo )
80
81
82
	print >>options.teefile, 'Scripts ...',
81
	for script in ('preup.sh', 'postup.sh'):
83
	for script in ('preup.sh', 'postup.sh'):
82
		if os.path.exists(os.path.join(source, script)):
84
		if os.path.exists(os.path.join(source, script)):
83
			shutil.copy2(os.path.join(source, script), os.path.join(dest_repo, 'all', script))
85
			shutil.copy2(os.path.join(source, script), os.path.join(dest_repo, 'all', script))
84
	print >>sys.stdout
86
	print >>options.teefile, 'Done.'
85
87
86
def update_cdrom( options ):
88
def update_cdrom( options ):
87
	""" Copy repository from local DVD or ISO image """
89
	""" Copy repository from local DVD or ISO image """
(-)a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-updater (-4 / +8 lines)
 Lines 208-214   def update_available(mode, baseConfig, cdrom_mount_point, iso=None, updater=None Link Here 
208
208
209
			dprint('Mounting the ISO image %s' % iso)
209
			dprint('Mounting the ISO image %s' % iso)
210
210
211
			resultCode=os.system('mount -o loop %s %s' % ( iso, cdrom_mount_point))
211
			resultCode = subprocess.call(('mount', '-o', 'loop', iso, cdrom_mount_point))
212
			if resultCode not in (0,32):
212
			if resultCode not in (0,32):
213
				res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point))
213
				res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point))
214
				if res != 0:
214
				if res != 0:
 Lines 218-224   def update_available(mode, baseConfig, cdrom_mount_point, iso=None, updater=None Link Here 
218
218
219
			dprint('Mounting cdrom %s' % cdrom_mount_point)
219
			dprint('Mounting cdrom %s' % cdrom_mount_point)
220
220
221
			resultCode = subprocess.call(['mount', cdrom_mount_point])
221
			resultCode = subprocess.call(['mount', '-o', 'ro', cdrom_mount_point])
222
			if resultCode not in (0,32):
222
			if resultCode not in (0,32):
223
				res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point))
223
				res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point))
224
				if res != 0:
224
				if res != 0:
 Lines 232-238   def update_available(mode, baseConfig, cdrom_mount_point, iso=None, updater=None Link Here 
232
						nextversion = f.readline().strip('\n').lower().replace('nextupdate=', '')
232
						nextversion = f.readline().strip('\n').lower().replace('nextupdate=', '')
233
					finally:
233
					finally:
234
						f.close()
234
						f.close()
235
				except:
235
				except IOError, e:
236
					raise UpdateError("%s does not contain an update for version %s-%s."%(device_name,vv,vp), errorsource='PREPARATION')
236
					raise UpdateError("%s does not contain an update for version %s-%s."%(device_name,vv,vp), errorsource='PREPARATION')
237
			else:
237
			else:
238
				raise UpdateError("%s is not a valid UCS update medium" % device_name, errorsource='PREPARATION')
238
				raise UpdateError("%s is not a valid UCS update medium" % device_name, errorsource='PREPARATION')
 Lines 242-249   def update_available(mode, baseConfig, cdrom_mount_point, iso=None, updater=None Link Here 
242
				res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point))
242
				res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point))
243
				if res == 0:
243
				if res == 0:
244
					dprint('Warning: Failed to unmount %s' % device_name)
244
					dprint('Warning: Failed to unmount %s' % device_name)
245
			if nextversion:
245
		if nextversion:
246
			try:
246
				ver = UCS_Version(nextversion)
247
				ver = UCS_Version(nextversion)
248
			except AttributeError, e:
249
				pass
250
			else:
247
				mm_version = UCS_Version.FORMAT % ver
251
				mm_version = UCS_Version.FORMAT % ver
248
				if not updater:
252
				if not updater:
249
					updater = LocalUpdater()
253
					updater = LocalUpdater()

Return to bug 25496