- change popt exec alias in oreder to exec rpm children.

- split rpm into 5 pieces along major mode fault lines with popt glue.

CVS patchset: 3750
CVS date: 2000/05/24 17:53:35
This commit is contained in:
jbj 2000-05-24 17:53:35 +00:00
parent 0d15487675
commit c7273eb0bc
31 changed files with 6473 additions and 5504 deletions

View File

@ -23,6 +23,8 @@ ltmain.sh
macros
platform
rpm
rpmdb
rpm[a-z]
rpm2cpio
rpmconvert
rpmpopt

View File

@ -44,6 +44,8 @@
- builds against bzip2 1.0
- detects and builds properly against the new fopencookie API in
glibc 2.2
- change popt exec alias in oreder to exec rpm children.
- split rpm into 5 pieces along major mode fault lines with popt glue.
3.0.3 -> 3.0.4
- use compressed filenames on install side.

View File

@ -17,18 +17,17 @@ SUBDIRS = intl po popt build lib misc tools scripts tests doc .
INCLUDES = -I$(top_srcdir)/build -I$(top_srcdir)/lib -I$(top_srcdir)/popt \
@INCPATH@
myldflags= -L$(top_builddir)/build -L$(top_builddir)/lib -L$(top_builddir)/popt
myLDFLAGS = -L$(top_builddir)/build -L$(top_builddir)/lib -L$(top_builddir)/popt
# XXX libtool can/should generate dependent libs.
# XXX solaris2.6 cannot use *.la with --all-static (downrev binutils/egcs?)
myldadd= \
myLDADD = \
$(top_builddir)/build/.libs/librpmbuild.a \
$(top_builddir)/lib/.libs/librpm.a \
$(top_builddir)/popt/.libs/libpopt.a \
@INTLLIBS@ @LIBMISC@
LDFLAGS = @LDFLAGS_STATIC@ $(myldflags)
LDADD = $(myldadd)
newLDADD = -lrpmbuild -lrpm -lpopt @INTLLIBS@ @LIBMISC@
rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
rpmbin_PROGRAMS = rpm
@ -38,36 +37,83 @@ bin_SCRIPTS = gendiff
noinst_PROGRAMS = @BUILD_RPMCONVERT@
pkglibdir = @RPMCONFIGDIR@
pkglib_DATA = rpmrc rpmpopt macros
pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
config.guess config.sub
pkglibdir = @RPMCONFIGDIR@
pkglib_PROGRAMS = rpmb rpmdb rpmi rpmk rpmq
pkglib_DATA = rpmrc rpmpopt macros
pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
config.guess config.sub
noinst_HEADERS = \
acconfig.h build.h system.h
rpm_SOURCES = build.c rpm.c
rpm_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
rpm_LDADD = $(myLDADD)
$(PROGRAMS): $(myldadd)
rpmb_SOURCES = build.c
rpmb_LDFLAGS = $(myLDFLAGS)
rpmb_LDADD = rpmb.o $(newLDADD)
rpmb.o: rpmqv.c
$(COMPILE) -DIAM_RPMBT -o $@ -c $<
.PHONY: lclint
lclint:
lclint ${DEFS} ${INCLUDES} ${rpm_SOURCES}
rpmdb_SOURCES =
rpmdb_LDFLAGS = $(myLDFLAGS)
rpmdb_LDADD = rpmdb.o $(newLDADD)
rpmdb.o: rpmqv.c
$(COMPILE) -DIAM_RPMDB -o $@ -c $<
CVSTAG = r$(subst .,-,$(VERSION))
rpmi_SOURCES =
rpmi_LDFLAGS = $(myLDFLAGS)
rpmi_LDADD = rpmi.o $(newLDADD)
rpmi.o: rpmqv.c
$(COMPILE) -DIAM_RPMEIU -o $@ -c $<
rpmk_SOURCES =
rpmk_LDFLAGS = $(myLDFLAGS)
rpmk_LDADD = rpmk.o $(newLDADD)
rpmk.o: rpmqv.c
$(COMPILE) -DIAM_RPMK -o $@ -c $<
rpmq_SOURCES =
rpmq_LDFLAGS = $(myLDFLAGS)
rpmq_LDADD = rpmq.o $(newLDADD)
rpmq.o: rpmqv.c
$(COMPILE) -DIAM_RPMQV -o $@ -c $<
rpm2cpio_SOURCES = rpm2cpio.c
rpm2cpio_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
rpm2cpio_LDADD = $(myLDADD)
rpmconvert_SOURCES = convertdb.c oldrpmdb.c
## Libmisc.a is required for rpmconvert.
rpmconvert_LDADD = $(myldadd) -lgdbm
rpmconvert_LDADD = $(myLDADD) -lgdbm
$(PROGRAMS): $(myLDADD)
.PHONY: lclint
lclint:
lclint $(DEFS) $(INCLUDES) $(rpm_SOURCES)
CVSTAG = r$(subst .,-,$(VERSION))
install-data-local:
@$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
@rm -f $(DESTDIR)/$(libdir)/rpmrc
@ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
@@LN_S@ rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
@rm -f $(DESTDIR)/$(libdir)/rpmpopt
@ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
@@LN_S@ rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
@rm -f $(DESTDIR)/$(libdir)/rpm/rpmt
@@LN_S@ rpmb $(DESTDIR)/$(libdir)/rpm/rpmt
@rm -f $(DESTDIR)/$(libdir)/rpm/rpme
@@LN_S@ rpmi $(DESTDIR)/$(libdir)/rpm/rpme
@rm -f $(DESTDIR)/$(libdir)/rpm/rpmu
@@LN_S@ rpmi $(DESTDIR)/$(libdir)/rpm/rpmu
@rm -f $(DESTDIR)/$(libdir)/rpm/rpmv
@@LN_S@ rpmq $(DESTDIR)/$(libdir)/rpm/rpmv
for bf in b db e i k q t u v ; do \
rm -f $(DESTDIR)/$(bindir)/rpm$$bf ; \
@LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)/$(bindir)/rpm$$bf ; \
done
@$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
@case "@build_cpu@" in \
*86) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i386 ;;\

View File

@ -497,7 +497,7 @@ static inline int dbiAppendSet(dbiIndexSet set, const void * recs,
? xmalloc(nrecs * sizeof(*(set->recs)))
: xrealloc(set->recs, (set->count + nrecs) * sizeof(*(set->recs)));
memset(set->recs + set->count, 0, nrecs * sizeof(*recs));
memset(set->recs + set->count, 0, nrecs * sizeof(*(set->recs)));
while (nrecs-- > 0) {
memcpy(set->recs + set->count, rptr, rlen);

678
po/cs.po

File diff suppressed because it is too large Load Diff

1117
po/de.po

File diff suppressed because it is too large Load Diff

679
po/fi.po

File diff suppressed because it is too large Load Diff

695
po/fr.po

File diff suppressed because it is too large Load Diff

754
po/ja.po

File diff suppressed because it is too large Load Diff

682
po/pl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

682
po/ru.po

File diff suppressed because it is too large Load Diff

680
po/sk.po

File diff suppressed because it is too large Load Diff

684
po/sl.po

File diff suppressed because it is too large Load Diff

679
po/sr.po

File diff suppressed because it is too large Load Diff

684
po/sv.po

File diff suppressed because it is too large Load Diff

682
po/tr.po

File diff suppressed because it is too large Load Diff

View File

@ -11,15 +11,14 @@ const char * findProgramPath(const char * argv0) {
char * start, * chptr;
char * buf;
/* If there is a / in the argv[0], it has to be an absolute
path */
/* If there is a / in the argv[0], it has to be an absolute path */
if (strchr(argv0, '/'))
return xstrdup(argv0);
if (!path) return NULL;
start = pathbuf = alloca(strlen(path) + 1);
buf = malloc(strlen(path) + strlen(argv0) + 2);
buf = malloc(strlen(path) + strlen(argv0) + sizeof("/"));
strcpy(pathbuf, path);
chptr = NULL;

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-04-22 14:29-0400\n"
"POT-Creation-Date: 2000-05-24 13:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: POPT\n"
"POT-Creation-Date: 2000-04-22 14:29-0400\n"
"POT-Creation-Date: 2000-05-24 13:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Cristian Gafton <gafton@redhat.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt\n"
"POT-Creation-Date: 2000-04-22 14:29-0400\n"
"POT-Creation-Date: 2000-05-24 13:46-0400\n"
"PO-Revision-Date: 1999-08-04 21:40+0200\n"
"Last-Translator: Stanislav Meduna <stano@eunet.sk>\n"
"Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: popt 1.2\n"
"POT-Creation-Date: 2000-04-22 14:29-0400\n"
"POT-Creation-Date: 2000-05-24 13:46-0400\n"
"PO-Revision-Date: 2000-01-06 13:01+0100\n"
"Last-Translator: Fatih Demir <kabalak@gmx.net>\n"
"Language-Team: Turkish Gnome Tranlation Team <gnotrap@gmx.net>\n"

View File

@ -2,6 +2,8 @@
file accompanying popt source distributions, available from
ftp://ftp.redhat.com/pub/code/popt */
#undef MYDEBUG
#include "system.h"
#include "findme.h"
#include "poptint.h"
@ -218,37 +220,43 @@ static int handleAlias(poptContext con, const char * longName, char shortName,
static void execCommand(poptContext con) {
const char ** argv;
int pos = 0;
const char * script = con->doExec->script;
int argc = 0;
const char ** sargv;
int sargc = 0;
poptParseArgvString(con->doExec->script, &sargc, &sargv);
if (sargv == NULL || sargc < 1 ||
(!con->execAbsolute && strchr(sargv[0], '/')))
return;
argv = malloc(sizeof(*argv) *
(6 + con->numLeftovers + con->finalArgvCount));
(6 + sargc + con->numLeftovers + con->finalArgvCount));
if (!con->execAbsolute && strchr(script, '/')) return;
if (!strchr(script, '/') && con->execPath) {
char *s = alloca(strlen(con->execPath) + strlen(script) + 2);
sprintf(s, "%s/%s", con->execPath, script);
argv[pos] = s;
if (!strchr(sargv[0], '/') && con->execPath) {
char *s = alloca(strlen(con->execPath) + strlen(sargv[0]) + sizeof("/"));
sprintf(s, "%s/%s", con->execPath, sargv[0]);
argv[argc] = s;
} else {
argv[pos] = script;
argv[argc] = findProgramPath(sargv[0]);
}
pos++;
if (argv[argc++] == NULL) return;
argv[pos] = findProgramPath(con->os->argv[0]);
if (argv[pos]) pos++;
argv[pos++] = ";";
if (sargc > 1) {
memcpy(argv + argc, sargv + 1, sizeof(*argv) * (sargc - 1));
argc += (sargc - 1);
}
memcpy(argv + pos, con->finalArgv, sizeof(*argv) * con->finalArgvCount);
pos += con->finalArgvCount;
memcpy(argv + argc, con->finalArgv, sizeof(*argv) * con->finalArgvCount);
argc += con->finalArgvCount;
if (con->numLeftovers) {
argv[pos++] = "--";
memcpy(argv + pos, con->leftovers, sizeof(*argv) * con->numLeftovers);
pos += con->numLeftovers;
argv[argc++] = "--";
memcpy(argv + argc, con->leftovers, sizeof(*argv) * con->numLeftovers);
argc += con->numLeftovers;
}
argv[pos++] = NULL;
argv[argc++] = NULL;
#ifdef __hpux
setresuid(getuid(), getuid(),-1);
@ -267,6 +275,17 @@ static void execCommand(poptContext con) {
#endif
#endif
if (argv[0] == NULL)
return;
#ifdef MYDEBUG
{ const char ** arg;
fprintf(stderr, "==> execvp(%s):", argv[0]);
for (arg = argv; *arg; arg++)
fprintf(stderr, " %s", *arg);
fprintf(stderr, "\n");
}
#endif
execvp(argv[0], (char *const *)argv);
}
@ -386,7 +405,7 @@ static /*@only@*/ const char * expandNextArg(poptContext con, const char * s)
static void poptStripArg(poptContext con, int which)
{
if(con->arg_strip == NULL) {
if (con->arg_strip == NULL) {
con->arg_strip = PBM_ALLOC(con->optionStack[0].argc);
}
PBM_SET(which, con->arg_strip);
@ -438,6 +457,20 @@ static int poptSaveInt(const struct poptOption * opt, long aLong) {
return 0;
}
#ifdef MYDEBUG
static void prtcon(const char *msg, poptContext con)
{
if (msg) fprintf(stderr, "%s", msg);
fprintf(stderr, "\tcon %p os %p nextCharArg %p \"%s\" argv[%d] \"%s\"\n",
con, con->os,
con->os->nextCharArg,
(con->os->nextCharArg ? con->os->nextCharArg : ""),
con->os->next,
(con->os->argv && con->os->argv[con->os->next]
? con->os->argv[con->os->next] : ""));
}
#endif
/* returns 'val' element, -1 on last item, POPT_ERROR_* on error */
int poptGetNextOpt(poptContext con)
{
@ -470,7 +503,7 @@ int poptGetNextOpt(poptContext con)
con->os->next++;
continue;
}
thisopt=con->os->next;
thisopt = con->os->next;
origOptString = con->os->argv[con->os->next++];
if (con->restLeftover || *origOptString != '-') {
@ -525,7 +558,7 @@ int poptGetNextOpt(poptContext con)
if (!opt) {
con->os->nextCharArg = origOptString + 1;
} else {
if(con->os == con->optionStack &&
if (con->os == con->optionStack &&
opt->argInfo & POPT_ARGFLAG_STRIP) {
canstrip = 1;
poptStripArg(con, thisopt);
@ -541,11 +574,14 @@ int poptGetNextOpt(poptContext con)
if (handleAlias(con, NULL, *origOptString,
origOptString + 1)) {
origOptString++;
continue;
}
if (handleExec(con, NULL, *origOptString))
if (handleExec(con, NULL, *origOptString)) {
/* Restore rest of short options for further processing */
origOptString++;
if (*origOptString) con->os->nextCharArg = origOptString;
continue;
}
opt = findOption(con->options, NULL, *origOptString, &cb,
&cbData, 0);
@ -553,8 +589,7 @@ int poptGetNextOpt(poptContext con)
return POPT_ERROR_BADOPT;
origOptString++;
if (*origOptString)
con->os->nextCharArg = origOptString;
if (*origOptString) con->os->nextCharArg = origOptString;
}
if (opt->arg && (opt->argInfo & POPT_ARG_MASK) == POPT_ARG_NONE) {
@ -585,7 +620,7 @@ int poptGetNextOpt(poptContext con)
/* make sure this isn't part of a short arg or the
result of an alias expansion */
if(con->os == con->optionStack &&
if (con->os == con->optionStack &&
opt->argInfo & POPT_ARGFLAG_STRIP &&
canstrip) {
poptStripArg(con, con->os->next);
@ -642,7 +677,7 @@ int poptGetNextOpt(poptContext con)
sizeof(*con->finalArgv) * con->finalArgvAlloced);
}
{ char *s = malloc((opt->longName ? strlen(opt->longName) : 0) + 3);
{ char *s = malloc((opt->longName ? strlen(opt->longName) : 0) + 3);
if (opt->longName)
sprintf(s, "--%s", opt->longName);
else
@ -650,8 +685,9 @@ int poptGetNextOpt(poptContext con)
con->finalArgv[con->finalArgvCount++] = s;
}
if (opt->arg && (opt->argInfo & POPT_ARG_MASK) != POPT_ARG_NONE
&& (opt->argInfo & POPT_ARG_MASK) != POPT_ARG_VAL) {
if (opt->arg && (opt->argInfo & POPT_ARG_MASK) == POPT_ARG_NONE) {
} else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_VAL) {
} else if ((opt->argInfo & POPT_ARG_MASK) != POPT_ARG_NONE) {
con->finalArgv[con->finalArgvCount++] = xstrdup(con->os->nextArg);
}
}
@ -800,16 +836,16 @@ int poptStrippedArgv(poptContext con, int argc, char **argv)
int i,j=1, numargs=argc;
for(i=1; i<argc; i++) {
if(PBM_ISSET(i, con->arg_strip)) {
if (PBM_ISSET(i, con->arg_strip)) {
numargs--;
}
}
for(i=1; i<argc; i++) {
if(PBM_ISSET(i, con->arg_strip)) {
if (PBM_ISSET(i, con->arg_strip)) {
continue;
} else {
if(j<numargs) {
if (j<numargs) {
argv[j++]=argv[i];
} else {
argv[j++]='\0';

View File

@ -15,6 +15,7 @@ run() {
}
builddir=`pwd`
srcdir=$builddir
cd ${srcdir}
test1=${builddir}/test1
echo "Running tests in `pwd`"
@ -39,11 +40,11 @@ run test1 "test1 - 15" "arg1: 0 arg2: foo inc: 1" -i --arg2 foo
POSIX_ME_HARDER=1 run test1 "test1 - 16" "arg1: 1 arg2: (none) rest: foo --arg2 something" --arg1 foo --arg2 something
POSIXLY_CORRECT=1 run test1 "test1 - 17" "arg1: 1 arg2: (none) rest: foo --arg2 something" --arg1 foo --arg2 something
run test1 "test1 - 18" "callback: c sampledata bar arg1: 1 arg2: (none)" --arg1 --cb bar
run test1 "test1 - 19" "${test1} ;" --echo-args
run test1 "test1 - 20" "${test1} ; --arg1" --echo-args --arg1
run test1 "test1 - 21" "${test1} ; --arg2 something" -T something -e
run test1 "test1 - 22" "${test1} ; --arg2 something -- more args" -T something -a more args
run test1 "test1 - 23" "${test1} ; --echo-args -a" --echo-args -e -a
run test1 "test1 - 19" "" --echo-args
run test1 "test1 - 20" "--arg1" --echo-args --arg1
run test1 "test1 - 21" "--arg2 something" -T something -e
run test1 "test1 - 22" "--arg2 something -- more args" -T something -a more args
run test1 "test1 - 23" "--echo-args -a" --echo-args -e -a
run test1 "test1 - 24" "arg1: 0 arg2: (none) short: 1" -shortoption
run test1 "test1 - 25" "arg1: 0 arg2: (none) short: 1" --shortoption
run test1 "test1 - 26" "callback: c arg for cb2 foo arg1: 0 arg2: (none)" --cb2 foo

143
rpm.c
View File

@ -12,7 +12,9 @@
#define GETOPT_ADDSIGN 1005
#define GETOPT_RESIGN 1006
#define GETOPT_DBPATH 1010
#ifdef DYING
#define GETOPT_TIMECHECK 1012
#endif
#define GETOPT_REBUILDDB 1013
#define GETOPT_INSTALL 1014
#define GETOPT_RELOCATE 1016
@ -45,7 +47,6 @@ enum modes {
#define MODES_K (MODE_CHECKSIG | MODES_RESIGN)
#define MODES_FOR_DBPATH (MODES_BT | MODES_IE | MODES_QV | MODES_DB)
#define MODES_FOR_TIMECHECK (MODES_BT)
#define MODES_FOR_NODEPS (MODES_BT | MODES_IE | MODE_VERIFY)
#define MODES_FOR_TEST (MODES_BT | MODES_IE)
#define MODES_FOR_ROOT (MODES_BT | MODES_IE | MODES_QV | MODES_DB)
@ -57,10 +58,12 @@ static int badReloc;
static int excldocs;
static int force;
extern int _ftp_debug;
#ifdef DYING
static char * ftpPort;
static char * ftpProxy;
static char * httpPort;
static char * httpProxy;
#endif
static int showHash;
static int help;
static int ignoreArch;
@ -116,7 +119,9 @@ static struct poptOption optionsTable[] = {
{ "badreloc", '\0', 0, &badReloc, 0, NULL, NULL},
{ "build", 'b', POPT_ARG_STRING, 0, 'b', NULL, NULL},
{ "checksig", 'K', 0, 0, 'K', NULL, NULL},
#ifdef DYING
{ "dbpath", '\0', POPT_ARG_STRING, 0, GETOPT_DBPATH, NULL, NULL},
#endif
{ "define", '\0', POPT_ARG_STRING, 0, GETOPT_DEFINEMACRO,NULL, NULL},
{ "dirtokens", '\0', POPT_ARG_VAL, &_noDirTokens, 0, NULL, NULL},
{ "erase", 'e', 0, 0, 'e', NULL, NULL},
@ -125,12 +130,16 @@ static struct poptOption optionsTable[] = {
{ "excludepath", '\0', POPT_ARG_STRING, 0, GETOPT_EXCLUDEPATH, NULL, NULL},
{ "force", '\0', 0, &force, 0, NULL, NULL},
{ "ftpdebug", '\0', POPT_ARG_VAL, &_ftp_debug, -1, NULL, NULL},
#ifdef DYING
{ "ftpport", '\0', POPT_ARG_STRING, &ftpPort, 0, NULL, NULL},
{ "ftpproxy", '\0', POPT_ARG_STRING, &ftpProxy, 0, NULL, NULL},
#endif
{ "hash", 'h', 0, &showHash, 0, NULL, NULL},
{ "help", '\0', 0, &help, 0, NULL, NULL},
#ifdef DYING
{ "httpport", '\0', POPT_ARG_STRING, &httpPort, 0, NULL, NULL},
{ "httpproxy", '\0', POPT_ARG_STRING, &httpProxy, 0, NULL, NULL},
#endif
{ NULL, 'i', 0, 0, 'i', NULL, NULL},
{ "ignorearch", '\0', 0, &ignoreArch, 0, NULL, NULL},
{ "ignoreos", '\0', 0, &ignoreOs, 0, NULL, NULL},
@ -172,7 +181,9 @@ static struct poptOption optionsTable[] = {
{ "sign", '\0', 0, &signIt, 0, NULL, NULL},
{ "tarbuild", 't', POPT_ARG_STRING, 0, 't', NULL, NULL},
{ "test", '\0', 0, &test, 0, NULL, NULL},
#ifdef DYING
{ "timecheck", '\0', POPT_ARG_STRING, 0, GETOPT_TIMECHECK, NULL, NULL},
#endif
{ "upgrade", 'U', 0, 0, 'U', NULL, NULL},
{ "urldebug", '\0', POPT_ARG_VAL, &_url_debug, -1, NULL, NULL},
{ "uninstall", 'u', 0, 0, 'u', NULL, NULL},
@ -221,7 +232,7 @@ static void printUsage(void) {
printBanner();
puts("");
puts(_("usage: rpm {--help}"));
puts(_("Usage: rpm {--help}"));
puts(_(" rpm {--version}"));
puts(_(" rpm {--initdb} [--dbpath <dir>]"));
puts(_(" rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]"));
@ -306,38 +317,52 @@ static void printHelp(void) {
printBanner();
puts("");
puts( _("usage:"));
puts( _("Usage:"));
printHelpLine( " --help ",
_("print this message"));
printHelpLine( " --version ",
_("print the version of rpm being used"));
puts( _(" all modes support the following arguments:"));
printHelpLine(_(" --rcfile <file> "),
puts("");
puts( _(" All modes support the following arguments:"));
printHelpLine(_(" --define '<name> <body>'"),
_("define macro <name> with value <body>"));
printHelpLine(_(" --eval '<name>+' "),
_("print the expansion of macro <name> to stdout"));
printHelpLine(_(" --pipe <cmd> "),
_("send stdout to <cmd>"));
printHelpLine(_(" --rcfile <file> "),
_("use <file> instead of /etc/rpmrc and $HOME/.rpmrc"));
printHelpLine( " --showrc ",
_("display final rpmrc and macro configuration"));
printHelpLine( " -v ",
_("be a little more verbose"));
printHelpLine( " -vv ",
_("be incredibly verbose (for debugging)"));
printHelpLine( " -q ",
_("query mode"));
printHelpLine(_(" --root <dir> "),
_("use <dir> as the top level directory"));
printHelpLine(_(" --dbpath <dir> "),
_("use <dir> as the directory for the database"));
printHelpLine(_(" --queryformat <qfmt>"),
_("use <qfmt> as the header format (implies -i)"));
puts( _(" install, upgrade and query (with -p) allow ftp URL's to be used in place"));
puts("");
puts( _(" Install, upgrade and query (with -p) allow URL's to be used in place"));
puts( _(" of file names as well as the following options:"));
printHelpLine(_(" --ftpproxy <host> "),
_("hostname or IP of ftp proxy"));
printHelpLine(_(" --ftpport <port> "),
_("port number of ftp server (or proxy)"));
printHelpLine(_(" --httpproxy <host> "),
printHelpLine(_(" --httpproxy <host> "),
_("hostname or IP of http proxy"));
printHelpLine(_(" --httpport <port> "),
printHelpLine(_(" --httpport <port> "),
_("port number of http server (or proxy)"));
puts("");
printHelpLine( " -q, --query ",
_("query mode"));
printHelpLine(_(" --dbpath <dir> "),
_("use <dir> as the directory for the database"));
printHelpLine(_(" --queryformat <qfmt>"),
_("use <qfmt> as the header format (implies --info)"));
printHelpLine(_(" --root <dir> "),
_("use <dir> as the top level directory"));
puts( _(" Package specification options:"));
printHelpLine( " -a ",
printHelpLine( " -a, --all ",
_("query all packages"));
printHelpLine(_(" -f <file>+ "),
_("query package owning <file>"));
@ -350,7 +375,7 @@ static void printHelp(void) {
printHelpLine(_(" --whatrequires <cap>"),
_("query packages which require <cap> capability"));
puts( _(" Information selection options:"));
printHelpLine( " -i ",
printHelpLine( " -i, --info ",
_("display package information"));
printHelpLine( " --changelog ",
_("display the package's change log"));
@ -366,19 +391,15 @@ static void printHelp(void) {
_("show all verifiable information for each file (must be used with -l, -c, or -d)"));
printHelpLine( " --provides ",
_("list capabilities package provides"));
puts( _(" --requires"));
printHelpLine( " -R ",
printHelpLine( " -R, --requires ",
_("list package dependencies"));
printHelpLine( " --scripts ",
_("print the various [un]install scripts"));
printHelpLine(" --triggers ",
printHelpLine( " --triggers ",
_("show the trigger scripts contained in the package"));
puts("");
puts( " -V");
puts( " -y");
printHelpLine(_(" --pipe <cmd> "),
_("send stdout to <cmd>"));
printHelpLine( " --verify ",
printHelpLine( " -V, -y, --verify ",
_("verify a package installation using the same same package specification options as -q"));
printHelpLine(_(" --dbpath <dir> "),
_("use <dir> as the directory for the database"));
@ -390,14 +411,9 @@ static void printHelp(void) {
_("do not verify file md5 checksums"));
printHelpLine( " --nofiles ",
_("do not verify file attributes"));
puts("");
printHelpLine( " --setperms ",
_("set the file permissions to those in the package database"
" using the same package specification options as -q"));
printHelpLine( " --setugids ",
_("set the file owner and group to those in the package "
"database using the same package specification options as "
"-q"));
printHelpLine( " --querytags ",
_("list the tags that can be used in a query format"));
puts("");
puts( _(" --install <packagefile>"));
printHelpLine(_(" -i <packagefile> "),
@ -406,8 +422,8 @@ static void printHelp(void) {
_("skip files in path <path>"));
printHelpLine(_(" --relocate <oldpath>=<newpath>"),
_("relocate files from <oldpath> to <newpath>"));
printHelpLine( " --badreloc",
_("relocate files even though the package doesn't allow it"));
printHelpLine( " --badreloc ",
_("relocate files in non-relocateable package"));
printHelpLine(_(" --prefix <dir> "),
_("relocate the package to <dir>, if relocatable"));
printHelpLine(_(" --dbpath <dir> "),
@ -416,8 +432,7 @@ static void printHelp(void) {
_("do not install documentation"));
printHelpLine( " --force ",
_("short hand for --replacepkgs --replacefiles"));
puts( " -h");
printHelpLine( " --hash ",
printHelpLine( " -h, --hash ",
_("print hash marks as package installs (good with -v)"));
printHelpLine( " --allfiles ",
_("install all files, even configurations which might "
@ -450,6 +465,7 @@ static void printHelp(void) {
_("use <dir> as the top level directory"));
printHelpLine( " --test ",
_("don't install, but tell if it would work or not"));
puts("");
puts( _(" --upgrade <packagefile>"));
printHelpLine(_(" -U <packagefile> "),
@ -497,7 +513,9 @@ static void printHelp(void) {
printHelpLine( " --clean ",
_("remove build tree when done"));
printHelpLine( " --rmsource ",
_("remove sources and spec file when done"));
_("remove sources when done"));
printHelpLine( " --rmspec ",
_("remove spec file when done"));
printHelpLine( " --sign ",
_("generate PGP/GPG signature"));
printHelpLine(_(" --buildroot <dir> "),
@ -511,16 +529,16 @@ static void printHelp(void) {
puts("");
printHelpLine(_(" --rebuild <src_pkg> "),
_("install source package, build binary package and remove spec file, sources, patches, and icons."));
printHelpLine(_(" --rmsource <spec> "),
_("remove sources and spec file"));
printHelpLine(_(" --recompile <src_pkg> "),
_("like --rebuild, but don't build any package"));
puts("");
printHelpLine(_(" --resign <pkg>+ "),
_("sign a package (discard current signature)"));
printHelpLine(_(" --addsign <pkg>+ "),
_("add a signature to a package"));
puts( " -K");
printHelpLine(_(" --checksig <pkg>+ "),
puts( _(" --checksig <pkg>+"));
printHelpLine(_(" -K <pkg>+ "),
_("verify package signature"));
printHelpLine( " --nopgp ",
_("skip any PGP signatures"));
@ -528,8 +546,8 @@ static void printHelp(void) {
_("skip any GPG signatures"));
printHelpLine( " --nomd5 ",
_("skip any MD5 signatures"));
printHelpLine( " --querytags ",
_("list the tags that can be used in a query format"));
puts("");
printHelpLine( " --initdb ",
_("make sure a valid database exists"));
printHelpLine( " --rebuilddb ",
@ -538,6 +556,15 @@ static void printHelp(void) {
_("use <dir> as the directory for the database"));
printHelpLine( " --root <dir> ",
_("use <dir> as the top level directory"));
puts("");
printHelpLine( " --setperms ",
_("set the file permissions to those in the package database"
" using the same package specification options as -q"));
printHelpLine( " --setugids ",
_("set the file owner and group to those in the package "
"database using the same package specification options as "
"-q"));
}
int main(int argc, const char ** argv)
@ -548,12 +575,13 @@ int main(int argc, const char ** argv)
enum rpmQVSources QVSource = RPMQV_PACKAGE;
int arg;
int installFlags = 0, uninstallFlags = 0, interfaceFlags = 0;
int gotDbpath = 0, verifyFlags;
#ifdef DYING
int gotDbpath = 0;
#endif
int verifyFlags;
int checksigFlags = 0;
unsigned long int timeCheck = 0L;
int addSign = NEW_SIGNATURE;
const char * specFile;
char * tce;
char * passPhrase = "";
char * cookie = NULL;
const char * optArg;
@ -584,10 +612,12 @@ int main(int argc, const char ** argv)
excldocs = 0;
force = 0;
_ftp_debug = 0;
#ifdef DYING
ftpProxy = NULL;
ftpPort = NULL;
httpProxy = NULL;
httpPort = NULL;
#endif
showHash = 0;
help = 0;
ignoreArch = 0;
@ -834,6 +864,7 @@ int main(int argc, const char ** argv)
signIt = 1;
break;
#ifdef DYING
case GETOPT_DBPATH:
switch (urlIsURL(optArg)) {
case URL_IS_UNKNOWN:
@ -847,6 +878,7 @@ int main(int argc, const char ** argv)
addMacro(&rpmCLIMacroContext, "_dbpath", NULL, optArg, RMIL_CMDLINE);
gotDbpath = 1;
break;
#endif /* DYING */
case GETOPT_DEFINEMACRO:
rpmDefineMacro(NULL, optArg, RMIL_CMDLINE);
@ -861,8 +893,10 @@ int main(int argc, const char ** argv)
noUsageMsg = 1;
} break;
#ifdef DYING
case GETOPT_TIMECHECK:
tce = NULL;
{ char * tce = NULL;
unsigned long int timeCheck = 0L;
timeCheck = strtoul(optArg, &tce, 10);
if ((*tce) || (tce == optArg) || (timeCheck == ULONG_MAX)) {
argerror("Argument to --timecheck must be integer");
@ -870,7 +904,8 @@ int main(int argc, const char ** argv)
addMacro(NULL, "_timecheck", NULL, optArg, RMIL_CMDLINE);
addMacro(&rpmCLIMacroContext, "_timecheck", NULL, optArg, RMIL_CMDLINE);
timeCheck = 1;
break;
} break;
#endif
case GETOPT_REBUILDDB:
if (bigMode != MODE_UNKNOWN && bigMode != MODE_REBUILDDB)
@ -953,12 +988,14 @@ int main(int argc, const char ** argv)
argerror("--buildroot may only be used during package builds");
}
#ifdef DYING
if (gotDbpath && (bigMode & ~MODES_FOR_DBPATH))
argerror(_("--dbpath given for operation that does not use a "
"database"));
if (timeCheck && (bigMode & ~MODES_FOR_TIMECHECK))
if (timeCheck && (bigMode & ~MODES_BT))
argerror(_("--timecheck may only be used during package builds"));
#endif
if (qva->qva_flags && (bigMode & ~MODES_QV))
argerror(_("unexpected query flags"));
@ -1081,6 +1118,7 @@ int main(int argc, const char ** argv)
if (oldPackage && !upgrade)
argerror(_("--oldpackage may only be used during upgrades"));
#ifdef DYING
if ((ftpProxy || ftpPort) && !(bigMode == MODE_INSTALL ||
((bigMode == MODE_QUERY && QVSource == RPMQV_RPM)) ||
((bigMode == MODE_VERIFY && QVSource == RPMQV_RPM))))
@ -1092,6 +1130,7 @@ int main(int argc, const char ** argv)
((bigMode == MODE_VERIFY && QVSource == RPMQV_RPM))))
argerror(_("http options can only be used during package queries, "
"installs, and upgrades"));
#endif /* DYING */
if (noPgp && bigMode != MODE_CHECKSIG)
argerror(_("--nopgp may only be used during signature checking"));
@ -1103,6 +1142,7 @@ int main(int argc, const char ** argv)
argerror(_("--nomd5 may only be used during signature checking and "
"package verification"));
#ifdef DYING
if (ftpProxy) {
addMacro(NULL, "_ftpproxy", NULL, ftpProxy, RMIL_CMDLINE);
addMacro(&rpmCLIMacroContext, "_ftpproxy", NULL, ftpProxy, RMIL_CMDLINE);
@ -1119,6 +1159,7 @@ int main(int argc, const char ** argv)
addMacro(NULL, "_httpport", NULL, httpPort, RMIL_CMDLINE);
addMacro(&rpmCLIMacroContext, "_httpport", NULL, httpPort, RMIL_CMDLINE);
}
#endif
if (signIt) {
if (bigMode == MODE_REBUILD || bigMode == MODE_BUILD ||

View File

@ -2,7 +2,7 @@ Summary: The Red Hat package management system.
Name: rpm
%define version 3.1
Version: %{version}
Release: 0.21
Release: 0.22
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz
Copyright: GPL
@ -141,6 +141,8 @@ fi
%dir /etc/rpm
/usr/bin/rpm2cpio
/usr/bin/gendiff
/usr/bin/rpmdb
/usr/bin/rpm[eiukqv]
/usr/lib/librpm.so.*
/usr/lib/librpmbuild.so.*
@ -155,6 +157,9 @@ fi
/usr/lib/rpm/freshen.sh
/usr/lib/rpm/macros
/usr/lib/rpm/mkinstalldirs
/usr/lib/rpm/rpmdb
/usr/lib/rpm/rpm[eiukqv]
/usr/lib/rpm/rpme
/usr/lib/rpm/rpmpopt
/usr/lib/rpm/rpmrc
/usr/lib/rpm/vpkg-provides.sh
@ -189,6 +194,7 @@ fi
%files build
%defattr(-,root,root)
/usr/bin/rpm[bt]
/usr/lib/rpm/check-prereqs
/usr/lib/rpm/cpanflute
/usr/lib/rpm/find-lang.sh
@ -201,6 +207,7 @@ fi
/usr/lib/rpm/magic.req
/usr/lib/rpm/perl.prov
/usr/lib/rpm/perl.req
/usr/lib/rpm/rpm[bt]
/usr/lib/rpm/rpmdiff
/usr/lib/rpm/rpmdiff.cgi
/usr/lib/rpm/rpmgettext
@ -236,6 +243,10 @@ fi
/usr/include/popt.h
%changelog
* Wed May 24 2000 Jeff Johnson <jbj@redhat.com>
- change popt exec alias in oreder to exec rpm children.
- split rpm into 5 pieces along major mode fault lines with popt glue.
* Thu May 18 2000 Jeff Johnson <jbj@redhat.com>
- 2nd try at db1 -> db3 stable functionality.

View File

@ -91,6 +91,100 @@ rpm alias --buildpolicy --define '__os_install_post @RPMCONFIGDIR@/brp-!#:+'
#
# There are two macros so that --rebuilddb can convert db1 -> db3
rpm alias --dbapi --define '_dbapi !#:+'
rpm alias --rebuilddbapi --define '_dbapi_rebuild !#:+'
rpm alias --rebuilddbapi --define '_dbapi_rebuild !#:+'
rpm alias --rebuilddbpath --define '_dbapath_rebuild !#:+'
#==============================================================================
# [--dbpath <dir>] "use <dir> as the directory for the database"
rpm alias --dbpath --define '_dbpath !#:+'
# [--ftpport <port>] "port number of ftp server (or proxy)"
rpm alias --ftpport --define '_ftpport !#:+'
# [--ftpproxy <host>] "hostname or IP of ftp proxy"
rpm alias --ftpproxy --define '_ftpproxy !#:+'
# [--httpport <port>] "port number of http server (or proxy)"
rpm alias --httpport --define '_httpport !#:+'
# [--httpproxy <host>] "hostname or IP of http proxy"
rpm alias --httpproxy --define '_httpproxy !#:+'
# set the time check to <secs>
rpm alias --timecheck --define '_timecheck !#:+'
#==============================================================================
rpm exec -b rpmb -b
rpm exec --build rpmb --build
rpm exec --rebuild rpmb --rebuild
rpm exec --recompile rpmb --recompile
rpm exec -t rpmt -t
rpm exec --tarbuild rpmt --tarbuild
rpm exec --initdb rpmdb --initdb
rpm exec --rebuilddb rpmdb --rebuilddb
#rpm exec -e rpme -e
#rpm exec --erase rpme --erase
#rpm exec -U rpmu -U
#rpm exec --upgrade rpmu --upgrade
rpm exec --addsign rpmk --addsign
rpm exec -K rpmk -K
rpm exec --checksig rpmk --checksig
rpm exec --resign rpmk --resign
rpm exec -q rpmq -q
rpm exec --query rpmq --query
rpm exec --querytags rpmq --querytags
rpm exec -V rpmv -V
rpm exec -y rpmv -y
rpm exec --verify rpmv --verify
#==============================================================================
rpmb alias --dbpath --define '_dbpath !#:+'
rpmb alias --ftpport --define '_ftpport !#:+'
rpmb alias --ftpproxy --define '_ftpproxy !#:+'
rpmb alias --httpport --define '_httpport !#:+'
rpmb alias --httpproxy --define '_httpproxy !#:+'
rpmb alias --timecheck --define '_timecheck !#:+'
#==============================================================================
rpmdb alias --dbpath --define '_dbpath !#:+'
rpmdb alias --ftpport --define '_ftpport !#:+'
rpmdb alias --ftpproxy --define '_ftpproxy !#:+'
rpmdb alias --httpport --define '_httpport !#:+'
rpmdb alias --httpproxy --define '_httpproxy !#:+'
#==============================================================================
rpme alias --dbpath --define '_dbpath !#:+'
rpme alias --ftpport --define '_ftpport !#:+'
rpme alias --ftpproxy --define '_ftpproxy !#:+'
rpme alias --httpport --define '_httpport !#:+'
rpme alias --httpproxy --define '_httpproxy !#:+'
#==============================================================================
rpmi alias --dbpath --define '_dbpath !#:+'
rpmi alias --ftpport --define '_ftpport !#:+'
rpmi alias --ftpproxy --define '_ftpproxy !#:+'
rpmi alias --httpport --define '_httpport !#:+'
rpmi alias --httpproxy --define '_httpproxy !#:+'
#==============================================================================
rpmq alias --dbpath --define '_dbpath !#:+'
rpmq alias --ftpport --define '_ftpport !#:+'
rpmq alias --ftpproxy --define '_ftpproxy !#:+'
rpmq alias --httpport --define '_httpport !#:+'
rpmq alias --httpproxy --define '_httpproxy !#:+'
#==============================================================================
rpmt alias --dbpath --define '_dbpath !#:+'
rpmt alias --ftpport --define '_ftpport !#:+'
rpmt alias --ftpproxy --define '_ftpproxy !#:+'
rpmt alias --httpport --define '_httpport !#:+'
rpmt alias --httpproxy --define '_httpproxy !#:+'
rpmt alias --timecheck --define '_timecheck !#:+'
#==============================================================================
rpmu alias --dbpath --define '_dbpath !#:+'
rpmu alias --ftpport --define '_ftpport !#:+'
rpmu alias --ftpproxy --define '_ftpproxy !#:+'
rpmu alias --httpport --define '_httpport !#:+'
rpmu alias --httpproxy --define '_httpproxy !#:+'
#==============================================================================
rpmv alias --dbpath --define '_dbpath !#:+'
rpmv alias --ftpport --define '_ftpport !#:+'
rpmv alias --ftpproxy --define '_ftpproxy !#:+'
rpmv alias --httpport --define '_httpport !#:+'
rpmv alias --httpproxy --define '_httpproxy !#:+'

1266
rpmqv.c

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,11 @@
# specified (i.e. filenames with " specified). I'm sure some shell-hacker
# out there can fix that <hint, hint>.
if [ $1 = ";" ]; then
RPM=rpm
shift
else
RPM=$1
shift 2
fi
case `basename $0` in
rpme|rpmi|rpmu) rpm="$0" ;;
*) rpm="`dirname $0`/rpmi" ;;
esac
shift
args="-U"
while [ $# -gt 0 ]; do

View File

@ -221,6 +221,9 @@ void *vmefail(size_t size);
/* Retrofit glibc __progname */
#if defined __GLIBC__ && __GLIBC__ >= 2
#if __GLIBC_MINOR__ >= 1
#define __progname __assert_program_name
#endif
#define setprogname(pn)
#else
#define __progname program_name
@ -229,7 +232,7 @@ void *vmefail(size_t size);
else __progname = pn; \
}
#endif
char *__progname;
const char *__progname;
#if HAVE_NETDB_H
#ifndef __LCLINT__