コード例 #1
0
def get_rpm_install(conf_obj, archive=False):
    return_text = ""

    # Don't display repository information for archive pages
    if archive:
        return return_text

    # For rhel systems...
    #  If there are distro aliases, use those
    if conf_obj.info.has_key('distro_aliases'):
        distro_name = conf_obj.info['distro_aliases'][0]
    else:
        distro_name = conf_obj.name

    # Generate Yum Text
    if utils.get_dict_var('YUM_INSTALL', conf_obj.info):
        return_text += """
		<p>
		This distro supports installing packages via <tt>yum</tt>. Putting the
		<a href="mono.repo">mono.repo</a> file in <tt>/etc/yum.repos.d</tt> will allow you to
		install mono and related packages.
		</p>
		"""

        if utils.get_dict_var('YUM_NOTES', conf_obj.info):
            return_text += """
			<p>
			%s
			</p>\n""" % conf_obj.info['YUM_NOTES']

    # Generate yast text
    if utils.get_dict_var('YAST_INSTALL', conf_obj.info):
        return_text += """
		<p>
		This distro supports installing packages via <tt>YaST</tt>.  Add the following installation
		source to <tt>YaST</tt>:
		<ul>
		<li><tt>http://%s%s/%s/%s</tt></li>
		</ul>
		</p>
		<p>For assistance with using repositories and installing packages with YaST, visit this link: 
		<a href="http://en.opensuse.org/Add_Package_Repositories_to_YaST">[1]</a>
                </p>\n""" % (hostname_url, webroot_path, url_prefix,
                             conf_obj.name)

    return return_text
コード例 #2
0
def get_rpm_install(conf_obj, archive=False):
	return_text = ""

	# Don't display repository information for archive pages
	if archive:
		return return_text

	# For rhel systems...
	#  If there are distro aliases, use those
	if conf_obj.info.has_key('distro_aliases'):
		distro_name = conf_obj.info['distro_aliases'][0]
	else:
		distro_name = conf_obj.name

	# Generate Yum Text
	if utils.get_dict_var('YUM_INSTALL', conf_obj.info):
		return_text += """
		<p>
		This distro supports installing packages via <tt>yum</tt>. Putting the
		<a href="mono.repo">mono.repo</a> file in <tt>/etc/yum.repos.d</tt> will allow you to
		install mono and related packages.
		</p>
		"""

		if utils.get_dict_var('YUM_NOTES', conf_obj.info):
			return_text += """
			<p>
			%s
			</p>\n""" % conf_obj.info['YUM_NOTES']

	# Generate yast text
	if utils.get_dict_var('YAST_INSTALL', conf_obj.info):
		return_text += """
		<p>
		This distro supports installing packages via <tt>YaST</tt>.  Add the following installation
		source to <tt>YaST</tt>:
		<ul>
		<li><tt>http://%s%s/%s/%s</tt></li>
		</ul>
		</p>
		<p>For assistance with using repositories and installing packages with YaST, visit this link: 
		<a href="http://en.opensuse.org/Add_Package_Repositories_to_YaST">[1]</a>
                </p>\n""" % (hostname_url, webroot_path, url_prefix, conf_obj.name)

	return return_text
コード例 #3
0
package_src_url = os.path.basename(package_src_dir)

if not package_src_url:
    print "Invalid package_src_dir, make sure it doesn't end with a slash"
    sys.exit(1)

# Go here so the rpm file globbings look right
os.chdir(package_src_dir)
for distro_conf in distros:

    build_conf = packaging.buildconf(os.path.basename(distro_conf),
                                     exclusive=False)
    print "*** Generating pages for: %s" % build_conf.name

    # Skip the distros that use zip packaging system
    if utils.get_dict_var('USE_ZIP_PKG', build_conf.info): continue

    distro_out_dir = os.path.join(output_dir, url_prefix, build_conf.name)
    out_file = distro_out_dir + os.sep + 'index.html'
    arc_out_file = os.path.join(output_dir, 'archive', version, 'download',
                                build_conf.name, 'index.html')

    distutils.dir_util.mkpath(os.path.dirname(out_file))
    distutils.dir_util.mkpath(os.path.dirname(arc_out_file))

    out = open(out_file, 'w')
    arc_out = open(arc_out_file, 'w')

    for line in template:
        line_segs = line.split()
        if line_segs and line_segs[0] == "#":
