Reputation: 1678
I have a FTP server which I use for Linux repository for RPM packages. I need to delete old packages without doing it manually. Is there a script which can delete old packages based on package version?
Best wishes
Upvotes: 0
Views: 1824
Reputation: 2671
If you can run on the server side:
Depending on your favorite programming language, you can compare rpm versions with Perl or Python.
You can gather some ideas here:
https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch17s03s06.html and http://metacpan.org/pod/RPM2 (Perl, package RPM2; provides a <=> operator for comparing versions) other CPAN modules: http://search.cpan.org/search?query=RPM&mode=all
Compare RPM Packages using Python https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-rpm-programming-python.html http://www.sharms.org/blog/2009/05/python-rpm/ (Python, package rpm)
If you can't run on the server side, things become a little hairy, because all the naming/versioning schemes are difficult to tell apart.
Upvotes: 2