Retrofit glibc __progname.
CVS patchset: 3330 CVS date: 1999/09/26 15:04:03
This commit is contained in:
parent
0464b19302
commit
e60094b302
|
@ -11,7 +11,8 @@
|
|||
|
||||
int convertDB(void);
|
||||
|
||||
int convertDB(void) {
|
||||
int convertDB(void)
|
||||
{
|
||||
struct oldrpmdb olddb;
|
||||
rpmdb db;
|
||||
struct oldrpmdbLabel * packageLabels, * label;
|
||||
|
@ -196,7 +197,9 @@ int convertDB(void) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
setprogname(argv[0]);
|
||||
if (argc != 1) {
|
||||
fprintf(stderr, _("rpmconvert: no arguments expected"));
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
@ -292,9 +292,9 @@ static void parseEVR(char *evr, /*@exposed@*/ /*@out@*/const char **ep, /*@expos
|
|||
if (rp) *rp = release;
|
||||
}
|
||||
|
||||
static char *rpmName = PACKAGE;
|
||||
static char *rpmEVR = VERSION;
|
||||
static int rpmFlags = RPMSENSE_EQUAL;
|
||||
const char *rpmNAME = PACKAGE;
|
||||
const char *rpmEVR = VERSION;
|
||||
int rpmFLAGS = RPMSENSE_EQUAL;
|
||||
|
||||
static int rangesOverlap(const char *AName, const char *AEVR, int AFlags,
|
||||
const char *BName, const char *BEVR, int BFlags)
|
||||
|
@ -826,8 +826,8 @@ static int unsatisfiedDepend(rpmTransactionSet rpmdep,
|
|||
* version. Provide implicit rpm version in last ditch effort to
|
||||
* satisfy an rpm dependency.
|
||||
*/
|
||||
if (!strcmp(keyName, rpmName)) {
|
||||
i = rangesOverlap(keyName, keyEVR, keyFlags, rpmName, rpmEVR, rpmFlags);
|
||||
if (!strcmp(keyName, rpmNAME)) {
|
||||
i = rangesOverlap(keyName, keyEVR, keyFlags, rpmNAME, rpmEVR, rpmFLAGS);
|
||||
if (i) {
|
||||
rpmMessage(RPMMESS_DEBUG, _("%s: %s satisfied by rpmlib version.\n"), keyType, keyDepend);
|
||||
goto exit;
|
||||
|
|
18
misc/err.c
18
misc/err.c
|
@ -17,19 +17,21 @@
|
|||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <err.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "system.h"
|
||||
|
||||
#ifdef USE_IN_LIBIO
|
||||
#ifdef HAVE_LIBIO
|
||||
#define flockfile(s) _IO_flockfile (s)
|
||||
#define funlockfile(s) _IO_funlockfile (s)
|
||||
#else
|
||||
#define flockfile(s)
|
||||
#define funlockfile(s)
|
||||
#define putc_unlocked(c,fp) putc(c,fp);
|
||||
#define fputs_unlocked(s,fp) fputs(s,fp);
|
||||
#define __set_errno(error) errno = error
|
||||
#define __ptr_t void *
|
||||
#endif
|
||||
|
||||
extern char *__progname;
|
||||
#include <err.h>
|
||||
|
||||
#define VA(call) \
|
||||
{ \
|
||||
|
|
548
po/rpm.pot
548
po/rpm.pot
File diff suppressed because it is too large
Load Diff
18
rpm.c
18
rpm.c
|
@ -20,8 +20,6 @@
|
|||
#define GETOPT_DEFINEMACRO 1020
|
||||
#define GETOPT_EVALMACRO 1021
|
||||
|
||||
char * version = VERSION;
|
||||
|
||||
enum modes { MODE_QUERY, MODE_INSTALL, MODE_UNINSTALL, MODE_VERIFY,
|
||||
MODE_BUILD, MODE_REBUILD, MODE_CHECKSIG, MODE_RESIGN,
|
||||
MODE_RECOMPILE, MODE_QUERYTAGS, MODE_INITDB, MODE_TARBUILD,
|
||||
|
@ -67,7 +65,10 @@ static int showrc;
|
|||
static int signIt;
|
||||
static int test;
|
||||
|
||||
static int rpm_version;
|
||||
static int showVersion;
|
||||
extern const char * rpmNAME;
|
||||
extern const char * rpmEVR;
|
||||
extern int rpmFLAGS;
|
||||
|
||||
static struct rpmQVArguments rpmQVArgs;
|
||||
static struct rpmBuildArguments buildArgs;
|
||||
|
@ -137,7 +138,7 @@ static struct poptOption optionsTable[] = {
|
|||
{ "verbose", 'v', 0, 0, 'v', NULL, NULL},
|
||||
{ "verify", 'V', 0, 0, 'V', NULL, NULL},
|
||||
{ NULL, 'y', 0, 0, 'V', NULL, NULL},
|
||||
{ "version", '\0', 0, &rpm_version, 0, NULL, NULL},
|
||||
{ "version", '\0', 0, &showVersion, 0, NULL, NULL},
|
||||
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE,
|
||||
rpmQVSourcePoptTable, 0, (void *) &rpmQVArgs, NULL },
|
||||
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE,
|
||||
|
@ -166,7 +167,7 @@ static void printUsage(void);
|
|||
static void printHelpLine(char * prefix, char * help);
|
||||
|
||||
static void printVersion(void) {
|
||||
fprintf(stdout, _("RPM version %s\n"), version);
|
||||
fprintf(stdout, _("RPM version %s\n"), rpmEVR);
|
||||
}
|
||||
|
||||
static void printBanner(void) {
|
||||
|
@ -532,6 +533,7 @@ int main(int argc, char ** argv)
|
|||
#if HAVE_MCHECK_H && HAVE_MTRACE
|
||||
mtrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */
|
||||
#endif
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
|
||||
/* set the defaults for the various command line options */
|
||||
allFiles = 0;
|
||||
|
@ -571,7 +573,7 @@ int main(int argc, char ** argv)
|
|||
showrc = 0;
|
||||
signIt = 0;
|
||||
test = 0;
|
||||
rpm_version = 0;
|
||||
showVersion = 0;
|
||||
|
||||
/* XXX Eliminate query linkage loop */
|
||||
parseSpecVec = parseSpec;
|
||||
|
@ -848,7 +850,7 @@ int main(int argc, char ** argv)
|
|||
if (quiet)
|
||||
rpmSetVerbosity(RPMMESS_QUIET);
|
||||
|
||||
if (rpm_version) printVersion();
|
||||
if (showVersion) printVersion();
|
||||
if (help) printHelp();
|
||||
|
||||
if (arg < -1) {
|
||||
|
@ -1123,7 +1125,7 @@ int main(int argc, char ** argv)
|
|||
|
||||
switch (bigMode) {
|
||||
case MODE_UNKNOWN:
|
||||
if (!rpm_version && !help && !noUsageMsg) printUsage();
|
||||
if (!showVersion && !help && !noUsageMsg) printUsage();
|
||||
break;
|
||||
|
||||
case MODE_REBUILDDB:
|
||||
|
|
10
rpm2cpio.c
10
rpm2cpio.c
|
@ -4,15 +4,6 @@
|
|||
|
||||
#include "rpmlib.h"
|
||||
|
||||
char *zlib_err [] = {
|
||||
"No",
|
||||
"Unix",
|
||||
"Data",
|
||||
"Memory",
|
||||
"Buffer",
|
||||
"Version"
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
FD_t fdi, fdo;
|
||||
|
@ -22,6 +13,7 @@ int main(int argc, char **argv)
|
|||
int ct;
|
||||
FD_t gzdi;
|
||||
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
if (argc == 1) {
|
||||
fdi = fdDup(STDIN_FILENO);
|
||||
} else {
|
||||
|
|
19
system.h
19
system.h
|
@ -203,20 +203,25 @@ void *vmefail(void);
|
|||
#endif
|
||||
|
||||
|
||||
#if HAVE_MCHECK_H && defined(__GNUC__)
|
||||
|
||||
/* Memory allocation via macro defs to get meaningful locations from mtrace() */
|
||||
|
||||
#if HAVE_MCHECK_H && defined(__GNUC__)
|
||||
#define xmalloc(_size) (malloc(_size) ? : vmefail())
|
||||
|
||||
#define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail())
|
||||
|
||||
#define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail())
|
||||
|
||||
#define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str)))
|
||||
|
||||
#endif /* HAVE_MCHECK_H && defined(__GNUC__) */
|
||||
|
||||
/* Retrofit glibc __progname */
|
||||
char *__progname;
|
||||
#if defined __GLIBC__ && __GLIBC__ >= 2
|
||||
#define setprogname(pn)
|
||||
#else
|
||||
#define setprogname(pn) \
|
||||
{ if ((__progname = strrchr(pn, '/')) __progname++; \
|
||||
else __progname = pn; \
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAVE_NETDB_H
|
||||
#ifndef __LCLINT__
|
||||
#include <netdb.h>
|
||||
|
|
|
@ -7,6 +7,7 @@ int main(int argc, char ** argv)
|
|||
Header h;
|
||||
FD_t fdi;
|
||||
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
if (argc == 1) {
|
||||
fdi = fdDup(STDIN_FILENO);
|
||||
} else {
|
||||
|
|
|
@ -10,6 +10,7 @@ int main(int argc, char ** argv)
|
|||
int blockNum = 0;
|
||||
rpmdb db;
|
||||
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
rpmReadConfigFiles(NULL, NULL);
|
||||
|
||||
if (argc == 2) {
|
||||
|
|
|
@ -14,6 +14,7 @@ int main(int argc, char **argv)
|
|||
Header hd;
|
||||
int ct;
|
||||
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
if (argc == 1) {
|
||||
fdi = fdDup(STDIN_FILENO);
|
||||
} else {
|
||||
|
|
|
@ -15,6 +15,7 @@ int main(int argc, char **argv)
|
|||
char result[1024];
|
||||
int res;
|
||||
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
if (argc == 1) {
|
||||
fd = 0;
|
||||
} else {
|
||||
|
|
|
@ -32,7 +32,6 @@ static void dpf(char *format, ...)
|
|||
#define DPRINTF(_lvl, _fmt)
|
||||
#endif
|
||||
|
||||
const char *program_name = NULL;
|
||||
int debug = MYDEBUG;
|
||||
int verbose = 0;
|
||||
char *inputdir = NULL;
|
||||
|
@ -994,7 +993,7 @@ main(int argc, char **argv)
|
|||
int errflg = 0;
|
||||
FD_t fdi;
|
||||
|
||||
program_name = basename(argv[0]);
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
|
||||
while((c = getopt(argc, argv, "degEMl:C:I:O:Tv")) != EOF)
|
||||
switch (c) {
|
||||
|
@ -1047,7 +1046,7 @@ main(int argc, char **argv)
|
|||
|
||||
fdi = fdDup(STDIN_FILENO);
|
||||
|
||||
if (!strcmp(program_name, RPMGETTEXT)) {
|
||||
if (!strcmp(__progname, RPMGETTEXT)) {
|
||||
if (optind == argc) {
|
||||
rc = rpmgettext(fdi, STDINFN, stdout);
|
||||
} else {
|
||||
|
@ -1056,15 +1055,15 @@ main(int argc, char **argv)
|
|||
break;
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(program_name, RPMPUTTEXT)) {
|
||||
} else if (!strcmp(__progname, RPMPUTTEXT)) {
|
||||
if (mastercatalogue == NULL) {
|
||||
fprintf(stderr, _("%s: must specify master PO catalogue with -C\n"),
|
||||
program_name);
|
||||
__progname);
|
||||
exit(1);
|
||||
}
|
||||
if (optind == argc) {
|
||||
fprintf(stderr, _("%s: no binary rpms on cmd line\n"),
|
||||
program_name);
|
||||
__progname);
|
||||
exit(1);
|
||||
} else {
|
||||
string_list_ty *drillp = string_list_alloc();
|
||||
|
@ -1074,7 +1073,7 @@ main(int argc, char **argv)
|
|||
rc = rpmputtext(fdi, mastercatalogue, stdout, drillp);
|
||||
string_list_free(drillp);
|
||||
}
|
||||
} else if (!strcmp(program_name, RPMCHKTEXT)) {
|
||||
} else if (!strcmp(__progname, RPMCHKTEXT)) {
|
||||
if (optind == argc) {
|
||||
rc = rpmchktext(fdi, STDINFN, stdout);
|
||||
} else {
|
||||
|
|
|
@ -13,6 +13,7 @@ int main(int argc, char **argv)
|
|||
Header hd;
|
||||
int rc;
|
||||
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
if (argc == 1) {
|
||||
fdi = fdDup(STDIN_FILENO);
|
||||
} else {
|
||||
|
|
|
@ -527,6 +527,7 @@ main(int argc, char *argv[])
|
|||
int ec = 0;
|
||||
injmode_t lastmode = INJ_UNKNOWN;
|
||||
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
(void)setlocale(LC_ALL, "" );
|
||||
|
||||
#ifdef __LCLINT__
|
||||
|
|
|
@ -10,6 +10,7 @@ int main(int argc, char **argv)
|
|||
FD_t fdi, fdo;
|
||||
struct rpmlead lead;
|
||||
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
if (argc == 1) {
|
||||
fdi = fdDup(STDIN_FILENO);
|
||||
} else {
|
||||
|
|
|
@ -11,6 +11,7 @@ int main(int argc, char **argv)
|
|||
struct rpmlead lead;
|
||||
Header sig;
|
||||
|
||||
setprogname(argv[0]); /* Retrofit glibc __progname */
|
||||
if (argc == 1) {
|
||||
fdi = fdDup(STDIN_FILENO);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue