- perl.req: don't mis-generate dependencies like perl(::path/to/foo.pl).
- permit args to be hidden within %__find_{requires,provides}.
- a couple more perl.{prov,req} fiddles.
+ - macro for %files, always include %defattr(), redhat config only.
+ - fix: drop header region when writing repackaged legacy header.
4.0.2 -> 4.0.3:
- update per-interpreter dependency scripts, add sql/tcl (#20295).
if (headerGetEntry(fi->h, RPMTAG_HEADERIMMUTABLE, &uht, &uh, &uhc)) {
psm->oh = headerCopyLoad(uh);
uh = hfd(uh, uht);
- } else {
- psm->oh = headerLink(fi->h, "PSM_PKGSAVE_PRE)");
- }
- }
+ } else
+ if (headerGetEntry(fi->h, RPMTAG_HEADERIMAGE, &uht, &uh, &uhc))
+ {
+ HeaderIterator hi;
+ int_32 tag, type, count;
+ hPTR_t ptr;
+ Header oh;
- /* Add remove transaction id to header. */
- if (psm->oh)
- { int_32 tid = ts->id;
- xx = headerAddEntry(psm->oh, RPMTAG_REMOVETID,
- RPM_INT32_TYPE, &tid, 1);
+ /* Load the original header from the blob. */
+ oh = headerCopyLoad(uh);
+
+ /* XXX this is headerCopy w/o headerReload() */
+ psm->oh = headerNew();
+
+ /*@-branchstate@*/
+ for (hi = headerInitIterator(oh);
+ headerNextIterator(hi, &tag, &type, &ptr, &count);
+ ptr = headerFreeData((void *)ptr, type))
+ {
+ if (ptr) (void) headerAddEntry(psm->oh, tag, type, ptr, count);
+ }
+ hi = headerFreeIterator(hi);
+ /*@=branchstate@*/
+
+ headerFree(oh, NULL);
+ uh = hfd(uh, uht);
+ } else
+ break; /* XXX shouldn't ever happen */
}
/* Retrieve type of payload compression. */
memset(&lead, 0, sizeof(lead));
/* XXX Set package version conditioned on noDirTokens. */
- lead.major = 4;
+ lead.major = 3;
lead.minor = 0;
lead.type = RPMLEAD_BINARY;
lead.archnum = archnum;
if (rc) break;
}
+ /* Add remove transaction id to header. */
+ if (psm->oh)
+ { int_32 tid = ts->id;
+ xx = headerAddEntry(psm->oh, RPMTAG_REMOVETID,
+ RPM_INT32_TYPE, &tid, 1);
+ }
+
/* Write the metadata section into the package. */
rc = headerWrite(psm->fd, psm->oh, HEADER_MAGIC_YES);
if (rc) break;
IDT ip;
int niids = 0;
int rc = 0;
+ int i;
if (argv != NULL && *argv != NULL) {
rc = -1;
rpmProblemSetPrint(stderr, probs);
if (probs != NULL) rpmProblemSetFree(probs);
probs = NULL;
+ }
+ if (rc)
goto exit;
+
+ /* Clean up after successful rollback. */
+ for (i = 0; i < rtids->nidt; i++) {
+ IDT rrp = rtids->idt + i;
+ if (rrp->val.u32 != thistid)
+ continue;
+ (void) unlink(rrp->key);
}
} while (1);
rc = (((sizeof(struct rpmlead) + siglen + pad + datalen) - st.st_size)
? RPMRC_BADSIZE : RPMRC_OK);
- rpmMessage((rc == RPMRC_OK ? RPMMESS_DEBUG : RPMMESS_WARNING),
+ rpmMessage((rc == RPMRC_OK ? RPMMESS_DEBUG : RPMMESS_DEBUG),
_("Expected size: %12d = lead(%d)+sigs(%d)+pad(%d)+data(%d)\n"),
(int)sizeof(struct rpmlead)+siglen+pad+datalen,
(int)sizeof(struct rpmlead), siglen, pad, datalen);
/*@=sizeoftype@*/
- rpmMessage((rc == RPMRC_OK ? RPMMESS_DEBUG : RPMMESS_WARNING),
+ rpmMessage((rc == RPMRC_OK ? RPMMESS_DEBUG : RPMMESS_DEBUG),
_(" Actual size: %12d\n"), (int)st.st_size);
return rc;
#define UP2DATEGLOB "/var/spool/up2date/*.rpm"
-#ifdef DYING
-static int XrpmRollback(struct rpmInstallArguments_s * ia, const char ** argv)
-{
- rpmdb db = NULL;
- rpmTransactionSet ts = NULL;
- rpmProblemSet probs = NULL;
- IDTX itids = NULL;
- IDTX rtids = NULL;
- unsigned thistid = 0xffffffff;
- unsigned prevtid;
- time_t tid;
- IDT rp;
- IDT ip;
- int rc;
-
- if (argv != NULL && *argv != NULL) {
- rc = -1;
- goto exit;
- }
-
- rc = rpmdbOpen(ia->rootdir, &db, O_RDWR, 0644);
- if (rc != 0)
- goto exit;
-
- itids = IDTXload(db, RPMTAG_INSTALLTID);
- ip = (itids != NULL && itids->nidt > 0) ? itids->idt : NULL;
-
- { const char * globstr = rpmExpand("%{_repackage_dir}/*.rpm", NULL);
- if (globstr == NULL || *globstr == '%') {
- globstr = _free(globstr);
- rc = -1;
- goto exit;
- }
- rtids = IDTXglob(globstr, RPMTAG_REMOVETID);
- rp = (rtids != NULL && rtids->nidt > 0) ? rtids->idt : NULL;
- globstr = _free(globstr);
- }
-
- /* Run transactions until rollback goal is achieved. */
- do {
- prevtid = thistid;
- rc = 0;
- packagesTotal = 0;
-
- /* Find larger of the remaining install/erase transaction id's. */
- thistid = 0;
- if (ip != NULL && ip->val.u32 > thistid)
- thistid = ip->val.u32;
- if (rp != NULL && rp->val.u32 > thistid)
- thistid = rp->val.u32;
-
- /* If we've achieved the rollback goal, then we're done. */
- if (thistid == 0 || thistid < ia->rbtid)
- break;
-
- ts = rpmtransCreateSet(db, ia->rootdir);
-
- /* Install the previously erased packages for this transaction. */
- while (rp != NULL && rp->val.u32 == thistid) {
-
- rpmMessage(RPMMESS_DEBUG, "\t+++ %s\n", rp->key);
-
- rc = rpmtransAddPackage(ts, rp->h, NULL, rp->key,
- (ia->installInterfaceFlags & INSTALL_UPGRADE) != 0,
- ia->relocations);
- if (rc != 0)
- goto exit;
-
- packagesTotal++;
-
- rp->h = headerFree(rp->h);
- rtids->nidt--;
- if (rtids->nidt > 0)
- rp++;
- else
- rp = NULL;
- }
-
- /* Erase the previously installed packages for this transaction. */
- while (ip != NULL && ip->val.u32 == thistid) {
-
- rpmMessage(RPMMESS_DEBUG,
- "\t--- rpmdb instance #%u\n", ip->instance);
-
- rc = rpmtransRemovePackage(ts, ip->instance);
- if (rc != 0)
- goto exit;
-
- packagesTotal++;
-
- ip->instance = 0;
- itids->nidt--;
- if (itids->nidt > 0)
- ip++;
- else
- ip = NULL;
- }
-
- /* Anything to do? */
- if (packagesTotal <= 0)
- break;
-
- tid = (time_t)thistid;
- rpmMessage(RPMMESS_DEBUG, _("rollback %d packages to %s"),
- packagesTotal, ctime(&tid));
-
- rc = rpmdepOrder(ts);
- if (rc != 0)
- goto exit;
-
- probs = NULL;
- rc = rpmRunTransactions(ts, rpmShowProgress,
- (void *) ((long)ia->installInterfaceFlags),
- NULL, &probs, ia->transFlags,
- (ia->probFilter|RPMPROB_FILTER_OLDPACKAGE));
- if (rc > 0) {
- rpmProblemSetPrint(stderr, probs);
- goto exit;
- }
-
- if (probs != NULL) {
- rpmProblemSetFree(probs);
- probs = NULL;
- }
- ts = rpmtransFree(ts);
-
- } while (1);
-
-exit:
- if (probs != NULL) {
- rpmProblemSetFree(probs);
- probs = NULL;
- }
- ts = rpmtransFree(ts);
-
- if (db != NULL) (void) rpmdbClose(db);
-
- rtids = IDTXfree(rtids);
- itids = IDTXfree(itids);
-
- return rc;
-}
-#endif
-
static struct poptOption optionsTable[] = {
{ "verbose", 'v', 0, 0, 'v',
N_("provide more detailed output"), NULL},
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
- %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} ; \
./configure %{_target_platform} \\\
--prefix=%{_prefix} \\\
--exec-prefix=%{_exec_prefix} \\\
@redhat@%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
@redhat@%_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} @ROOT_GROUP@
@redhat@%_fixperms %{__chmod} -Rf @FIXPERMS@
+@redhat@#---------------------------------------------------------------------
+@redhat@# Always use %defattr(-,root,root) in %files (added in rpm-4.0.4)
+@redhat@#
+@redhat@%files(n:f:) %%files%{?-f: -f %{-f*}}%{?-n: -n %{-n*}} %{?1}\
+@redhat@%defattr(-,root,root,-)
@mandrake@#---------------------------------------------------------------------
@mandrake@# Mandrake vendor specific macros
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2002-02-01 10:09-0500\n"
+"POT-Creation-Date: 2002-02-02 17:37-0500\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"
msgid "cannot re-open payload: %s\n"
msgstr ""
-#: rpmqv.c:109
+#: rpmqv.c:108
msgid "print the version of rpm being used"
msgstr ""
-#: rpmqv.c:112
+#: rpmqv.c:111
msgid "provide less detailed output"
msgstr ""
-#: rpmqv.c:114
+#: rpmqv.c:113
msgid "provide more detailed output"
msgstr ""
-#: rpmqv.c:116
+#: rpmqv.c:115
msgid "define macro <name> with value <body>"
msgstr ""
-#: rpmqv.c:117
+#: rpmqv.c:116
msgid "'<name> <body>'"
msgstr ""
-#: rpmqv.c:119
+#: rpmqv.c:118
msgid "print macro expansion of <expr>+"
msgstr ""
-#: rpmqv.c:120
+#: rpmqv.c:119
msgid "<expr>+"
msgstr ""
-#: rpmqv.c:122
+#: rpmqv.c:121
msgid "send stdout to <cmd>"
msgstr ""
-#: rpmqv.c:123
+#: rpmqv.c:122
msgid "<cmd>"
msgstr ""
-#: rpmqv.c:125
+#: rpmqv.c:124
msgid "use <dir> as the top level directory"
msgstr ""
-#: lib/poptI.c:210 rpmqv.c:126
+#: lib/poptI.c:210 rpmqv.c:125
msgid "<dir>"
msgstr ""
-#: rpmqv.c:128
+#: rpmqv.c:127
msgid "read <file:...> instead of default macro file(s)"
msgstr ""
-#: rpmqv.c:129 rpmqv.c:133 rpmqv.c:137
+#: rpmqv.c:128 rpmqv.c:132 rpmqv.c:136
msgid "<file:...>"
msgstr ""
-#: rpmqv.c:132 rpmqv.c:136
+#: rpmqv.c:131 rpmqv.c:135
msgid "read <file:...> instead of default rpmrc file(s)"
msgstr ""
-#: rpmqv.c:140
+#: rpmqv.c:139
msgid "display final rpmrc and macro configuration"
msgstr ""
-#: rpmqv.c:145
+#: rpmqv.c:144
msgid "disable use of libio(3) API"
msgstr ""
-#: rpmqv.c:148
+#: rpmqv.c:147
msgid "debug protocol data stream"
msgstr ""
-#: rpmqv.c:150
+#: rpmqv.c:149
msgid "debug rpmio I/O"
msgstr ""
-#: rpmqv.c:152
+#: rpmqv.c:151
msgid "debug URL cache handling"
msgstr ""
-#: rpmqv.c:172
+#: rpmqv.c:171
msgid "Query options (with -q or --query):"
msgstr ""
-#: rpmqv.c:175
+#: rpmqv.c:174
msgid "Verify options (with -V or --verify):"
msgstr ""
-#: rpmqv.c:181
+#: rpmqv.c:180
msgid "Signature options:"
msgstr ""
-#: rpmqv.c:187
+#: rpmqv.c:186
msgid "Database options:"
msgstr ""
-#: rpmqv.c:193
+#: rpmqv.c:192
msgid "Build options with [ <specfile> | <tarball> | <source package> ]:"
msgstr ""
-#: rpmqv.c:199
+#: rpmqv.c:198
msgid "Install/Upgrade/Erase options:"
msgstr ""
-#: rpmqv.c:204
+#: rpmqv.c:203
msgid "Common options for all rpm modes:"
msgstr ""
#. @-modfilesys -globs @
-#: lib/poptI.c:27 rpmqv.c:221
+#: lib/poptI.c:27 rpmqv.c:220
#, c-format
msgid "%s: %s\n"
msgstr ""
-#: rpmqv.c:229
+#: rpmqv.c:228
#, c-format
msgid "RPM version %s\n"
msgstr ""
-#: rpmqv.c:236
+#: rpmqv.c:235
msgid "Copyright (C) 1998-2000 - Red Hat, Inc."
msgstr ""
-#: rpmqv.c:237
+#: rpmqv.c:236
msgid "This program may be freely redistributed under the terms of the GNU GPL"
msgstr ""
-#: rpmqv.c:249
+#: rpmqv.c:248
#, c-format
msgid "Usage: %s {--help}\n"
msgstr ""
-#: rpmqv.c:589
+#: rpmqv.c:588
msgid "The --rcfile option has been eliminated.\n"
msgstr ""
-#: rpmqv.c:590
+#: rpmqv.c:589
msgid "Use \"--macros <file:...>\" instead.\n"
msgstr ""
-#: rpmqv.c:596
+#: rpmqv.c:595
#, c-format
msgid "Internal error in argument processing (%d) :-(\n"
msgstr ""
-#: rpmqv.c:637 rpmqv.c:643 rpmqv.c:649 rpmqv.c:687
+#: rpmqv.c:636 rpmqv.c:642 rpmqv.c:648 rpmqv.c:686
msgid "only one major mode may be specified"
msgstr ""
-#: rpmqv.c:666
+#: rpmqv.c:665
msgid "one type of query/verify may be performed at a time"
msgstr ""
-#: rpmqv.c:670
+#: rpmqv.c:669
msgid "unexpected query flags"
msgstr ""
-#: rpmqv.c:673
+#: rpmqv.c:672
msgid "unexpected query format"
msgstr ""
-#: rpmqv.c:676
+#: rpmqv.c:675
msgid "unexpected query source"
msgstr ""
-#: rpmqv.c:717
+#: rpmqv.c:716
msgid "--dbpath given for operation that does not use a database"
msgstr ""
-#: rpmqv.c:723
+#: rpmqv.c:722
msgid "only installation, upgrading, rmsource and rmspec may be forced"
msgstr ""
-#: rpmqv.c:725
+#: rpmqv.c:724
msgid "files may only be relocated during package installation"
msgstr ""
-#: rpmqv.c:728
+#: rpmqv.c:727
msgid "only one of --prefix or --relocate may be used"
msgstr ""
-#: rpmqv.c:731
+#: rpmqv.c:730
msgid ""
"--relocate and --excludepath may only be used when installing new packages"
msgstr ""
-#: rpmqv.c:734
+#: rpmqv.c:733
msgid "--prefix may only be used when installing new packages"
msgstr ""
-#: rpmqv.c:737
+#: rpmqv.c:736
msgid "arguments to --prefix must begin with a /"
msgstr ""
-#: rpmqv.c:740
+#: rpmqv.c:739
msgid "--hash (-h) may only be specified during package installation"
msgstr ""
-#: rpmqv.c:744
+#: rpmqv.c:743
msgid "--percent may only be specified during package installation"
msgstr ""
-#: rpmqv.c:749
+#: rpmqv.c:748
msgid "--replacefiles may only be specified during package installation"
msgstr ""
-#: rpmqv.c:753
+#: rpmqv.c:752
msgid "--replacepkgs may only be specified during package installation"
msgstr ""
-#: rpmqv.c:757
+#: rpmqv.c:756
msgid "--excludedocs may only be specified during package installation"
msgstr ""
-#: rpmqv.c:761
+#: rpmqv.c:760
msgid "--includedocs may only be specified during package installation"
msgstr ""
-#: rpmqv.c:765
+#: rpmqv.c:764
msgid "only one of --excludedocs and --includedocs may be specified"
msgstr ""
-#: rpmqv.c:769
+#: rpmqv.c:768
msgid "--ignorearch may only be specified during package installation"
msgstr ""
-#: rpmqv.c:773
+#: rpmqv.c:772
msgid "--ignoreos may only be specified during package installation"
msgstr ""
-#: rpmqv.c:778
+#: rpmqv.c:777
msgid "--ignoresize may only be specified during package installation"
msgstr ""
-#: rpmqv.c:782
+#: rpmqv.c:781
msgid "--allmatches may only be specified during package erasure"
msgstr ""
-#: rpmqv.c:786
+#: rpmqv.c:785
msgid "--allfiles may only be specified during package installation"
msgstr ""
-#: rpmqv.c:791
+#: rpmqv.c:790
msgid "--justdb may only be specified during package installation and erasure"
msgstr ""
-#: rpmqv.c:796
+#: rpmqv.c:795
msgid ""
"script disabling options may only be specified during package installation "
"and erasure"
msgstr ""
-#: rpmqv.c:801
+#: rpmqv.c:800
msgid ""
"trigger disabling options may only be specified during package installation "
"and erasure"
msgstr ""
-#: rpmqv.c:805
+#: rpmqv.c:804
msgid ""
"--nodeps may only be specified during package building, rebuilding, "
"recompilation, installation,erasure, and verification"
msgstr ""
-#: rpmqv.c:810
+#: rpmqv.c:809
msgid ""
"--test may only be specified during package installation, erasure, and "
"building"
msgstr ""
-#: rpmqv.c:815
+#: rpmqv.c:814
msgid ""
"--root (-r) may only be specified during installation, erasure, querying, "
"and database rebuilds"
msgstr ""
-#: rpmqv.c:827
+#: rpmqv.c:826
msgid "arguments to --root (-r) must begin with a /"
msgstr ""
-#: rpmqv.c:851
+#: rpmqv.c:850
msgid "no files to sign\n"
msgstr ""
-#: rpmqv.c:856
+#: rpmqv.c:855
#, c-format
msgid "cannot access file %s\n"
msgstr ""
-#: rpmqv.c:875
+#: rpmqv.c:874
msgid "pgp not found: "
msgstr ""
-#: rpmqv.c:880
+#: rpmqv.c:879
msgid "Enter pass phrase: "
msgstr ""
-#: rpmqv.c:882
+#: rpmqv.c:881
msgid "Pass phrase check failed\n"
msgstr ""
-#: rpmqv.c:886
+#: rpmqv.c:885
msgid "Pass phrase is good.\n"
msgstr ""
-#: rpmqv.c:891
+#: rpmqv.c:890
#, c-format
msgid "Invalid %%_signature spec in macro file.\n"
msgstr ""
-#: rpmqv.c:898
+#: rpmqv.c:897
msgid "--sign may only be used during package building"
msgstr ""
-#: rpmqv.c:915
+#: rpmqv.c:914
msgid "exec failed\n"
msgstr ""
-#: rpmqv.c:947
+#: rpmqv.c:946
msgid "no packages files given for rebuild"
msgstr ""
-#: rpmqv.c:1015
+#: rpmqv.c:1014
msgid "no spec files given for build"
msgstr ""
-#: rpmqv.c:1017
+#: rpmqv.c:1016
msgid "no tar files given for build"
msgstr ""
-#: rpmqv.c:1036
+#: rpmqv.c:1038
msgid "no packages given for erase"
msgstr ""
-#: rpmqv.c:1047
+#: rpmqv.c:1078
msgid "no packages given for install"
msgstr ""
-#: rpmqv.c:1093
+#: rpmqv.c:1094
msgid "no arguments given for query"
msgstr ""
-#: rpmqv.c:1106
+#: rpmqv.c:1107
msgid "no arguments given for verify"
msgstr ""
-#: rpmqv.c:1114
+#: rpmqv.c:1115
msgid "unexpected arguments to --querytags "
msgstr ""
-#: rpmqv.c:1130
+#: rpmqv.c:1131
msgid "no arguments given"
msgstr ""
msgid "Could not open %s: %s\n"
msgstr ""
-#: build/pack.c:603 lib/psm.c:1426
+#: build/pack.c:603 lib/psm.c:1444
#, c-format
msgid "Unable to write package: %s\n"
msgstr ""
msgid "Unable to write payload to %s: %s\n"
msgstr ""
-#: build/pack.c:683 lib/psm.c:1700
+#: build/pack.c:683 lib/psm.c:1725
#, c-format
msgid "Wrote: %s\n"
msgstr ""
msgstr ""
#: lib/formats.c:29 lib/formats.c:53 lib/formats.c:84 lib/formats.c:281
-#: rpmdb/header.c:2965 rpmdb/header.c:2986 rpmdb/header.c:3008
+#: rpmdb/header.c:2951 rpmdb/header.c:2972 rpmdb/header.c:2994
msgid "(not a number)"
msgstr ""
msgstr ""
#. @-modfilesys@
-#: lib/psm.c:247 rpmdb/header.c:384 rpmdb/header_internal.c:161
+#: lib/psm.c:247 rpmdb/header.c:383 rpmdb/header_internal.c:161
#, c-format
msgid "Data type %d not supported\n"
msgstr ""
msgid "%s: %s scriptlet failed (%d), skipping %s\n"
msgstr ""
-#: lib/psm.c:1468
+#: lib/psm.c:1493
#, c-format
msgid "user %s does not exist - using root\n"
msgstr ""
-#: lib/psm.c:1477
+#: lib/psm.c:1502
#, c-format
msgid "group %s does not exist - using root\n"
msgstr ""
-#: lib/psm.c:1519
+#: lib/psm.c:1544
#, c-format
msgid "unpacking of archive failed%s%s: %s\n"
msgstr ""
-#: lib/psm.c:1520
+#: lib/psm.c:1545
msgid " on file "
msgstr ""
-#: lib/psm.c:1708
+#: lib/psm.c:1733
#, c-format
msgid "%s failed on file %s: %s\n"
msgstr ""
-#: lib/psm.c:1711
+#: lib/psm.c:1736
#, c-format
msgid "%s failed: %s\n"
msgstr ""
msgid "found %d source and %d binary packages\n"
msgstr ""
-#: lib/rpminstall.c:521 lib/rpminstall.c:1029
+#: lib/rpminstall.c:521 lib/rpminstall.c:1030
msgid "failed dependencies:\n"
msgstr ""
msgid "Installing %s\n"
msgstr ""
-#: lib/rpminstall.c:1022
+#: lib/rpminstall.c:1023
#, c-format
msgid "rollback %d packages to %s"
msgstr ""
#. This should not be allowed
#. @-modfilesys@
-#: rpmdb/header.c:347
+#: rpmdb/header.c:346
msgid "dataLength() RPM_STRING_TYPE count must be 1.\n"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2222
+#: rpmdb/header.c:2208
#, c-format
msgid "missing { after %"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2252
+#: rpmdb/header.c:2238
msgid "missing } after %{"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2266
+#: rpmdb/header.c:2252
msgid "empty tag format"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2280
+#: rpmdb/header.c:2266
msgid "empty tag name"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2297
+#: rpmdb/header.c:2283
msgid "unknown tag"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2324
+#: rpmdb/header.c:2310
msgid "] expected at end of array"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2342
+#: rpmdb/header.c:2328
msgid "unexpected ]"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2346
+#: rpmdb/header.c:2332
msgid "unexpected }"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2412
+#: rpmdb/header.c:2398
msgid "? expected in expression"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2421
+#: rpmdb/header.c:2407
msgid "{ expected after ? in expression"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2434 rpmdb/header.c:2476
+#: rpmdb/header.c:2420 rpmdb/header.c:2462
msgid "} expected in expression"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2444
+#: rpmdb/header.c:2430
msgid ": expected following ? subexpression"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2461
+#: rpmdb/header.c:2447
msgid "{ expected after : in expression"
msgstr ""
#. @-observertrans -readonlytrans@
-#: rpmdb/header.c:2486
+#: rpmdb/header.c:2472
msgid "| expected at end of expression"
msgstr ""
-#: rpmdb/header.c:2709
+#: rpmdb/header.c:2695
msgid "(unknown type)"
msgstr ""
- perl.req: don't mis-generate dependencies like perl(::path/to/foo.pl).
- permit args to be hidden within %%__find_{requires,provides}.
- a couple more perl.{prov,req} fiddles.
+- macro for %files, always include %defattr(), redhat config only.
+- fix: drop header region when writing repackaged legacy header.
#define __HEADER_PROTOTYPES__
#include <header_internal.h>
-#define HSTATIC static
#include "debug.h"
* @param h header
* @return referenced header instance
*/
-HSTATIC
+static
Header XheaderLink(Header h, /*@null@*/ const char * msg,
const char * fn, unsigned ln)
/*@modifies h @*/
* @param h header
* @return NULL always
*/
-HSTATIC /*@null@*/
+static /*@null@*/
Header XheaderUnlink(/*@killref@*/ /*@null@*/ Header h,
/*@null@*/ const char * msg, const char * fn, unsigned ln)
/*@modifies h @*/
* @param h header
* @return NULL always
*/
-HSTATIC /*@null@*/
+static /*@null@*/
Header XheaderFree(/*@killref@*/ /*@null@*/ Header h,
/*@null@*/ const char * msg, const char * fn, unsigned ln)
/*@modifies h @*/
* Create new (empty) header instance.
* @return header
*/
-HSTATIC
+static
Header headerNew(void)
/*@*/
{
* Sort tags in header.
* @param h header
*/
-HSTATIC
+static
void headerSort(Header h)
/*@modifies h @*/
{
* Restore tags in header to original ordering.
* @param h header
*/
-HSTATIC
+static
void headerUnsort(Header h)
/*@modifies h @*/
{
* @param magicp include size of 8 bytes for (magic, 0)?
* @return size of on-disk header
*/
-HSTATIC
+static
unsigned int headerSizeof(/*@null@*/ Header h, enum hMagic magicp)
/*@modifies h @*/
{
tprev = dataStart;
/* XXX HEADER_IMAGE tags don't include region sub-tag. */
/*@-sizeoftype@*/
- if (ie.info.tag != HEADER_IMMUTABLE)
+ if (ie.info.tag == HEADER_IMAGE)
tprev -= REGION_TAG_COUNT;
/*@=sizeoftype@*/
}
return dl;
}
-#if 0
-static int headerDrips(const Header h)
-{
- indexEntry entry;
- int i;
-
- for (i = 0, entry = h->index; i < h->indexUsed; i++, entry++) {
- if (ENTRY_IS_REGION(entry)) {
- int rid = entry->info.offset;
-
- for (; i < h->indexUsed && entry->info.offset <= rid+1; i++, entry++) {
- if (entry->info.offset <= rid)
- continue;
- }
- i--;
- entry--;
- continue;
- }
-
- /* Ignore deleted drips. */
- if (entry->data == NULL || entry->length <= 0)
- continue;
- }
- return 0;
-}
-#endif
-
/** \ingroup header
*/
static /*@only@*/ /*@null@*/ void * doHeaderUnload(Header h,
* @param h header (with pointers)
* @return on-disk header blob (i.e. with offsets)
*/
-HSTATIC /*@only@*/ /*@null@*/
+static /*@only@*/ /*@null@*/
void * headerUnload(Header h)
/*@modifies h @*/
{
* @param tag tag
* @return 0 on success, 1 on failure (INCONSISTENT)
*/
-HSTATIC
+static
int headerRemoveEntry(Header h, int_32 tag)
/*@modifies h @*/
{
* @param uh on-disk header blob (i.e. with offsets)
* @return header
*/
-HSTATIC /*@null@*/
+static /*@null@*/
Header headerLoad(/*@kept@*/ void * uh)
/*@modifies uh @*/
{
* @param tag region tag
* @return on-disk header (with offsets)
*/
-HSTATIC /*@null@*/
+static /*@null@*/
Header headerReload(/*@only@*/ Header h, int tag)
/*@modifies h @*/
{
* @param uh on-disk header blob (i.e. with offsets)
* @return header
*/
-HSTATIC /*@null@*/
+static /*@null@*/
Header headerCopyLoad(const void * uh)
/*@*/
{
* @param magicp read (and verify) 8 bytes of (magic, 0)?
* @return header (or NULL on error)
*/
-HSTATIC /*@null@*/
+static /*@null@*/
Header headerRead(FD_t fd, enum hMagic magicp)
/*@modifies fd @*/
{
reserved = block[i++];
}
- il = ntohl(block[i++]);
- dl = ntohl(block[i++]);
+ il = ntohl(block[i]); i++;
+ dl = ntohl(block[i]); i++;
/*@-sizeoftype@*/
len = sizeof(il) + sizeof(dl) + (il * sizeof(struct entryInfo)) + dl;
* @param magicp prefix write with 8 bytes of (magic, 0)?
* @return 0 on success, 1 on error
*/
-HSTATIC
+static
int headerWrite(FD_t fd, /*@null@*/ Header h, enum hMagic magicp)
/*@globals fileSystem @*/
/*@modifies fd, h, fileSystem @*/
* @param tag tag
* @return 1 on success, 0 on failure
*/
-HSTATIC
+static
int headerIsEntry(/*@null@*/Header h, int_32 tag)
/*@*/
{
if (p)
switch (entry->info.type) {
case RPM_BIN_TYPE:
- /* XXX this only works for HEADER_IMMUTABLE */
+ /*
+ * XXX This only works for
+ * XXX "sealed" HEADER_IMMUTABLE/HEADER_SIGNATURES/HEADER_IMAGE.
+ * XXX This will *not* work for unsealed legacy HEADER_IMAGE (i.e.
+ * XXX a legacy header freshly read, but not yet unloaded to the rpmdb).
+ */
if (ENTRY_IS_REGION(entry)) {
int_32 * ei = ((int_32 *)entry->data) - 2;
/*@-castexpose@*/
int_32 ril = rdl/sizeof(*pe);
/*@-sizeoftype@*/
- count = 2 * sizeof(*ei) + (ril * sizeof(*pe)) +
- entry->rdlen + REGION_TAG_COUNT;
+ rdl = entry->rdlen;
+ count = 2 * sizeof(*ei) + (ril * sizeof(*pe)) + rdl;
+ if (entry->info.tag == HEADER_IMAGE) {
+ ril -= 1;
+ pe += 1;
+ } else {
+ count += REGION_TAG_COUNT;
+ rdl += REGION_TAG_COUNT;
+ }
+
*p = xmalloc(count);
ei = (int_32 *) *p;
ei[0] = htonl(ril);
- ei[1] = htonl(entry->rdlen + REGION_TAG_COUNT);
+ ei[1] = htonl(rdl);
+
/*@-castexpose@*/
pe = (entryInfo) memcpy(ei + 2, pe, (ril * sizeof(*pe)));
/*@=castexpose@*/
- dataStart = (char *) memcpy(pe + ril, dataStart,
- (entry->rdlen + REGION_TAG_COUNT));
+
+ dataStart = (char *) memcpy(pe + ril, dataStart, rdl);
/*@=sizeoftype@*/
rc = regionSwab(NULL, ril, 0, pe, dataStart, 0);
* @retval c address of number of values (or NULL)
* @return 1 on success, 0 on failure
*/
-HSTATIC
+static
int headerGetEntry(Header h, int_32 tag,
/*@null@*/ /*@out@*/ hTYP_t type,
/*@null@*/ /*@out@*/ void ** p,
* @retval c address of number of values (or NULL)
* @return 1 on success, 0 on failure
*/
-HSTATIC
+static
int headerGetEntryMinMemory(Header h, int_32 tag,
/*@null@*/ /*@out@*/ hTYP_t type,
/*@null@*/ /*@out@*/ hPTR_t * p,
* @param c number of values
* @return 1 on success, 0 on failure
*/
-HSTATIC
+static
int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c)
/*@modifies h @*/
{
* @param c number of values
* @return 1 on success, 0 on failure
*/
-HSTATIC
+static
int headerAppendEntry(Header h, int_32 tag, int_32 type,
const void * p, int_32 c)
/*@modifies h @*/
* @param c number of values
* @return 1 on success, 0 on failure
*/
-HSTATIC
+static
int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type,
const void * p, int_32 c)
/*@modifies h @*/
* @param lang locale
* @return 1 on success, 0 on failure
*/
-HSTATIC
+static
int headerAddI18NString(Header h, int_32 tag, const char * string,
const char * lang)
/*@modifies h @*/
* @param c number of values
* @return 1 on success, 0 on failure
*/
-HSTATIC
+static
int headerModifyEntry(Header h, int_32 tag, int_32 type,
const void * p, int_32 c)
/*@modifies h @*/
* @retval errmsg error message (if any)
* @return formatted output string (malloc'ed)
*/
-HSTATIC /*@only@*/ /*@null@*/
+static /*@only@*/ /*@null@*/
char * headerSprintf(Header h, const char * fmt,
const struct headerTagTableEntry_s * tbltags,
const struct headerSprintfExtension_s * extensions,
* @param headerTo destination header
* @param tagstocopy array of tags that are copied
*/
-HSTATIC
+static
void headerCopyTags(Header headerFrom, Header headerTo, hTAG_t tagstocopy)
/*@modifies headerTo @*/
{
* @param hi header tag iterator
* @return NULL always
*/
-HSTATIC /*@null@*/
+static /*@null@*/
HeaderIterator headerFreeIterator(/*@only@*/ HeaderIterator hi)
/*@modifies hi @*/
{
* @param h header
* @return header tag iterator
*/
-HSTATIC
+static
HeaderIterator headerInitIterator(Header h)
/*@modifies h */
{
* @retval c address of number of values
* @return 1 on success, 0 on failure
*/
-HSTATIC
+static
int headerNextIterator(HeaderIterator hi,
/*@null@*/ /*@out@*/ hTAG_t tag,
/*@null@*/ /*@out@*/ hTYP_t type,
* @param h header
* @return new header instance
*/
-HSTATIC /*@null@*/
+static /*@null@*/
Header headerCopy(Header h)
/*@modifies h @*/
{
MODE_INSTALL = (1 << 1),
MODE_ERASE = (1 << 2),
- MODE_ROLLBACK = (1 << 14),
-#define MODES_IE (MODE_INSTALL | MODE_ERASE | MODE_ROLLBACK)
+#define MODES_IE (MODE_INSTALL | MODE_ERASE)
MODE_BUILD = (1 << 4),
MODE_REBUILD = (1 << 5),
#ifdef IAM_RPMEIU
case MODE_ERASE:
- if (!poptPeekArg(optCon))
- argerror(_("no packages given for erase"));
-
if (ia->noDeps) ia->eraseInterfaceFlags |= UNINSTALL_NODEPS;
- ec = rpmErase(ts, (const char **)poptGetArgs(optCon),
+ if (!poptPeekArg(optCon)) {
+ if (ia->rbtid == 0)
+ argerror(_("no packages given for erase"));
+ ec += rpmRollback(ts, ia, NULL);
+ } else {
+ ec += rpmErase(ts, (const char **)poptGetArgs(optCon),
ia->transFlags, ia->eraseInterfaceFlags);
+ }
break;
case MODE_INSTALL:
- if (!poptPeekArg(optCon))
- argerror(_("no packages given for install"));
-
/* RPMTRANS_FLAG_BUILD_PROBS */
/* RPMTRANS_FLAG_KEEPOBSOLETE */
}
/*@=branchstate@*/
- /*@-compdef@*/ /* FIX: ia->relocations[0].newPath undefined */
- ec += rpmInstall(ts, (const char **)poptGetArgs(optCon),
- ia->transFlags, ia->installInterfaceFlags, ia->probFilter,
- ia->relocations);
+ if (!poptPeekArg(optCon)) {
+ if (ia->rbtid == 0)
+ argerror(_("no packages given for install"));
+ ec += rpmRollback(ts, ia, NULL);
+ } else {
+ /*@-compdef@*/ /* FIX: ia->relocations[0].newPath undefined */
+ ec += rpmInstall(ts, (const char **)poptGetArgs(optCon),
+ ia->transFlags, ia->installInterfaceFlags,
+ ia->probFilter, ia->relocations);
+ }
/*@=compdef@*/
break;
- case MODE_ROLLBACK:
- ec += rpmRollback(ts, ia, (const char **)poptGetArgs(optCon));
- break;
-
#endif /* IAM_RPMEIU */
#ifdef IAM_RPMQV
#if !defined(IAM_RPMEIU)
case MODE_INSTALL:
case MODE_ERASE:
- case MODE_ROLLBACK:
#endif
case MODE_UNKNOWN:
if (!showVersion && !help && !noUsageMsg) printUsage();