コード例 #4
0
ファイル: sync-bundle.py プロジェクト: lovelydb/release
                # Restore version_map_exists
                pack_obj.bundle_obj.version_map_exists = old_version_map_exists

# Gather sources
for pack in build.get_packages():
    pack_obj = packaging.package("",
                                 pack,
                                 bundle_obj=bundle_obj,
                                 create_dirs=False)
    source_file = pack_obj.get_source_file()
    # Make sure there is a valid source before adding (it will be missing if it's not in the bundle)
    if source_file:
        sources.append(pack_obj.source_basepath + os.sep + source_file)

# Collect installers (grab version defined in the bundle)
archive_version = utils.get_dict_var('archive_version', bundle_obj.info)
md_version = utils.get_dict_var('md_version', bundle_obj.info)

print "md_version = " + md_version
if md_version == "":
    sys.exit(1)
os.chdir('..')

#installer_dirs = []
if not skip_installers:
    for dir in [
            'windows-installer/Output/[[version]]/windows-installer',
            'macosx/output/[[version]]/macos-10-universal',
            'md-macosx/output/[[version]]/md-macos-10',
    ]:
コード例 #5
0
ファイル: packaging.py プロジェクト: akoeplinger/release
	def get_info_var(self, key):
		return utils.get_dict_var(key, self.info)
コード例 #6
0
 def get_info_var(self, key):
     return utils.get_dict_var(key, self.info)
コード例 #7
0
ファイル: sync-bundle.py プロジェクト: akoeplinger/release
					rpms += pack_obj.get_files(fail_on_missing=fail_on_missing)

				# Restore version_map_exists
				pack_obj.bundle_obj.version_map_exists = old_version_map_exists

# Gather sources
for pack in build.get_packages():
	pack_obj = packaging.package("", pack, bundle_obj=bundle_obj, create_dirs=False)
	source_file = pack_obj.get_source_file()
	# Make sure there is a valid source before adding (it will be missing if it's not in the bundle)
	if source_file:
		sources.append(pack_obj.source_basepath + os.sep + source_file)


# Collect installers (grab version defined in the bundle)
archive_version = utils.get_dict_var('archive_version', bundle_obj.info)
md_version = utils.get_dict_var('md_version', bundle_obj.info)

print "md_version = " + md_version
if md_version == "":
	sys.exit(1)
os.chdir('..')

#installer_dirs = []
if not skip_installers:
	for dir in	[
			'windows-installer/Output/[[version]]/windows-installer',
			'macosx/output/[[version]]/macos-10-universal',
			'md-macosx/output/[[version]]/md-macos-10',
			]:
コード例 #8
0
version = bundle_conf.info['archive_version']
package_src_url = os.path.basename(package_src_dir)

if not package_src_url:
	print "Invalid package_src_dir, make sure it doesn't end with a slash"
	sys.exit(1)

# Go here so the rpm file globbings look right
os.chdir(package_src_dir)
for distro_conf in distros:

	build_conf = packaging.buildconf(os.path.basename(distro_conf), exclusive=False)
	print "*** Generating pages for: %s" % build_conf.name

	# Skip the distros that use zip packaging system
	if utils.get_dict_var('USE_ZIP_PKG', build_conf.info): continue

	distro_out_dir = os.path.join(output_dir, url_prefix, build_conf.name)
	out_file = distro_out_dir + os.sep + 'index.html'
	arc_out_file = os.path.join(output_dir, 'archive',  version, 'download', build_conf.name, 'index.html')

	distutils.dir_util.mkpath(os.path.dirname(out_file))
	distutils.dir_util.mkpath(os.path.dirname(arc_out_file))

	out = open(out_file, 'w')
	arc_out = open(arc_out_file, 'w')

	for line in template:	
		line_segs = line.split()
		if line_segs and line_segs[0] == "#":
			ARGS = line_segs[2:]
