- package version now configureable, default v3.

- rename rpm libraries to have version with libtool -release.
- fix: -i CLI context broken Yet Again.

CVS patchset: 4930
CVS date: 2001/07/10 17:59:11
This commit is contained in:
jbj 2001-07-10 17:59:11 +00:00
parent f440f450d9
commit e15b4593eb
11 changed files with 82 additions and 32 deletions

View File

@ -154,8 +154,10 @@
- glibc-2.0.x has not __va_copy().
- popthelp.c: don't use stpcpy to avoid portability grief (#47500).
- permit alias/exec description/arg text to be set from popt config.
- use rpmqv.c, not rpm.c, as rpm's main() routine.
- python: rhnLoad/rhnUnload to check header digest.
- package version now configureable, default v3.
- rename rpm libraries to have version with libtool -release.
- fix: -i CLI context broken Yet Again.
4.0 -> 4.0.[12]
- add doxygen and lclint annotations most everywhere.

View File

@ -21,6 +21,7 @@ librpmbuild_la_SOURCES = \
parseBuildInstallClean.c parseChangelog.c parseDescription.c \
parseFiles.c parsePreamble.c parsePrep.c parseReqs.c parseScript.c \
parseSpec.c reqprov.c spec.c
librpmbuild_la_LDFLAGS = -release @VERSION@
# XXX Add internal libtool dependence
install-data-local:

View File

@ -337,6 +337,29 @@ static unsigned char header_magic[8] = {
0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00
};
#define RPMPKGVERSION_MIN 30004
#define RPMPKGVERSION_MAX 40003
static int rpmpkg_version = -1;
static int rpmLeadVersion(void)
{
int rpmlead_version;
/* Intitialize packaging version from macro configuration. */
if (rpmpkg_version < 0) {
rpmpkg_version = rpmExpandNumeric("%{_package_version}");
if (rpmpkg_version < RPMPKGVERSION_MIN)
rpmpkg_version = RPMPKGVERSION_MIN;
if (rpmpkg_version > RPMPKGVERSION_MAX)
rpmpkg_version = RPMPKGVERSION_MAX;
}
rpmlead_version = rpmpkg_version / 10000;
if (_noDirTokens || (rpmlead_version < 3 || rpmlead_version > 4))
rpmlead_version = 3;
return rpmlead_version;
}
int writeRPM(Header *hdrp, const char *fileName, int type,
CSA_t csa, char *passPhrase, const char **cookie)
{
@ -523,8 +546,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type,
}
memset(&lead, 0, sizeof(lead));
/* XXX Set package version conditioned on noDirTokens. */
lead.major = (_noDirTokens ? 3 : 4);
lead.major = rpmLeadVersion();
lead.minor = 0;
lead.type = type;
lead.archnum = archnum;

View File

@ -39,6 +39,7 @@ librpm_la_SOURCES = \
rpmchecksig.c rpminstall.c rpmlead.c rpmlibprov.c rpmrc.c rpmvercmp.c \
signature.c stringbuf.c tagName.c tagtable.c transaction.c \
verify.c
librpm_la_LDFLAGS = -release @VERSION@
# XXX Add internal libtool dependence
install-data-local:

View File

