Fix the kernel and initrd names.

Use "redhat-upgrade-tool" for the kernel and initrd names instead of the
python package name (redhat_upgrade_tool). This way the bootloader
entries being added by redhat-upgrade-tool match the ones being removed
by upgrade-prep.sh.

Resolves: rhbz#1084143

(cherry picked from commit d71c58edcb55a863647f682b32b053c6911be90d)
Change the python-devel BuildRequires to python-libs

We want a BuildRequires for the distutils module, since it's not in
the regular python package (surprise!), but python-libs is where it
actually lives. python-devel is more for Python/C stuff, and we don't
have any of that.

(cherry picked from commit 4e1faf6713a49cc6fb0967be59ecd61b4a8bd9a9)

Related: rhbz#1084143
Check for preupgrade-assistant risks

If redhat-upgrade-tool is being used for a major version upgrade,
require that preupgrade-assistant has been run and has not detected any
medium, high or extreme risks to the upgrade. --force will disable this
check.

(cherry picked from commit 0b316cd8ee1c43649a1d3927431c880323c06b7a)

Resolves: rhbz#1084145
Don't display package problems covered by preupgrade-assistant

(cherry picked from commit 873532b553203485fc7b6148cb0de2f62ff755f7)

Related: rhbz#1084145
Revise the preupgrade HIGH risk message.

Modify the high risk check to ask the user to continue. Include the
risks in the output. Use the return value of preupg to determine whether
riskcheck data is available to avoid having to know the path of the
xccdf file.

(cherry picked from commit cc9accb0878e6003b9afc904a3365020b3f40b42)

Related: rhbz#1084145
Require --instrepo with --network.

RHEL has no default mirrorlist and upgrades through CDN are not yet
supported, so require that --network specifies where that is.

(cherry picked from commit 094536a5f8482052737d1451c78c03343867d292)

Resolves: rhbz#1084151
Calling preupgrade-assistant API directly

(cherry picked from commit 8ba97d7d0d95931eb3ea2a284ff7991de02d0e02)

Related: rhbz#1084145
Revise how preupgrade issues are printed

(cherry picked from commit 307e8dfd3dd4350557728c41c7177b79b4cdb8b6)

Related: rhbz#1084145
Save the repo config files to /var/tmp/system-upgrade/yum.repos.d

(cherry picked from commit 3f096d8c589aebd64c750d976a4e2e0e7d0b9689)

Resolves: rhbz#1084164
Added a check to prevent cross-variant upgrades.

(cherry picked from commit ee7bd145c5ae66e079723fc8ef7ab6b0d356d06d)

Related: rhbz#1084145
Move the repo files to /etc/yum.repos.d

The repo files will be saved as redhat-upgrade-<id>.repo in
/etc/yum.repos.d so that they can be used during post-upgrade scripts.
The repo files will be disabled by default.

(cherry picked from commit a820178be341dd4f026b1f247395f0da4d9674b4)

Related: rhbz#1084164
Add an option --cleanup-post to cleanup packages in post scripts.

(cherry picked from commit 978dfdf69e41a122f79f8342f4f544baae0608ef)

Resolves: rhbz#1084155
Clear upgrade.conf before starting

This will remove any stale configuration from a previous run of
fedup before starting a new upgrade.

(cherry picked from commit 48330cbc9fde7a74c4031d3956859599bac417ba)

Related: rhbz#1100391
Always create the upgrade.conf directory

This fixes the problem of the directory not being present when using
--skipkernel.

(cherry picked from commit 302a4fa8d85dc0256825dfb3a7a557846b38a4a1)

Related: rhbz#1084155
Copy upgrade.conf to /root/preupgrade

This works around the problem of upgrade.conf being removed by
redhat-upgrade-tool --clean before the postupgrade scripts can be run.

(cherry picked from commit 8a908a422890e3b331d46bb0b2fd8f96784ded3a)

Related: rhbz#1084155
Fix ValueError with --addrepo/--repo REPOID

We need to be sure that the argument to --addrepo is actually of the
form "REPOID=[@]URL", or we end up with a ValueError when we try to
split it into two parts later on. So let's check that early.

Also, the --repo argument was deprecated and hidden, and it's now
causing confusion with --instrepo, so drop it.

(cherry picked from commit 471b7c7207a279093449eb08d1ef8b4fc59ee0e1)

Related: rhbz#1085023
Add a message about invalid repo URLs

(cherry picked from commit 255dea0e0ebbf00bf81dd1fc34782aa82583e851)

Resolves: rhbz#1085023
Catch exceptions from early treeinfo parsing

(cherry picked from commit a254459e59dbc0d3118858d0ad92fb91be278495)

Resolves: rhbz#1084156
Skip preupgrade-assistant checks if preupgrade is not available

preupgrade-assistant is not yet available in RHEL-7, so don't require it
yet.

Related: rhbz#1084145
Fix the URLGrabError import

(cherry picked from commit ff4625e1531efe26bb8b14ea9ba3cf18e1953e9d)

Related: rhbz#1084156