コード例 #9
0
ファイル: mk-repos.py プロジェクト: akoeplinger/release
base_dir = output_dir + os.sep + url_prefix
distutils.dir_util.mkpath(base_dir)
os.chdir(base_dir)

# Load up packages to include in repository (packages_in_repo)
execfile(os.path.join(config.release_repo_root, 'website', 'repo-config', 'config.py') )

# TODO: maybe we should generate the repo data for all repo types for all distros... ?  That might be just confusing...

# Create hard links to real packages to use in repo
for distro in distros:

        distro_obj = packaging.buildconf(distro, exclusive=False)

	# TODO: Come up with repo system for zip system
	if utils.get_dict_var('USE_ZIP_PKG', distro_obj.info):
		pass

	# Only non-zip distros and valid distros for this package
	else: 

		if not os.path.exists(distro_obj.name):
			distutils.dir_util.mkpath(distro_obj.name)
		else:
			# TODO: Better way to do this?
			# Clean up all directories
			for dir in os.listdir(distro_obj.name):
				full_dir = distro_obj.name + os.sep + dir
				if os.path.isdir(full_dir):
					shutil.rmtree(full_dir)
コード例 #10
0
ファイル: mk-repos.py プロジェクト: lovelydb/release
os.chdir(base_dir)

# Load up packages to include in repository (packages_in_repo)
execfile(
    os.path.join(config.release_repo_root, 'website', 'repo-config',
                 'config.py'))

# TODO: maybe we should generate the repo data for all repo types for all distros... ?  That might be just confusing...

# Create hard links to real packages to use in repo
for distro in distros:

    distro_obj = packaging.buildconf(distro, exclusive=False)

    # TODO: Come up with repo system for zip system
    if utils.get_dict_var('USE_ZIP_PKG', distro_obj.info):
        pass

# Only non-zip distros and valid distros for this package
    else:

        if not os.path.exists(distro_obj.name):
            distutils.dir_util.mkpath(distro_obj.name)
        else:
            # TODO: Better way to do this?
            # Clean up all directories
            for dir in os.listdir(distro_obj.name):
                full_dir = distro_obj.name + os.sep + dir
                if os.path.isdir(full_dir):
                    shutil.rmtree(full_dir)
コード例 #11
0
for distro_conf in distros:
	if skip_packages: continue
	conf = packaging.buildconf(os.path.basename(distro_conf), exclusive=False)
	# Skip the distros that use zip packaging system
	if not conf.get_info_var('USE_ZIP_PKG'):
		if os.path.exists(os.path.join(output_dir, 'download-' + bundle_conf.info['bundle_urlname'], conf.name)):
			if conf.get_info_var('distro_aliases'):
				alias_text = "[ " + " | ".join(conf.get_info_var('distro_aliases')) + " ]"
			else: alias_text = ""
			packages += "<li><a href='%s'>%s</a> %s</li>\n" % (conf.name, conf.name, alias_text)

packages += "</ul>"

#### Repositories ####
repositories = "<ul>"
obs_repos = utils.get_dict_var('obs_repos', bundle_conf.info)
for obs_repo in obs_repos:
	repo_name = string.split(obs_repo, "/")[-2]
	repositories += "<li><a href=\"%s\">%s</a></li>\n" % (repo_name, repo_name)
repositories += "</ul>"

fd = open(os.path.join(config.release_repo_root, 'website', 'archive-index'))
out_text = fd.read()
fd.close()

distro_out_text = out_text

out_text = out_text.replace('[[webroot_path]]',    '../../..')
out_text = out_text.replace('[[version]]',    version)
out_text = out_text.replace('[[sources]]',    sources)
out_text = out_text.replace('[[installers]]', installers)