Skip to content
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

Recognize packages updated through rpm #214

Open
FrostyX opened this issue Oct 7, 2024 · 1 comment
Open

Recognize packages updated through rpm #214

FrostyX opened this issue Oct 7, 2024 · 1 comment

Comments

@FrostyX
Copy link
Owner

FrostyX commented Oct 7, 2024

See https://issues.redhat.com/browse/RHEL-58663

Tracer doesn't recognize packages updated through rpm, e.g.

rpm -Uvh --noscripts chrony-4.5-1.el9.x86_64.rpm

It's not as simple as editing System.package_manager function and adding:

"fedora":  [
	("tracer.packageManagers.dnf", "Dnf"),
	("tracer.packageManagers.yum", "Yum"),
	("tracer.packageManagers.rpm", "Rpm"),
],

because the Rpm class doesn't know where the RPM database is:

class Rpm(IPackageManager):
	@property
	def history_path(self): return NotImplemented

I am not sure if this is enough to fix this, or the SQL queries in the class won't work anyway.

@FrostyX
Copy link
Owner Author

FrostyX commented Oct 7, 2024

I am not sure if this is enough to fix this, or the SQL queries in the class won't work anyway.

Nope, they won't work, they are both written for Yum and Dnf. Even when using /var/lib/rpm/rpmdb.sqlite database and applying some tweaks, neither of these is compatible with the database:

if self.opts.get('modern_swdb'):
	sql = """
		SELECT DISTINCT rpm.name, trans.dt_end AS end

		FROM trans JOIN trans_item JOIN rpm
		ON trans.id=trans_item.trans_id
		AND trans_item.item_id=rpm.item_id

		WHERE trans.dt_begin > ?
		ORDER BY rpm.name
	"""
else:
	sql = """
		SELECT DISTINCT pkgtups.name, trans_end.timestamp AS end

		FROM trans_beg JOIN trans_end JOIN trans_data_pkgs JOIN pkgtups
		ON trans_beg.tid=trans_end.tid
		AND trans_data_pkgs.tid=trans_beg.tid
		AND trans_data_pkgs.pkgtupid=pkgtups.pkgtupid

		WHERE trans_beg.timestamp > ?
		ORDER BY pkgtups.name
	"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant