- python: initdb binding (Dan Burcaw <dburcaw@terraplex.com>).

- internalize --freshen (Gordon Messmer <yinyang@eburg.com>).

CVS patchset: 3905
CVS date: 2000/06/23 00:49:43
This commit is contained in:
jbj 2000-06-23 00:49:43 +00:00
parent 4cd7474f6e
commit 4d88809296
11 changed files with 396 additions and 411 deletions

View File

@ -67,7 +67,6 @@
- API: uncouple fadio from rest of rpmio.
- API: externalize legacy fdOpen interface for rpmfind et al.
- put version on rpmpopt filename to avoid legacy filename collision.
- python: initdb binding (Dan Burcaw <dburcaw@terraplex.com>).
3.0.4 -> 3.0.5
- handle version 4 packaging as input.
@ -84,6 +83,9 @@
- fix: don't expand macros in false branch of %if (kasal@suse.cz).
- fix: macro expansion problem and clean up (#11484) (kasal@suse.cz).
- uname on i370 has s390 as arch (#11456).
- python: initdb binding (Dan Burcaw <dburcaw@terraplex.com>).
- internalize --freshen (Gordon Messmer <yinyang@eburg.com>).
3.0.3 -> 3.0.4
- use compressed filenames on install side.

View File

@ -277,6 +277,16 @@ int rpmInstall(const char * rootdir, const char ** fileArgv, int transFlags,
}
}
/* If this is a freshen operation, verify a package is installed */
if (interfaceFlags & INSTALL_FRESHEN) {
const char * name;
headerNVR(h, &name, NULL, NULL);
if (rpmdbCountPackages(db, name) == 0)
break;
/* Package exists, OK to freshen */
}
rc = rpmtransAddPackage(rpmdep, h, NULL, fileName,
(interfaceFlags & INSTALL_UPGRADE) != 0,
relocations);

View File

@ -887,6 +887,7 @@ int rpmVerify(QVA_t *qva, enum rpmQVSources source, const char *arg);
#define INSTALL_NOORDER (1 << 3)
#define INSTALL_LABEL (1 << 4) /* set if we're being verbose */
#define INSTALL_UPGRADE (1 << 5)
#define INSTALL_FRESHEN (1 << 6)
#define UNINSTALL_NODEPS (1 << 0)
#define UNINSTALL_ALLMATCHES (1 << 1)

File diff suppressed because it is too large Load Diff

11
rpm.c
View File

@ -110,6 +110,7 @@ static struct poptOption optionsTable[] = {
{ "excludedocs", '\0', 0, &excldocs, 0, NULL, NULL},
{ "excludepath", '\0', POPT_ARG_STRING, 0, GETOPT_EXCLUDEPATH, NULL, NULL},
{ "force", '\0', 0, &force, 0, NULL, NULL},
{ "freshen", 'F', 0, 0, 'F', NULL, NULL},
{ "ftpdebug", '\0', POPT_ARG_VAL, &_ftp_debug, -1, NULL, NULL},
{ "hash", 'h', 0, &showHash, 0, NULL, NULL},
{ "help", '\0', 0, &help, 0, NULL, NULL},
@ -555,6 +556,7 @@ int main(int argc, const char ** argv)
int numRelocations = 0;
int sigTag;
int upgrade = 0;
int freshen = 0;
int probFilter = 0;
#if HAVE_MCHECK_H && HAVE_MTRACE
@ -713,6 +715,14 @@ int main(int argc, const char ** argv)
upgrade = 1;
break;
case 'F':
if (bigMode != MODE_UNKNOWN && bigMode != MODE_INSTALL)
argerror(_("only one major mode may be specified"));
bigMode = MODE_INSTALL;
upgrade = 1; /* Freshen implies upgrade */
freshen = 1;
break;
case GETOPT_RESIGN:
if (bigMode != MODE_UNKNOWN && bigMode != MODE_RESIGN)
argerror(_("only one major mode may be specified"));
@ -1108,6 +1118,7 @@ int main(int argc, const char ** argv)
if (noDeps) interfaceFlags |= INSTALL_NODEPS;
if (noOrder) interfaceFlags |= INSTALL_NOORDER;
if (upgrade) interfaceFlags |= INSTALL_UPGRADE;
if (freshen) interfaceFlags |= INSTALL_FRESHEN;
if (!poptPeekArg(optCon))
argerror(_("no packages given for install"));

View File

@ -255,6 +255,9 @@ fi
%{__prefix}/include/popt.h
%changelog
* Thu Jun 22 2000 Jeff Johnson <jbj@redhat.com>
- internalize --freshen (Gordon Messmer <yinyang@eburg.com>).
* Wed Jun 21 2000 Jeff Johnson <jbj@redhat.com>
- fix: don't expand macros in false branch of %if (kasal@suse.cz).
- fix: macro expansion problem and clean up (#11484) (kasal@suse.cz).

View File

@ -67,8 +67,6 @@ rpm alias --last --qf ''%|INSTALLTIME?{%{INSTALLTIME}}:{000000000}| %{NAME}-%{VE
--pipe "sort -r -n | sed 's,^[0-9]\+ ,,' | awk '{printf(\"%-35s %-s\n\", $1, substr($0,length($1)+2))}' "
rpm alias --filesbypkg --qf '[%-25{=NAME} %{FILENAMES}\n]'
rpm exec --freshen freshen.sh
rpm alias -F --freshen
rpm alias --redhatprovides -q --define '_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat' --whatprovides
rpm alias --redhatrequires -q --define '_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat' --whatrequires

11
rpmqv.c
View File

@ -210,6 +210,7 @@ static struct poptOption optionsTable[] = {
{ "erase", 'e', 0, 0, 'e', NULL, NULL},
{ "excludedocs", '\0', 0, &excldocs, 0, NULL, NULL},
{ "excludepath", '\0', POPT_ARG_STRING, 0, GETOPT_EXCLUDEPATH, NULL, NULL},
{ "freshen", 'F', 0, 0, 'F', NULL, NULL},
{ "hash", 'h', 0, &showHash, 0, NULL, NULL},
{ "ignorearch", '\0', 0, &ignoreArch, 0, NULL, NULL},
{ "ignoreos", '\0', 0, &ignoreOs, 0, NULL, NULL},
@ -649,6 +650,7 @@ int main(int argc, const char ** argv)
int installFlags = 0, uninstallFlags = 0, interfaceFlags = 0;
int probFilter = 0;
int upgrade = 0;
int freshen = 0;
#endif
#if defined(IAM_RPMK)
@ -828,6 +830,14 @@ int main(int argc, const char ** argv)
upgrade = 1;
break;
case 'F':
if (bigMode != MODE_UNKNOWN && bigMode != MODE_INSTALL)
argerror(_("only one major mode may be specified"));
bigMode = MODE_INSTALL;
upgrade = 1; /* Freshen implies upgrade */
freshen = 1;
break;
case GETOPT_EXCLUDEPATH:
if (*optArg != '/')
argerror(_("exclude paths must begin with a /"));
@ -1375,6 +1385,7 @@ int main(int argc, const char ** argv)
if (noDeps) interfaceFlags |= INSTALL_NODEPS;
if (noOrder) interfaceFlags |= INSTALL_NOORDER;
if (upgrade) interfaceFlags |= INSTALL_UPGRADE;
if (freshen) interfaceFlags |= INSTALL_FRESHEN;
if (!poptPeekArg(optCon))
argerror(_("no packages given for install"));

View File

@ -6,7 +6,7 @@ EXTRA_DIST = \
brp-compress brp-redhat brp-strip brp-strip-comment-note \
brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh \
find-prov.pl find-req.pl cpanflute find-provides.perl \
find-requires.perl freshen.sh get_magic.pl getpo.sh http.req \
find-requires.perl get_magic.pl getpo.sh http.req \
magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi u_pkg.sh \
vpkg-provides.sh vpkg-provides2.sh
@ -19,6 +19,6 @@ config_SCRIPTS = \
brp-compress brp-redhat brp-strip brp-strip-comment-note \
brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh \
find-prov.pl find-req.pl cpanflute find-provides.perl \
find-requires.perl freshen.sh get_magic.pl getpo.sh http.req \
find-requires.perl get_magic.pl getpo.sh http.req \
magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi u_pkg.sh \
vpkg-provides.sh vpkg-provides2.sh

View File

@ -164,13 +164,13 @@ varprefix = @varprefix@
AUTOMAKE_OPTIONS = 1.4 foreign
EXTRA_DIST = brp-compress brp-redhat brp-strip brp-strip-comment-note brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh find-prov.pl find-req.pl cpanflute find-provides.perl find-requires.perl freshen.sh get_magic.pl getpo.sh http.req magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi u_pkg.sh vpkg-provides.sh vpkg-provides2.sh
EXTRA_DIST = brp-compress brp-redhat brp-strip brp-strip-comment-note brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh find-prov.pl find-req.pl cpanflute find-provides.perl find-requires.perl get_magic.pl getpo.sh http.req magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi u_pkg.sh vpkg-provides.sh vpkg-provides2.sh
installprefix = $(DESTDIR)
configdir = ${prefix}/lib/rpm
config_SCRIPTS = brp-compress brp-redhat brp-strip brp-strip-comment-note brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh find-prov.pl find-req.pl cpanflute find-provides.perl find-requires.perl freshen.sh get_magic.pl getpo.sh http.req magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi u_pkg.sh vpkg-provides.sh vpkg-provides2.sh
config_SCRIPTS = brp-compress brp-redhat brp-strip brp-strip-comment-note brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh find-prov.pl find-req.pl cpanflute find-provides.perl find-requires.perl get_magic.pl getpo.sh http.req magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi u_pkg.sh vpkg-provides.sh vpkg-provides2.sh
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h

View File

@ -1,52 +0,0 @@
#!/bin/sh
# Implements --freshen option in RPM. --freshen is mostly like upgrade, but
# go through each file and make sure the package is actually installed before
# upgrading it. This won't work properly if there are any odd options
# specified (i.e. filenames with " specified). I'm sure some shell-hacker
# out there can fix that <hint, hint>.
case `basename $0` in
rpme|rpmi|rpmu) rpm="$0" ;;
*) rpm="`dirname $0`/rpmi" ;;
esac
shift
args="-U"
while [ $# -gt 0 ]; do
if [ "$1" = "--" ]; then
break
fi
args="$args $1"
shift
done
if [ $# = 0 ]; then
exec $RPM $args
fi
origargs="$args"
args="$args -- "
shift
# Just filenames left now
for n in $*; do
# if the file doesn't exist, we'll let RPM give the error message
if [ ! -f $n ]; then
args="$args $n"
else
if rpm -q `rpm -qp $n` >/dev/null 2>&1
then
:
else
name=`rpm --qf "%{NAME}" -qp $n`
$RPM -q $name >/dev/null 2>&1 && args="$args $n"
fi
fi
done
if [ "$args" = "$origargs -- " ]; then
echo no packages require freshening
else
exec $RPM $args
fi