Skip to content

Port rpmwatcher to python3 #676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions scripts/rpmwatcher/rpmwatcher_extract_deps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env python
#!/bin/env python3

"""
MUST BE RUN AS ROOT FROM WITHIN A MINIMAL CENTOS CONTAINER
Expand All @@ -15,7 +15,6 @@
Those are common concepts in the RPM world.
"""

from __future__ import print_function
import argparse
import subprocess
import os
Expand Down Expand Up @@ -182,7 +181,7 @@ def main():
# For every SRPM built by ourselves, get its build dependencies
# We use our local RPMs directory as target directory to avoid downloads
print("\n*** Get build deps for every SRPM built by XCP-ng ***")
for srpm_nvr, build_info in xcp_builds.iteritems():
for srpm_nvr, build_info in xcp_builds.items():
if build_info['built-by'] == 'xcp-ng':
build_info['build-deps'] = get_build_deps(os.path.join(xcp_srpm_repo, srpm_nvr + ".src.rpm"),
install_root,
Expand All @@ -194,7 +193,7 @@ def main():

# For each RPM from our repos, get its runtime dependencies, and add info from xcp_ng_rpms_srpms
print("\n*** Get runtime deps for all RPMs ***")
for srpm_nvr, build_info in xcp_builds.iteritems():
for srpm_nvr, build_info in xcp_builds.items():
for rpm_nvra in build_info['rpms']:
installable, deps = get_all_runtime_deps(rpm_nvra, install_root)
xcp_rpms[rpm_nvra] = {
Expand Down
14 changes: 7 additions & 7 deletions scripts/rpmwatcher/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ set -xe
cd $BASEDIR

# sync repos and produce some data
sh $PATH_TO_SCRIPTS/sync_repos.sh
$PATH_TO_SCRIPTS/sync_repos.sh

# gather data and produce WIP files for the next scripts to use
python $PATH_TO_SCRIPTS/rpmwatcher_update.py $VERSION .
$PATH_TO_SCRIPTS/rpmwatcher_update.py $VERSION .

# get information about the dependencies, from within a CentOS docker container
# using "host" network because "bridge" may fail in some hosting environments
DOCKER_NETWORK=host
docker run --rm -t --privileged --network $DOCKER_NETWORK \
-v ~/data:/data -v ~/git/xcp/scripts/rpmwatcher:/scripts centos:$CENTOS_VERSION \
python /scripts/rpmwatcher_extract_deps.py $VERSION /data
/scripts/rpmwatcher_extract_deps.py $VERSION /data

# compute roles
python $PATH_TO_SCRIPTS/rpmwatcher_extract_roles.py $VERSION .
$PATH_TO_SCRIPTS/rpmwatcher_extract_roles.py $VERSION .

# produce reports
python $PATH_TO_SCRIPTS/rpmwatcher_format_reports.py $VERSION . html
python $PATH_TO_SCRIPTS/rpmwatcher_format_reports.py $VERSION . markdown
python $PATH_TO_SCRIPTS/rpmwatcher_format_reports.py $VERSION . csv
$PATH_TO_SCRIPTS/rpmwatcher_format_reports.py $VERSION . html
$PATH_TO_SCRIPTS/rpmwatcher_format_reports.py $VERSION . markdown
$PATH_TO_SCRIPTS/rpmwatcher_format_reports.py $VERSION . csv