rpmget package
rpmget workflow helper via httpx and configparser.
- class rpmget.CfgParser(*args, **kwargs)[source]
Bases:
ConfigParserSimple subclass with extended interpolation and no empty lines in values (see design item SDD002).
interpolation = ExtendedInterpolation
inline_comment_prefixes = None
empty_lines_in_values = False
- exception rpmget.CfgSectionError
Bases:
ExceptionRaise if the config section [rpmget] does not exist, normally at the top of the config file. This section must exist and contain the required keys and valid values:
[rpmget] top_dir = rpms layout = tree pkg_tool = rpm repo_dir = ~/rpmrepos repo_tool = createrepo_c repo_args = --compatibility httpx_timeout = 15.0
Also raised for invalid URL errors.
- exception rpmget.FileTypeError
Bases:
ExceptionRaise if the file extension is not in the allowed extensions list:
['.ini', '.cfg', '.conf']
- rpmget.check_url_str(str_val)[source]
Simple string check for http … .rpm
- Parameters:
str_val (str)
- Return type:
bool
- rpmget.create_macros(topdir)[source]
Render a string template.
- Parameters:
topdir (str)
- Return type:
str
- rpmget.find_rpm_urls(config)[source]
Find all the (hopefully valid) URLs.
- Parameters:
config (CfgParser) – loaded CfgParser instance
- Returns:
list of valid URLs
- Return type:
List[str]
- rpmget.load_config(ufile='')[source]
Read the configuration file and load the data. If ENV path or local file is not found in current directory, the default cfg will be loaded. Note that passing
ufileas a parameter overrides the above default.- Parameters:
ufile (str) – path string for config file
- Returns:
loaded CfgParser instance and file Path-or-None
- Raises:
FileTypeError – if the input file is not in the allowed list [‘.ini’, ‘.cfg’, ‘.conf’]
- Return type:
Tuple[CfgParser, Path | None]
- rpmget.url_is_valid(rpm_url)[source]
Validate rpm URL string using urlparse and rpm extension check.
;param rpm_url: full url string ending in .rpm :returns: True if checks pass
- Parameters:
rpm_url (str)
- Return type:
bool
- rpmget.validate_config(config, stop_on_error=True)[source]
Validate minimum config sections and make sure [rpmget] section exists with required options (see design item SDD003).
- Parameters:
config (CfgParser) – loaded CfgParser instance
stop_on_error (bool) – boolean flag for URL processing
- Returns:
boolean
is_validflag- Return type:
bool
Submodules
- rpmget.rpmget module
- rpmget.utils module
check_for_rpm()compare_file_data()compare_manifest_data()copy_rpms()create_manifest_data()download_progress_bin()get_file_data()get_file_hash()get_file_mtime()get_filelist()get_user_cachedir()load_manifest()manage_repo()process_file_manifest()read_manifest()wrap_file_manifest()write_manifest()