Fix newSpec in "rpm -q --specfile --specedit"

CVS patchset: 2892
CVS date: 1999/03/16 20:04:26
This commit is contained in:
jbj 1999-03-16 20:04:26 +00:00
parent 776dc9c258
commit ca9dc63de9
17 changed files with 383 additions and 349 deletions

29
GROUPS Normal file
View File

@ -0,0 +1,29 @@
Amusements/Games
Amusements/Graphics
Applications/Archiving
Applications/Communications
Applications/Databases
Applications/Editors
Applications/Emulators
Applications/Engineering
Applications/File
Applications/Internet
Applications/Multimedia
Applications/Productivity
Applications/Publishing
Applications/System
Applications/Text
Development/Debuggers
Development/Languages
Development/Libraries
Development/System
Development/Tools
Documentation
System Environment/Base
System Environment/Daemons
System Environment/Kernel
System Environment/Libraries
System Environment/Shells
User Interface/Desktops
User Interface/X
User Interface/X Hardware Support

4
aclocal.m4 vendored
View File

@ -1,4 +1,4 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl aclocal.m4 generated automatically by aclocal 1.4a
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
@ -21,6 +21,8 @@ dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AC_PROG_INSTALL])
dnl We require 2.13 because we rely on SHELL being computed by configure.
AC_PREREQ([2.13])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]

View File

