Compare commits

..

No commits in common. "master" and "f17" have entirely different histories.
master ... f17

8 changed files with 145 additions and 109 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
/rpmreaper-0.2.0.tar.gz
rpmreaper-0.1.6.tar.gz

View File

@ -0,0 +1,19 @@
commit ffa13f4493d75a1b32a3ff2c6e0e2206b15c3969
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date: Tue Aug 24 15:43:27 2010 +0200
print F2 as help key in help line
diff --git a/tui.c b/tui.c
index 19fba8e..ca0c064 100644
--- a/tui.c
+++ b/tui.c
@@ -106,7 +106,7 @@ void display_help() {
attron(COLOR_PAIR(1));
move(0, 0);
hline(' ', COLS);
- addnstr("q:Quit d,D,E:Del u,U,I:Undel r,R:Req b,B:ReqBy i:Info c,C:Commit F1:Help", COLS);
+ addnstr("q:Quit d,D,E:Del u,U,I:Undel r,R:Req b,B:ReqBy i:Info c,C:Commit F2:Help", COLS);
}
void display_status(const struct pkgs *p, const struct pkglist *l) {

View File

@ -0,0 +1,12 @@
diff -up rpmreaper-0.1.6/Makefile.librpm rpmreaper-0.1.6/Makefile
--- rpmreaper-0.1.6/Makefile.librpm 2009-04-02 10:18:29.000000000 +0200
+++ rpmreaper-0.1.6/Makefile 2010-02-15 13:26:29.000000000 +0100
@@ -2,7 +2,7 @@ NAME = rpmreaper
VERSION = 0.1.6
CFLAGS = -O -g -Wall
-LDFLAGS = -lrpmbuild -lncurses
+LDFLAGS = -lrpm -lncurses
prefix = /usr/local
bindir = $(prefix)/bin

View File

@ -0,0 +1,53 @@
commit 0ae72914bec9f385555e4a0827c37f7a6c927506
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date: Wed Jun 1 12:10:26 2011 +0200
call rpmcliFini() only on exit (rhbz#709421)
diff --git a/rpm.c b/rpm.c
index 230818b..374ebcd 100644
--- a/rpm.c
+++ b/rpm.c
@@ -86,13 +86,11 @@ static int rpm_read(const struct repo *repo, struct pkgs *p, uint firstpid) {
rpmdbMatchIterator iter;
Header header;
uint pid;
- char *argv[] = {""};
#ifndef _RPM_4_4_COMPAT
rpmtd sizetd;
sizetd = rpmtdNew();
#endif
- rd->context = rpmcliInit(1, argv, NULL);
rd->ts = rpmtsCreate();
rpmtsSetRootDir(rd->ts, ((struct rpmrepodata *)repo->data)->root);
rpmtsSetVSFlags(rd->ts, _RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS);
@@ -299,7 +297,6 @@ static int rpm_read_provs(const struct repo *repo, struct pkgs *p, uint firstpid
iter = rpmdbFreeIterator(iter);
rd->ts = rpmtsFree(ts);
- rd->context = rpmcliFini(rd->context);
return 0;
}
@@ -406,11 +403,14 @@ static int rpm_remove_pkgs(const struct repo *repo, const struct pkgs *p, int fo
}
static void rpm_repo_clean(struct repo *r) {
+ rpmcliFini(((struct rpmrepodata *)r->data)->context);
free(r->data);
r->data = NULL;
}
void rpm_fillrepo(struct repo *r, const char *root) {
+ char *argv[] = {""};
+
r->repo_read = rpm_read;
r->repo_read_provs = rpm_read_provs;
r->repo_pkg_info = rpm_pkg_info;
@@ -419,4 +419,5 @@ void rpm_fillrepo(struct repo *r, const char *root) {
r->data = malloc(sizeof (struct rpmrepodata));
((struct rpmrepodata *)r->data)->root = root;
+ ((struct rpmrepodata *)r->data)->context = rpmcliInit(1, argv, NULL);
}

View File

@ -0,0 +1,38 @@
commit 97481d9548fff559b8f19d2f134a003c4fe3d526
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date: Fri Jan 21 12:37:44 2011 +0100
use RPMDBI_PACKAGES tag when creating rpmdb iterator
diff --git a/rpm.c b/rpm.c
index 405974f..8f20cde 100644
--- a/rpm.c
+++ b/rpm.c
@@ -97,7 +97,7 @@ static int rpm_read(const struct repo *repo, struct pkgs *p, uint firstpid) {
rpmtsSetRootDir(rd->ts, ((struct rpmrepodata *)repo->data)->root);
rpmtsSetVSFlags(rd->ts, _RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS);
- iter = rpmtsInitIterator(rd->ts, RPMTAG_NAME, NULL, 0);
+ iter = rpmtsInitIterator(rd->ts, RPMDBI_PACKAGES, NULL, 0);
for (pid = firstpid; (header = rpmdbNextIterator(iter)) != NULL; pid++) {
#ifdef _RPM_4_4_COMPAT
int i, ds1, ds2, ds3;
commit 99455fd99fe541a15e6c7dcaab357fa89db038fb
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date: Mon Jan 31 17:31:48 2011 +0100
use RPMDBI_PACKAGES index also when reading provides
diff --git a/rpm.c b/rpm.c
index 8f20cde..230818b 100644
--- a/rpm.c
+++ b/rpm.c
@@ -192,7 +192,7 @@ static int rpm_read_provs(const struct repo *repo, struct pkgs *p, uint firstpid
dirs = rpmtdNew();
dirindexes = rpmtdNew();
#endif
- iter = rpmtsInitIterator(ts, RPMTAG_NAME, NULL, 0);
+ iter = rpmtsInitIterator(ts, RPMDBI_PACKAGES, NULL, 0);
for (pid = firstpid; (header = rpmdbNextIterator(iter)) != NULL; pid++) {
#ifdef _RPM_4_4_COMPAT

View File

@ -1,22 +0,0 @@
commit 13926c11f6b33aa1ade43dddfea194cb4210760b
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date: Tue May 6 10:19:26 2014 +0200
canonize also provided filenames for symlinked system dirs
This is needed with packages which provide a filename in a symlinked
system dir, but don't include it.
diff --git a/rpm.c b/rpm.c
index 38bc26f..9f10ddb 100644
--- a/rpm.c
+++ b/rpm.c
@@ -124,6 +124,8 @@ static int rpm_read_provs(const struct repo *repo, struct pkgs *p, uint firstpid
provides = rpmdsNew(header, RPMTAG_PROVIDENAME, 0);
while (rpmdsNext(provides) != -1) {
prov = rpmdsN(provides);
+ if (prov[0] == '/')
+ prov = get_cpath(rd, prov);
provflags = rpmdsFlags(provides);
provver = rpmdsEVR(provides);
provflags &= RPMSENSE_LESS | RPMSENSE_GREATER |

View File

@ -1,14 +1,19 @@
Name: rpmreaper
Version: 0.2.0
Release: 20%{?dist}
Version: 0.1.6
Release: 9%{?dist}
Summary: A tool for removing packages from system
Group: Applications/System
License: GPLv2+
URL: https://github.com/mlichvar/rpmreaper
Source0: https://github.com/mlichvar/rpmreaper/archive/v%{version}/%{name}-%{version}.tar.gz
Patch1: rpmreaper-provfilename.patch
URL: https://fedorahosted.org/rpmreaper/
Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
Patch0: rpmreaper-0.1.6-librpm.patch
Patch1: rpmreaper-0.1.6-f2help.patch
Patch2: rpmreaper-0.1.6-rpmdbiter.patch
Patch3: rpmreaper-0.1.6-rpmclifini.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gcc ncurses-devel rpm-devel
BuildRequires: ncurses-devel rpm-devel
Requires: less rpm
%description
@ -17,97 +22,28 @@ allows removing unnecessary packages and their dependencies from the system.
%prep
%setup -q
%patch1 -p1 -b .provfilename
%patch0 -p1 -b .librpm
%patch1 -p1 -b .f2help
%patch2 -p1 -b .rpmdbiter
%patch3 -p1 -b .rpmclifini
%build
make %{?_smp_mflags} EXTRA_CFLAGS="$RPM_OPT_FLAGS"
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
%install
rm -rf $RPM_BUILD_ROOT
%makeinstall
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc COPYING NEWS README
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%changelog
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Jun 10 22:13:23 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.2.0-19
- Rebuild for RPM 4.15
* Mon Jun 10 15:42:05 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.2.0-18
- Rebuild for RPM 4.15
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jul 16 2018 Miroslav Lichvar <mlichvar@redhat.com> 0.2.0-16
- add gcc to build requirements
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Aug 11 2017 Kalev Lember <klember@redhat.com> - 0.2.0-13
- Rebuilt for RPM soname bump, take 3
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.2.0-12
- Rebuilt for RPM soname bump
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.2.0-11
- Rebuilt for RPM soname bump
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Jul 28 2015 Miroslav Lichvar <mlichvar@redhat.com> 0.2.0-6
- rebuild for new rpm
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Tue May 06 2014 Miroslav Lichvar <mlichvar@redhat.com> 0.2.0-2
- canonize also provided filenames for symlinked system dirs
* Tue Apr 22 2014 Miroslav Lichvar <mlichvar@redhat.com> 0.2.0-1
- update to 0.2.0
* Wed Dec 04 2013 Miroslav Lichvar <mlichvar@redhat.com> 0.1.6-14
- fix building with -Werror=format-security (#1037309)
- remove obsolete macros
- fix weekdays in changelog
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Mar 23 2012 Miroslav Lichvar <mlichvar@redhat.com> 0.1.6-10
- rebuild for new rpm
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (rpmreaper-0.2.0.tar.gz) = f039324e569edb4f1e4e69fa545dd4df95b134aa727384aec76c4414277b37b1e70d8c93eacc9e7bb3c6bae48747a3e4d95936849f2dd92d4bbc873b8492cd96
655184ddcb5cdd3a255d89341284fe6e rpmreaper-0.1.6.tar.gz