1 diff -ur poldek-0.18.8/main.c poldek-0.18.8-rpm/main.c
2 --- poldek-0.18.8/main.c 2004-12-30 13:37:30.000000000 +0100
3 +++ poldek-0.18.8-rpm/main.c 2005-05-21 00:19:48.878118872 +0200
7 #define OPT_RPMOPT 2008
8 +#define OPT_RPMCMD 2009
10 #define OPT_SW_V016 (1 << 0)
11 #define OPT_SW_NOASK (1 << 1)
13 {"version", OPT_BANNER, 0, 0, N_("Display program version information and exit"), 500 },
14 {"log", OPT_LOG, "FILE", 0, N_("Log program messages to FILE"), 500 },
15 {"v016", OPT_V016, 0, 0, N_("Read indexes created by versions < 0.17"), 500 },
16 +{"rpmcmd", OPT_RPMCMD, "FILE", 0, N_("Use FILE as rpm program"), 500 },
17 {0, 'v', 0, 0, N_("Be verbose."), 500 },
18 {0, 'q', 0, 0, N_("Do not produce any output."), 500 },
21 argsp->switches |= OPT_SW_NOCONF;
25 + argsp->inst.rpmcommand = prepare_path(arg);
31 diff -ur poldek-0.18.8/pkgfetch.c poldek-0.18.8-rpm/pkgfetch.c
32 --- poldek-0.18.8/pkgfetch.c 2004-05-20 23:47:59.000000000 +0200
33 +++ poldek-0.18.8-rpm/pkgfetch.c 2005-05-21 00:19:48.879118720 +0200
38 -int package_verify_sign(const char *path, unsigned flags)
39 +int package_verify_sign(const char *path, unsigned flags, const char *rpmcommand)
41 unsigned rpmflags = 0;
45 #else /* HAVE_RPMCHECKSIG */
47 -int package_verify_sign(const char *path, unsigned flags)
48 +int package_verify_sign(const char *path, unsigned flags, const char *rpmcommand)
59 + argv[n++] = rpmcommand;
65 #endif /* HAVE_RPMCHECKSIG */
67 -int package_verify_pgpg_sign(const struct pkg *pkg, const char *localpath)
68 +int package_verify_pgpg_sign(const struct pkg *pkg, const char *localpath, const char *rpmcommand)
73 if (pkg->pkgdir->flags & PKGDIR_VRFY_PGP)
74 verify_flags |= PKGVERIFY_PGP;
76 - if (!package_verify_sign(localpath, verify_flags)) {
77 + if (!package_verify_sign(localpath, verify_flags, rpmcommand)) {
78 logn(LOGERR, "%s: signature verification failed", pkg_snprintf_s(pkg));
85 -int packages_fetch(tn_array *pkgs, const char *destdir, int nosubdirs)
86 +int packages_fetch(tn_array *pkgs, const char *destdir, int nosubdirs, const char *rpmcommand)
88 int i, nerr, urltype, ncdroms;
89 tn_array *urls = NULL;
93 rpmlib_verbose = -2; /* be quiet */
94 - if (!package_verify_sign(path, PKGVERIFY_MD)) {
95 + if (!package_verify_sign(path, PKGVERIFY_MD, rpmcommand)) {
96 logn(LOGERR, _("%s: MD5 signature verification failed"),
100 int pkg_ok, v = rpmlib_verbose;
102 rpmlib_verbose = -2; /* be quiet */
103 - pkg_ok = package_verify_sign(path, PKGVERIFY_MD);
104 + pkg_ok = package_verify_sign(path, PKGVERIFY_MD, rpmcommand);
107 if (pkg_ok) /* already downloaded, */
109 char localpath[PATH_MAX];
110 snprintf(localpath, sizeof(localpath), "%s/%s", real_destdir,
111 n_basenam(n_array_nth(urls, j)));
112 - if (!package_verify_sign(localpath, PKGVERIFY_MD)) {
113 + if (!package_verify_sign(localpath, PKGVERIFY_MD, rpmcommand)) {
114 logn(LOGERR, _("%s: MD5 signature verification failed"),
115 n_basenam(localpath));
117 diff -ur poldek-0.18.8/pkgset-install.c poldek-0.18.8-rpm/pkgset-install.c
118 --- poldek-0.18.8/pkgset-install.c 2004-12-30 13:03:52.000000000 +0100
119 +++ poldek-0.18.8-rpm/pkgset-install.c 2005-05-21 00:19:48.883118112 +0200
120 @@ -2115,7 +2115,7 @@
122 destdir = inst->cachedir;
124 - rc = packages_fetch(upg->install_pkgs, destdir, inst->fetchdir ? 1 : 0);
125 + rc = packages_fetch(upg->install_pkgs, destdir, inst->fetchdir ? 1 : 0, inst->rpmcommand);
127 } else if ((inst->flags & INSTS_NOHOLD) || (rc = check_holds(ps, upg))) {
128 int is_test = inst->flags & INSTS_RPMTEST;
129 diff -ur poldek-0.18.8/pkgset.c poldek-0.18.8-rpm/pkgset.c
130 --- poldek-0.18.8/pkgset.c 2004-12-30 13:05:24.000000000 +0100
131 +++ poldek-0.18.8-rpm/pkgset.c 2005-05-21 00:19:48.885117808 +0200
133 inst->dumpfile = NULL;
134 inst->rpmopts = NULL;
135 inst->rpmacros = NULL;
136 + inst->rpmcommand = "/bin/rpm";
137 inst->askpkg_fn = ask_pkg;
138 inst->ask_fn = ask_yn;
139 inst->rpmacros = n_array_new(2, NULL, NULL);
140 diff -ur poldek-0.18.8/pkgset.h poldek-0.18.8-rpm/pkgset.h
141 --- poldek-0.18.8/pkgset.h 2004-07-02 19:42:40.000000000 +0200
142 +++ poldek-0.18.8-rpm/pkgset.h 2005-05-21 00:19:48.886117656 +0200
144 const char *fetchdir; /* dir to fetch files to */
145 const char *cachedir; /* cache directory */
146 const char *dumpfile; /* file to dump fqpns */
147 + const char *rpmcommand; /* deault /bin/rpm */
148 tn_array *rpmopts; /* rpm cmdline opts (char *opts[]) */
149 tn_array *rpmacros; /* rpm macros to pass to cmdline (char *opts[]) */
150 tn_array *hold_patterns;
153 #define packages_unmark_all(pkgs) packages_mark(pkgs, 0, PKG_INDIRMARK | PKG_DIRMARK)
155 -int packages_fetch(tn_array *pkgs, const char *destdir, int nosubdirs);
156 +int packages_fetch(tn_array *pkgs, const char *destdir, int nosubdirs, const char *rpmcommand);
157 int packages_rpminstall(tn_array *pkgs, struct pkgset *ps, struct inst_s *inst);
159 int packages_uninstall(tn_array *pkgs, struct inst_s *inst, struct install_info *iinf);
160 @@ -206,10 +207,10 @@
161 #define PKGVERIFY_GPG (1 << 1)
162 #define PKGVERIFY_PGP (1 << 2)
164 -int package_verify_sign(const char *path, unsigned flags);
165 +int package_verify_sign(const char *path, unsigned flags, const char *rpmcommand);
167 /* looks if pkg->pkgdir has set VERSIGN flag */
168 -int package_verify_pgpg_sign(const struct pkg *pkg, const char *localpath);
169 +int package_verify_pgpg_sign(const struct pkg *pkg, const char *localpath, const char *rpmcommand);
171 #include "pkgset-load.h"
173 diff -ur poldek-0.18.8/rpminstall.c poldek-0.18.8-rpm/rpminstall.c
174 --- poldek-0.18.8/rpminstall.c 2004-12-01 17:22:38.000000000 +0100
175 +++ poldek-0.18.8-rpm/rpminstall.c 2005-05-21 00:19:48.887117504 +0200
176 @@ -236,21 +236,21 @@
180 - if (!packages_fetch(pkgs, inst->cachedir, 0))
181 + if (!packages_fetch(pkgs, inst->cachedir, 0, inst->rpmcommand))
184 if (inst->flags & INSTS_RPMTEST) {
187 + cmd = inst->rpmcommand;
188 + argv[n++] = inst->rpmcommand;
190 } else if (inst->flags & INSTS_USESUDO) {
191 cmd = "/usr/bin/sudo";
193 - argv[n++] = "/bin/rpm";
194 + argv[n++] = inst->rpmcommand;
199 + cmd = inst->rpmcommand;
200 + argv[n++] = inst->rpmcommand;
203 if (inst->flags & INSTS_INSTALL)
208 - if (!package_verify_pgpg_sign(pkg, path))
209 + if (!package_verify_pgpg_sign(pkg, path, inst->rpmcommand))
213 diff -ur poldek-0.18.8/shell/get.c poldek-0.18.8-rpm/shell/get.c
214 --- poldek-0.18.8/shell/get.c 2002-03-25 21:30:08.000000000 +0100
215 +++ poldek-0.18.8-rpm/shell/get.c 2005-05-21 00:20:40.173320816 +0200
220 - if (!packages_fetch(pkgs, destdirp, 1))
221 + if (!packages_fetch(pkgs, destdirp, 1, cmdarg->sh_s->inst->rpmcommand))
225 diff -ur poldek-0.18.8/uninstall.c poldek-0.18.8-rpm/uninstall.c
226 --- poldek-0.18.8/uninstall.c 2002-11-22 18:07:26.000000000 +0100
227 +++ poldek-0.18.8-rpm/uninstall.c 2005-05-21 00:19:48.889117200 +0200
228 @@ -340,17 +340,17 @@
231 if (inst->flags & INSTS_RPMTEST) {
234 + cmd = inst->rpmcommand;
235 + argv[n++] = inst->rpmcommand;
237 } else if (inst->flags & INSTS_USESUDO) {
238 cmd = "/usr/bin/sudo";
240 - argv[n++] = "/bin/rpm";
241 + argv[n++] = inst->rpmcommand;
246 + cmd = inst->rpmcommand;
247 + argv[n++] = inst->rpmcommand;
250 argv[n++] = "--erase";