@ -104,7 +104,8 @@ struct poptOption rpmInstallPoptTable[] = {
{ "dirstash", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
&rpmIArgs.transFlags, RPMTRANS_FLAG_DIRSTASH,
N_("save erased package files by renaming into sub-directory"), NULL},
{ "erase", 'e', 0, 0, 'e',
{ "erase", 'e', POPT_BIT_SET,
&rpmIArgs.installInterfaceFlags, INSTALL_ERASE,
N_("erase (uninstall) package"), N_("<package>+") },
{ "excludedocs", '\0', POPT_BIT_SET,
&rpmIArgs.transFlags, RPMTRANS_FLAG_NODOCS,
@ -116,7 +117,7 @@ struct poptOption rpmInstallPoptTable[] = {
(RPMPROB_FILTER_REPLACEPKG | RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES | RPMPROB_FILTER_OLDPACKAGE),
N_("short hand for --replacepkgs --replacefiles"), NULL},
{ "freshen", 'F', POPT_BIT_SET, &rpmIArgs.installInterfaceFlags,
(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_NOERASE),
(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL),
N_("upgrade package(s) if already installed"),
N_("<packagefile>+") },
{ "hash", 'h', POPT_BIT_SET, &rpmIArgs.installInterfaceFlags, INSTALL_HASH,
@ -133,7 +134,7 @@ struct poptOption rpmInstallPoptTable[] = {
{ "includedocs", '\0', 0, &rpmIArgs.incldocs, 0,
N_("install documentation"), NULL},
{ "install", '\0', POPT_BIT_SET,
&rpmIArgs.installInterfaceFlags, INSTALL_NOERASE,
&rpmIArgs.installInterfaceFlags, INSTALL_INSTALL,
N_("install package"), N_("<packagefile>+") },
{ "justdb", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, RPMTRANS_FLAG_JUSTDB,
N_("update the database, but do not modify the filesystem"), NULL},
@ -204,7 +205,7 @@ struct poptOption rpmInstallPoptTable[] = {
{ "test", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, RPMTRANS_FLAG_TEST,
N_("don't install, but tell if it would work or not"), NULL},
{ "upgrade", 'U', POPT_BIT_SET,
&rpmIArgs.installInterfaceFlags, (INSTALL_UPGRADE|INSTALL_NOERASE),
&rpmIArgs.installInterfaceFlags, (INSTALL_UPGRADE|INSTALL_INSTALL),
N_("upgrade package(s)"),
N_("<packagefile>+") },

View File

@ -1633,10 +1633,8 @@ typedef enum rpmInstallInterfaceFlags_e {
INSTALL_LABEL = (1 << 4), /*!< from --verbose (notify) */
INSTALL_UPGRADE = (1 << 5), /*!< from --upgrade */
INSTALL_FRESHEN = (1 << 6), /*!< from --freshen */
INSTALL_NOERASE = (1 << 7), /*!< from --install */
/*@-enummemuse@*/
INSTALL_INSTALL = (1 << 7), /*!< from --install */
INSTALL_ERASE = (1 << 8) /*!< from --erase */
/*@=enummemuse@*/
} rpmInstallInterfaceFlags;
/** \ingroup rpmcli

View File

@ -1,7 +1,7 @@
#/*! \page config_macros Default configuration: /usr/lib/rpm/macros
# \verbatim
#
# $Id: macros.in,v 1.83 2001/06/21 03:51:35 jbj Exp $
# $Id: macros.in,v 1.84 2001/07/10 17:59:11 jbj Exp $
#
# This is a global RPM configuration file. All changes made here will
# be lost when the rpm package is upgraded. Any per-system configuration
@ -90,14 +90,13 @@
# These are the default values that can be overridden by other
# (e.g. per-platform, per-system, per-packager, per-package) macros.
#
#
# The directory where sources/patches will be unpacked and built.
%_builddir %{_topdir}/BUILD
# The interpreter used for build scriptlets.
%_buildshell /bin/sh
# The path to the bzip2 executable (legacy).
# The path to the bzip2 executable (legacy, use %{__bzip2} instead).
%_bzip2bin %{__bzip2}
# The location of the rpm database file(s).
@ -119,7 +118,7 @@
# fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
# These macros are necessary only for legacy compatibility, and have moved
# to per-platform macro configuration (i.e. /usr/lib/rpm/<arch>-<os>/macros)
#%__id_u @__ID_U@
#%__id_u @__ID_U@
#%__chown_Rhf @__CHOWN_RHF@
#%__chgrp_Rhf @__CHGRP_RHF@
#%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
@ -127,14 +126,14 @@
#%_fixperms %{__chmod} -Rf @FIXPERMS@
#
# The path to the gzip executable (legacy).
# The path to the gzip executable (legacy, use %{__gzip} instead).
%_gzipbin %{__gzip}
# The number of changelog entries kept when installing (legacy, unused in
# rpm-4.0.1 and later).
%_instchangelog 5
# The path to the pgp executable (legacy).
# The path to the pgp executable (legacy, use %{__pgp} instead).
%_pgpbin %{__pgp}
# The directory where newly built binary packages will be written.
@ -164,7 +163,7 @@
# Path to top of build area.
%_topdir %{_usrsrc}/redhat
# The path to the unzip executable (legacy).
# The path to the unzip executable (legacy, use %{__unzip} instead).
%_unzipbin %{__unzip}
#==============================================================================
@ -278,6 +277,19 @@
#
#%vendor
#==============================================================================
# ---- Package version macro.
# The type of package to produce, for compatibility with legacy
# versions of rpm.
#
# This is an rpm version, e.g. 30005 means to produce packaging compatible
# with rpm-3.0.5. At the moment, values < 30005 (i.e. compatibility with
# version before rpm-3.0.5) are not supported. The only incompatible change
# in rpm packaging since rpm-3.0.5 has been to replace a 3 with a 4 in the
# rpmlead, so there's little need to use any value greater than 30005.
#
%_package_version 30005
#==============================================================================
# ---- Database configuration macros.
# Macros used to configure Berkley db parameters.
@ -286,8 +298,8 @@
# list of tokens, with an optional '!' negation to explicitly disable bit
# values, or a "=value" if a parameter. A per-tag value is used (e.g.
# %_dbi_config_Packages) if defined, otherwise a per-rpmdb default
# (e.g. %_dbi_config). The configuration is # also conditioned on the
# existence of an internal %{_rpmdb_rebuild} switch # to permit changing
# (e.g. %_dbi_config). The configuration is also conditioned on the
# existence of an internal %{_rpmdb_rebuild} switch to permit changing
# the configuration while rebuilding an rpmdb database.
#
# The rpmdb configuration tokens are in a popt table in rpmdb/dbconfig.c,
@ -358,7 +370,7 @@
# ht_dupsort +++ (hash only) DB_DUPSORT
#----------------------- rpmdb specific configuration:
# usecursors (always on) Use db3 cursors in get/put/del ?
# usedbenv +++ (on if not "traditional") Use db3 environment?
# usedbenv (always on) Use db3 environment?
# verify (always on, db3 only) Verify db after close?
# lockdbfd (always on for Packages) Use fcntl(2) locking ?
# nofsync Disable fsync(2) call performed after db3 writes?

View File

@ -268,10 +268,10 @@ fi
%rpmattr %{__prefix}/bin/rpmquery
%rpmattr %{__prefix}/bin/rpmverify
%{__prefix}/lib/librpm.so.*
%{__prefix}/lib/librpmdb.so.*
%{__prefix}/lib/librpmio.so.*
%{__prefix}/lib/librpmbuild.so.*
%{__prefix}/lib/librpm-@VERSION@.so
%{__prefix}/lib/librpmdb-@VERSION@.so
%{__prefix}/lib/librpmio-@VERSION@.so
%{__prefix}/lib/librpmbuild-@VERSION@.so
%rpmattr %{__prefix}/lib/rpm/config.guess
%rpmattr %{__prefix}/lib/rpm/config.sub

View File

@ -29,7 +29,7 @@ DB3LOBJS = $(shell cat $(top_builddir)/$(WITH_DB_SUBDIR)/db3lobjs)
lib_LTLIBRARIES = librpmdb.la
librpmdb_la_SOURCES = $(DBLIBSRCS) \
dbconfig.c fprint.c poptDB.c rpmhash.c rpmdb.c
librpmdb_la_LDFLAGS = @libdb3@
librpmdb_la_LDFLAGS = -release @VERSION@ @libdb3@
librpmdb_la_LIBADD = $(DBLIBOBJS) $(DB3LOBJS)
librpmdb_la_DEPENDENCIES = $(DBLIBOBJS) .created

View File

@ -15,6 +15,7 @@ lib_LTLIBRARIES = librpmio.la
librpmio_la_SOURCES = rpmrpc.c rpmio.c rpmio_api.c url.c macro.c \
base64.c digest.c strcasecmp.c stubs.c \
ugid.c rpmmalloc.c rpmlog.c
librpmio_la_LDFLAGS = -release @VERSION@
# XXX Add internal libtool dependence
install-data-local:

26
rpmqv.c
View File

@ -443,23 +443,26 @@ int main(int argc, const char ** argv)
#if defined(IAM_RPMQV) || defined(IAM_RPMEIU) || defined(IAM_RPMBT)
case 'i':
#ifdef IAM_RPMQV
if (bigMode == MODE_QUERY) {
if (bigMode == MODE_QUERY || qva->qva_mode == 'q') {
/*@-nullassign -readonlytrans@*/
const char * infoCommand[] = { "--info", NULL };
/*@=nullassign =readonlytrans@*/
(void) poptStuffArgs(optCon, infoCommand);
}
} else
#endif
#ifdef IAM_RPMEIU
if (bigMode == MODE_INSTALL)
if (bigMode == MODE_INSTALL ||
(ia->installInterfaceFlags &
(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL)))
/*@-ifempty@*/ ;
if (bigMode == MODE_UNKNOWN) {
else if (bigMode == MODE_UNKNOWN) {
/*@-nullassign -readonlytrans@*/
const char * installCommand[] = { "--install", NULL };
/*@=nullassign =readonlytrans@*/
(void) poptStuffArgs(optCon, installCommand);
}
} else
#endif
/*@-ifempty@*/ ;
break;
#endif /* IAM_RPMQV || IAM_RPMEIU || IAM_RPMBT */
@ -507,6 +510,7 @@ int main(int argc, const char ** argv)
}
#ifdef IAM_RPMBT
if (bigMode == MODE_UNKNOWN) {
switch (ba->buildMode) {
case 'b': bigMode = MODE_BUILD; break;
case 't': bigMode = MODE_TARBUILD; break;
@ -524,9 +528,11 @@ int main(int argc, const char ** argv)
bigMode != MODE_REBUILD && bigMode != MODE_TARBUILD) {
argerror("--buildroot may only be used during package builds");
}
}
#endif /* IAM_RPMBT */
#ifdef IAM_RPMDB
if (bigMode == MODE_UNKNOWN) {
if (da->init) {
if (bigMode != MODE_UNKNOWN)
argerror(_("only one major mode may be specified"));
@ -545,9 +551,11 @@ int main(int argc, const char ** argv)
else
bigMode = MODE_VERIFYDB;
}
}
#endif /* IAM_RPMDB */
#ifdef IAM_RPMQV
if (bigMode == MODE_UNKNOWN) {
switch (qva->qva_mode) {
case 'q': bigMode = MODE_QUERY; break;
case 'V': bigMode = MODE_VERIFY; break;
@ -567,12 +575,14 @@ int main(int argc, const char ** argv)
if (qva->qva_source != RPMQV_PACKAGE && (bigMode & ~MODES_QV))
argerror(_("unexpected query source"));
}
#endif /* IAM_RPMQV */
#ifdef IAM_RPMEIU
if (bigMode == MODE_UNKNOWN)
{ int iflags = (ia->installInterfaceFlags &
(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_NOERASE));
int eflags = (ia->installInterfaceFlags & INSTALL_UPGRADE);
(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL));
int eflags = (ia->installInterfaceFlags & INSTALL_ERASE);
if (iflags & eflags)
argerror(_("only one major mode may be specified"));
@ -584,6 +594,7 @@ int main(int argc, const char ** argv)
#endif /* IAM_RPMQV */
#ifdef IAM_RPMK
if (bigMode == MODE_UNKNOWN) {
switch (ka->addSign) {
case RESIGN_NONE:
break;
@ -596,6 +607,7 @@ int main(int argc, const char ** argv)
break;
}
}
#endif /* IAM_RPMK */
/* XXX TODO: never happens. */