RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 17-Aug-2007 21:42:11
Branch: HEAD Handle: 2007081720421001
Modified files:
rpm CHANGES
rpm/lib rpmchecksig.c rpminstall.c
Log:
- use rpmgi for --addsign/--checksig arg iteration.
Summary:
Revision Changes Path
1.1583 +1 -0 rpm/CHANGES
1.131 +32 -7 rpm/lib/rpmchecksig.c
1.158 +1 -1 rpm/lib/rpminstall.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1582 -r1.1583 CHANGES
--- rpm/CHANGES 17 Aug 2007 18:50:19 -0000 1.1582
+++ rpm/CHANGES 17 Aug 2007 19:42:10 -0000 1.1583
@@ -1,4 +1,5 @@
4.5 -> 5.0:
+ - jbj: use rpmgi for --addsign/--checksig arg iteration.
- jbj: repair a minor rpmInstall and major matchpathcon_init() memleaks.
- jbj: unbreak --install/--upgrade/--freshen, memleaks checked.
- jbj: use rpmgi for --install/--upgrade/--freshen. non-functional atm.
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmchecksig.c
============================================================================
$ cvs diff -u -r1.130 -r1.131 rpmchecksig.c
--- rpm/lib/rpmchecksig.c 17 Aug 2007 16:04:51 -0000 1.130
+++ rpm/lib/rpmchecksig.c 17 Aug 2007 19:42:11 -0000 1.131
@@ -11,7 +11,7 @@
#include <rpmevr.h>
#include "rpmdb.h"
-
+#include "rpmgi.h"
#include "rpmts.h"
#define _RPMLEAD_INTERNAL
@@ -183,6 +183,7 @@
/*@modifies rpmGlobalMacroContext,
fileSystem, internalState @*/
{
+ rpmgi gi = NULL;
FD_t fd = NULL;
FD_t ofd = NULL;
struct rpmlead *lead = NULL;
@@ -203,7 +204,15 @@
/*@-branchstate@*/
if (argv)
- while ((fn = *argv++) != NULL) {
+{ /* start-of-arg-iteration */
+
+ rpmgi gi = rpmgiNew(ts, RPMDBI_ARGLIST, NULL, 0);
+ int _ftsOpts = 0;
+ rpmgiFlags _giFlags = RPMGI_NONE;
+
+ rc = rpmgiSetArgs(gi, argv, _ftsOpts, (_giFlags|RPMGI_NOHEADER));
+ while (rpmgiNext(gi) == RPMRC_OK) {
+ const char * fn = rpmgiHdrPath(gi);
fprintf(stdout, "%s:\n", fn);
@@ -411,6 +420,8 @@
}
/*@=branchstate@*/
+} /* end-of-arg-iteration */
+
res = 0;
exit:
@@ -420,6 +431,8 @@
lead = _free(lead);
sigh = rpmFreeSignature(sigh);
+ gi = rpmgiFree(gi);
+
if (sigtarget) {
xx = Unlink(sigtarget);
sigtarget = _free(sigtarget);
@@ -1115,9 +1128,7 @@
int rpmcliSign(rpmts ts, QVA_t qva, const char ** argv)
{
- const char * arg;
int res = 0;
- int xx;
if (argv == NULL) return res;
@@ -1138,16 +1149,30 @@
/*@notreached@*/ break;
}
- while ((arg = *argv++) != NULL) {
+{ /* start-of-arg-iteration */
+
+ rpmgi gi = rpmgiNew(ts, RPMDBI_ARGLIST, NULL, 0);
+ int _ftsOpts = 0;
+ rpmgiFlags _giFlags = RPMGI_NONE;
+ rpmRC rc;
+
+ rc = rpmgiSetArgs(gi, argv, _ftsOpts, (_giFlags|RPMGI_NOHEADER));
+ while (rpmgiNext(gi) == RPMRC_OK) {
+ const char * fn = rpmgiHdrPath(gi);
FD_t fd;
+ int xx;
- if ((fd = Fopen(arg, "r.fdio")) == NULL
+ if ((fd = Fopen(fn, "r.fdio")) == NULL
|| Ferror(fd)
- || rpmVerifySignatures(qva, ts, fd, arg))
+ || rpmVerifySignatures(qva, ts, fd, fn))
res++;
if (fd != NULL) xx = Fclose(fd);
}
+ gi = rpmgiFree(gi);
+
+} /* end-of-arg-iteration */
+
return res;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpminstall.c
============================================================================
$ cvs diff -u -r1.157 -r1.158 rpminstall.c
--- rpm/lib/rpminstall.c 17 Aug 2007 18:50:20 -0000 1.157
+++ rpm/lib/rpminstall.c 17 Aug 2007 19:42:11 -0000 1.158
@@ -18,7 +18,7 @@
#include "manifest.h"
#include "misc.h" /* XXX rpmGlob() */
-#include "rpmgi.h" /* XXX rpmgiEscapeSpaces */
+#include "rpmgi.h"
#include "debug.h"
/*@access rpmts @*/ /* XXX ts->goal */
@@ .
Received on Fri Aug 17 21:42:11 2007