@ -379,12 +379,8 @@ int parseSpec(Spec *specp, const char *specFile, const char *buildRoot,
}
if (parsePart == PART_BUILDARCHITECTURES) {
#if 0 /* XXX W2DO??? */
spec->buildArchitectureSpecs =
malloc(sizeof(Spec) * spec->buildArchitectureCount);
#else
spec->buildArchitectureSpecs = newSpec();
#endif
index = 0;
for (x = 0; x < spec->buildArchitectureCount; x++) {
if (rpmMachineScore(RPM_MACHTABLE_BUILDARCH,
@ -411,7 +407,12 @@ int parseSpec(Spec *specp, const char *specFile, const char *buildRoot,
return RPMERR_BADSPEC;
}
/* XXX HACK: swap BuildArch sl/st with child */
/* XXX HACK: Swap sl/st with child.
* The restart of the parse when encountering BuildArch
* causes problems for "rpm -q --specfile --specedit"
* which needs to keep track of the entire spec file.
*/
if (spec->sl && spec->st) {
Spec nspec = *spec->buildArchitectureSpecs;
struct speclines *sl = spec->sl;

View File

@ -8,13 +8,13 @@
#include "rpmlead.h"
#include "signature.h"
int doReSign(int add, char *passPhrase, char **argv)
int doReSign(int add, char *passPhrase, const char **argv)
{
FD_t fd, ofd;
int count;
struct rpmlead lead;
unsigned short sigtype;
char *rpm;
const char *rpm;
const char *sigtarget;
char tmprpm[1024];
unsigned char buffer[8192];
@ -142,12 +142,12 @@ int doReSign(int add, char *passPhrase, char **argv)
return 0;
}
int doCheckSig(int flags, char **argv)
int doCheckSig(int flags, const char **argv)
{
FD_t fd, ofd;
int res, res2, res3;
struct rpmlead lead;
char *rpm;
const char *rpm;
char result[1024];
const char * sigtarget;
unsigned char buffer[8192];

View File

@ -5,8 +5,8 @@
#define CHECKSIG_MD5 (1 << 1)
#define CHECKSIG_GPG (1 << 2)
int doCheckSig(int flags, char **argv);
int doReSign(int add, char *passPhrase, char **argv);
int doCheckSig(int flags, const char **argv);
int doReSign(int add, char *passPhrase, const char **argv);
#define ADD_SIGNATURE 1
#define NEW_SIGNATURE 0

View File

@ -416,6 +416,7 @@ AC_REPLACE_FUNCS(strdup strerror strtol strtoul strspn strstr)
dnl XXX stpcpy/stpncpy needed by rpmgettext
AC_REPLACE_FUNCS(stpcpy stpncpy strcasecmp strncasecmp strcspn)
AC_REPLACE_FUNCS(basename)
AC_CHECK_FUNCS(setlocale)

View File

@ -7,6 +7,7 @@
#include "falloc.h"
#include "oldrpmdb.h"
#include "oldheader.h"
#include "lib/rpmdb.h"
int convertDB(void);

View File

@ -115,7 +115,6 @@ static int assembleFileList(Header h, struct fileMemory * mem,
struct fileInfo * file;
int fileCount;
int i;
char * chptr;
if (!headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &mem->names,
fileCountPtr))

View File

@ -1053,32 +1053,31 @@ int rpmGetBooleanVar(int var) {
return 0;
}
void rpmSetVar(int var, const char *val) {
freeRpmVar(&values[var]);
values[var].arch = NULL;
values[var].next = NULL;
if (val)
values[var].value = strdup(val);
else
values[var].value = NULL;
}
/* this doesn't free the passed pointer! */
static void freeRpmVar(struct rpmvarValue * orig) {
struct rpmvarValue * next, * var = orig;
while (var) {
next = var->next;
if (var->arch) free(var->arch);
if (var->value) free(var->value);
if (var->arch) {
free(var->arch);
var->arch = NULL;
}
if (var->value) {
free(var->value);
var->value = NULL;
}
if (var != orig) free(var);
var = next;
}
}
void rpmSetVar(int var, const char *val) {
freeRpmVar(&values[var]);
values[var].value = (val ? strdup(val) : NULL);
}
static void rpmSetVarArch(int var, char * val, char * arch) {
struct rpmvarValue * next = values + var;
@ -1106,10 +1105,7 @@ static void rpmSetVarArch(int var, char * val, char * arch) {
}
next->value = strdup(val);
if (arch)
next->arch = strdup(arch);
else
next->arch = NULL;
next->arch = (arch ? strdup(arch) : NULL);
}
void rpmSetTables(int archTable, int osTable) {

View File

@ -17,7 +17,8 @@ struct fileInfo {
enum fileActions * actions;
fingerPrint * fps;
uint_32 * fflags;
char ** fl, ** fmd5s;
const char ** fl;
char ** fmd5s;
uint_16 * fmodes;
Header h;
int fc;
@ -32,7 +33,7 @@ struct fileInfo {
static rpmProblemSet psCreate(void);
static void psAppend(rpmProblemSet probs, rpmProblemType type,
const void * key, Header h, char * str1,
const void * key, Header h, const char * str1,
Header altHeader);
static int archOkay(Header h);
static int osOkay(Header h);
@ -42,7 +43,7 @@ static Header relocateFileList(struct availablePackage * alp,
int allowBadRelocate);
static int psTrim(rpmProblemSet filter, rpmProblemSet target);
static int sharedCmp(const void * one, const void * two);
static enum fileActions decideFileFate(char * filespec, short dbMode,
static enum fileActions decideFileFate(const char * filespec, short dbMode,
char * dbMd5, char * dbLink, short newMode,
char * newMd5, char * newLink, int newFlags,
int brokenMd5);
@ -519,7 +520,7 @@ static rpmProblemSet psCreate(void) {
}
static void psAppend(rpmProblemSet probs, rpmProblemType type,
const void * key, Header h, char * str1, Header altH) {
const void * key, Header h, const char * str1, Header altH) {
if (probs->numProblems == probs->numProblemsAlloced) {
if (probs->numProblemsAlloced)
probs->numProblemsAlloced *= 2;
@ -797,7 +798,7 @@ static int sharedCmp(const void * one, const void * two) {
return 0;
}
static enum fileActions decideFileFate(char * filespec, short dbMode,
static enum fileActions decideFileFate(const char * filespec, short dbMode,
char * dbMd5, char * dbLink, short newMode,
char * newMd5, char * newLink, int newFlags,
int brokenMd5) {

View File

@ -5,13 +5,13 @@ AUTOMAKE_OPTIONS = 1.4 foreign
INCLUDES = -I$(top_srcdir) @INCPATH@
EXTRA_DIST = \
alloca.c error.c fakefork.c fnmatch.c \
getcwd.c getmntent.c getwd.c glob.c \
inet_aton.c memcmp.c mktime.c myrealloc.c \
putenv.c realpath.c stpcpy.c stpncpy.c \
strcasecmp.c strncasecmp.c strcspn.c strdup.c \
strerror.c strftime.c strcspn.c strstr.c \
strtol.c strtoul.c
alloca.c basename.c error.c fakefork.c \
fnmatch.c getcwd.c getmntent.c getwd.c \
glob.c inet_aton.c memcmp.c mktime.c \
myrealloc.c putenv.c realpath.c stpcpy.c \
stpncpy.c strcasecmp.c strncasecmp.c strcspn.c \
strdup.c strerror.c strftime.c strcspn.c \
strstr.c strtol.c strtoul.c
noinst_HEADERS = \
error.h fnmatch.h glob.h \

13
misc/basename.c Normal file
View File

@ -0,0 +1,13 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
char *
basename(const char *file)
{
char *fn = strrchr(file, '/');
return fn ? fn+1 : (char *)file;
}

File diff suppressed because it is too large Load Diff

9
rpm.c
View File

@ -147,9 +147,6 @@ static struct poptOption optionsTable[] = {
{ 0, 0, 0, 0, 0, NULL, NULL }
};
static void argerror(char * desc);
static void argerror(char * desc) {
fprintf(stderr, _("rpm: %s\n"), desc);
exit(EXIT_FAILURE);
@ -508,8 +505,8 @@ int main(int argc, char ** argv) {
char * cookie = NULL;
char * optArg;
pid_t pipeChild = 0;
char * pkg;
char * errString;
const char * pkg;
char * errString = NULL;
poptContext optCon;
char * infoCommand[] = { "--info", NULL };
char * installCommand[] = { "--install", NULL };
@ -1093,7 +1090,7 @@ int main(int argc, char ** argv) {
if (signIt) {
if (bigMode == MODE_REBUILD || bigMode == MODE_BUILD ||
bigMode == MODE_RESIGN || bigMode == MODE_TARBUILD) {
char ** argv;
const char ** argv;
struct stat sb;
int errors = 0;

View File

@ -2,7 +2,7 @@ Summary: The Red Hat package management system.
Name: rpm
%define version 2.92
Version: %{version}
Release: 8
Release: 9
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-2.5.x/rpm-%{version}.tar.gz
Copyright: GPL
@ -58,7 +58,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc RPM-PGP-KEY CHANGES groups
%doc RPM-PGP-KEY CHANGES GROUPS
%doc docs/*
/bin/rpm
/usr/bin/rpm2cpio

View File

@ -1,4 +1,4 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@ -48,9 +48,10 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
@ -192,7 +193,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@ -221,7 +222,7 @@ uninstall: uninstall-am
all-am: Makefile $(SCRIPTS)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(configdir)

View File

@ -42,13 +42,6 @@ int gentran = 0;
int specedit = 0;
static inline char *
basename(const char *file)
{
char *fn = strrchr(file, '/');
return fn ? fn+1 : (char *)file;
}
static const char *
getTagString(int tval)
{