diff options
author | jbj <devnull@localhost> | 2002-02-04 16:53:51 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-02-04 16:53:51 +0000 |
commit | 696c5d9d67e4bde344b921c94ffad5a8ad075ce8 (patch) | |
tree | a697b8b6e4ea2c9bc3e88f017ff1bc7ec852f886 | |
parent | 81d60b470679acaab73d37f6a2f3f2dc6b3cba60 (diff) | |
download | rpm-696c5d9d67e4bde344b921c94ffad5a8ad075ce8.tar.gz |
rollback changes from 4.0.4.
CVS patchset: 5297
CVS date: 2002/02/04 16:53:51
-rw-r--r-- | lib/fsm.c | 21 | ||||
-rw-r--r-- | lib/rpminstall.c | 1 | ||||
-rw-r--r-- | lib/rpmlib.h | 19 | ||||
-rw-r--r-- | po/rpm.pot | 156 | ||||
-rw-r--r-- | rpm.spec.in | 3 | ||||
-rw-r--r-- | rpmdb/rpmdb.c | 2 | ||||
-rwxr-xr-x | rpmqv.c | 11 | ||||
-rw-r--r-- | scripts/Makefile.am | 6 | ||||
-rwxr-xr-x | scripts/rpm2cpio.sh | 26 |
9 files changed, 150 insertions, 95 deletions
@@ -675,8 +675,16 @@ int fsmMapAttrs(FSM_t fsm) if (fsm->mapFlags & CPIO_MAP_GID) st->st_gid = finalGid; - fsm->fmd5sum = (fi->fmd5s ? fi->fmd5s[i] : NULL); - fsm->md5sum = (fi->md5s ? (fi->md5s + (16 * i)) : NULL); + { rpmTransactionSet ts = fsmGetTs(fsm); + + if (ts != NULL && !(ts->transFlags & RPMTRANS_FLAG_NOMD5)) { + fsm->fmd5sum = (fi->fmd5s ? fi->fmd5s[i] : NULL); + fsm->md5sum = (fi->md5s ? (fi->md5s + (16 * i)) : NULL); + } else { + fsm->fmd5sum = NULL; + fsm->md5sum = NULL; + } + } } return 0; @@ -1647,7 +1655,9 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; if (rc == CPIOERR_LSTAT_FAILED) rc = fsmStage(fsm, FSM_MKNOD); } else { - rc = CPIOERR_UNKNOWN_FILETYPE; + /* XXX Special case /dev/log, which shouldn't be packaged anyways */ + if (strncmp(fsm->path, "/dev/log;", sizeof("/dev/log;")-1)) + rc = CPIOERR_UNKNOWN_FILETYPE; } if (!S_ISDIR(st->st_mode) && st->st_nlink > 1) { fsm->li->createdPath = fsm->li->linkIndex; @@ -1767,7 +1777,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; break; } - if (!S_ISSOCK(st->st_mode)) { /* XXX /dev/log et al are skipped */ + /* XXX Special case /dev/log, which shouldn't be packaged anyways */ + if (!S_ISSOCK(st->st_mode) + && strncmp(fsm->path, "/dev/log;", sizeof("/dev/log;")-1)) + { /* Rename temporary to final file name. */ if (!S_ISDIR(st->st_mode) && (fsm->subdir || fsm->suffix || fsm->nsuffix)) diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 4052ccbae..7ff178d69 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -1051,6 +1051,7 @@ int rpmRollback(rpmTransactionSet ts, goto exit; /* Clean up after successful rollback. */ + if (!rpmIsDebug()) for (i = 0; i < rtids->nidt; i++) { IDT rrp = rtids->idt + i; if (rrp->val.u32 != thistid) diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 57853fef2..4b34fbbe7 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -1541,22 +1541,23 @@ typedef enum rpmtransFlags_e { /*@=enummemuse@*/ RPMTRANS_FLAG_REVERSE = (1 << 15), - RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16), - RPMTRANS_FLAG_NOPRE = (1 << 17), - RPMTRANS_FLAG_NOPOST = (1 << 18), - RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19), - RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20), - RPMTRANS_FLAG_NOPREUN = (1 << 21), - RPMTRANS_FLAG_NOPOSTUN = (1 << 22), - RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23), + RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16), /*!< from --notriggerprein */ + RPMTRANS_FLAG_NOPRE = (1 << 17), /*!< from --nopre */ + RPMTRANS_FLAG_NOPOST = (1 << 18), /*!< from --nopost */ + RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19), /*!< from --notriggerin */ + RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20), /*!< from --notriggerun */ + RPMTRANS_FLAG_NOPREUN = (1 << 21), /*!< from --nopreun */ + RPMTRANS_FLAG_NOPOSTUN = (1 << 22), /*!< from --nopostun */ + RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23), /*!< from --notriggerpostun */ /*@-enummemuse@*/ RPMTRANS_FLAG_NOPAYLOAD = (1 << 24), /*@=enummemuse@*/ RPMTRANS_FLAG_APPLYONLY = (1 << 25), /*@-enummemuse@*/ - RPMTRANS_FLAG_CHAINSAW = (1 << 26) + RPMTRANS_FLAG_CHAINSAW = (1 << 26), /*@=enummemuse@*/ + RPMTRANS_FLAG_NOMD5 = (1 << 27) /*!< from --nomd5 */ } rpmtransFlags; #define _noTransScripts \ diff --git a/po/rpm.pot b/po/rpm.pot index 783e818c1..633dc3b52 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2002-02-02 17:37-0500\n" +"POT-Creation-Date: 2002-02-04 10:09-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" @@ -206,225 +206,225 @@ msgstr "" msgid "Usage: %s {--help}\n" msgstr "" -#: rpmqv.c:588 +#: rpmqv.c:593 msgid "The --rcfile option has been eliminated.\n" msgstr "" -#: rpmqv.c:589 +#: rpmqv.c:594 msgid "Use \"--macros <file:...>\" instead.\n" msgstr "" -#: rpmqv.c:595 +#: rpmqv.c:600 #, c-format msgid "Internal error in argument processing (%d) :-(\n" msgstr "" -#: rpmqv.c:636 rpmqv.c:642 rpmqv.c:648 rpmqv.c:686 +#: rpmqv.c:641 rpmqv.c:647 rpmqv.c:653 rpmqv.c:691 msgid "only one major mode may be specified" msgstr "" -#: rpmqv.c:665 +#: rpmqv.c:670 msgid "one type of query/verify may be performed at a time" msgstr "" -#: rpmqv.c:669 +#: rpmqv.c:674 msgid "unexpected query flags" msgstr "" -#: rpmqv.c:672 +#: rpmqv.c:677 msgid "unexpected query format" msgstr "" -#: rpmqv.c:675 +#: rpmqv.c:680 msgid "unexpected query source" msgstr "" -#: rpmqv.c:716 +#: rpmqv.c:721 msgid "--dbpath given for operation that does not use a database" msgstr "" -#: rpmqv.c:722 +#: rpmqv.c:727 msgid "only installation, upgrading, rmsource and rmspec may be forced" msgstr "" -#: rpmqv.c:724 +#: rpmqv.c:729 msgid "files may only be relocated during package installation" msgstr "" -#: rpmqv.c:727 +#: rpmqv.c:732 msgid "only one of --prefix or --relocate may be used" msgstr "" -#: rpmqv.c:730 +#: rpmqv.c:735 msgid "" "--relocate and --excludepath may only be used when installing new packages" msgstr "" -#: rpmqv.c:733 +#: rpmqv.c:738 msgid "--prefix may only be used when installing new packages" msgstr "" -#: rpmqv.c:736 +#: rpmqv.c:741 msgid "arguments to --prefix must begin with a /" msgstr "" -#: rpmqv.c:739 +#: rpmqv.c:744 msgid "--hash (-h) may only be specified during package installation" msgstr "" -#: rpmqv.c:743 +#: rpmqv.c:748 msgid "--percent may only be specified during package installation" msgstr "" -#: rpmqv.c:748 +#: rpmqv.c:753 msgid "--replacefiles may only be specified during package installation" msgstr "" -#: rpmqv.c:752 +#: rpmqv.c:757 msgid "--replacepkgs may only be specified during package installation" msgstr "" -#: rpmqv.c:756 +#: rpmqv.c:761 msgid "--excludedocs may only be specified during package installation" msgstr "" -#: rpmqv.c:760 +#: rpmqv.c:765 msgid "--includedocs may only be specified during package installation" msgstr "" -#: rpmqv.c:764 +#: rpmqv.c:769 msgid "only one of --excludedocs and --includedocs may be specified" msgstr "" -#: rpmqv.c:768 +#: rpmqv.c:773 msgid "--ignorearch may only be specified during package installation" msgstr "" -#: rpmqv.c:772 +#: rpmqv.c:777 msgid "--ignoreos may only be specified during package installation" msgstr "" -#: rpmqv.c:777 +#: rpmqv.c:782 msgid "--ignoresize may only be specified during package installation" msgstr "" -#: rpmqv.c:781 +#: rpmqv.c:786 msgid "--allmatches may only be specified during package erasure" msgstr "" -#: rpmqv.c:785 +#: rpmqv.c:790 msgid "--allfiles may only be specified during package installation" msgstr "" -#: rpmqv.c:790 +#: rpmqv.c:795 msgid "--justdb may only be specified during package installation and erasure" msgstr "" -#: rpmqv.c:795 +#: rpmqv.c:800 msgid "" "script disabling options may only be specified during package installation " "and erasure" msgstr "" -#: rpmqv.c:800 +#: rpmqv.c:805 msgid "" "trigger disabling options may only be specified during package installation " "and erasure" msgstr "" -#: rpmqv.c:804 +#: rpmqv.c:809 msgid "" "--nodeps may only be specified during package building, rebuilding, " "recompilation, installation,erasure, and verification" msgstr "" -#: rpmqv.c:809 +#: rpmqv.c:814 msgid "" "--test may only be specified during package installation, erasure, and " "building" msgstr "" -#: rpmqv.c:814 +#: rpmqv.c:819 msgid "" "--root (-r) may only be specified during installation, erasure, querying, " "and database rebuilds" msgstr "" -#: rpmqv.c:826 +#: rpmqv.c:831 msgid "arguments to --root (-r) must begin with a /" msgstr "" -#: rpmqv.c:850 +#: rpmqv.c:855 msgid "no files to sign\n" msgstr "" -#: rpmqv.c:855 +#: rpmqv.c:860 #, c-format msgid "cannot access file %s\n" msgstr "" -#: rpmqv.c:874 +#: rpmqv.c:879 msgid "pgp not found: " msgstr "" -#: rpmqv.c:879 +#: rpmqv.c:884 msgid "Enter pass phrase: " msgstr "" -#: rpmqv.c:881 +#: rpmqv.c:886 msgid "Pass phrase check failed\n" msgstr "" -#: rpmqv.c:885 +#: rpmqv.c:890 msgid "Pass phrase is good.\n" msgstr "" -#: rpmqv.c:890 +#: rpmqv.c:895 #, c-format msgid "Invalid %%_signature spec in macro file.\n" msgstr "" -#: rpmqv.c:897 +#: rpmqv.c:902 msgid "--sign may only be used during package building" msgstr "" -#: rpmqv.c:914 +#: rpmqv.c:919 msgid "exec failed\n" msgstr "" -#: rpmqv.c:946 +#: rpmqv.c:951 msgid "no packages files given for rebuild" msgstr "" -#: rpmqv.c:1014 +#: rpmqv.c:1019 msgid "no spec files given for build" msgstr "" -#: rpmqv.c:1016 +#: rpmqv.c:1021 msgid "no tar files given for build" msgstr "" -#: rpmqv.c:1038 +#: rpmqv.c:1043 msgid "no packages given for erase" msgstr "" -#: rpmqv.c:1078 +#: rpmqv.c:1085 msgid "no packages given for install" msgstr "" -#: rpmqv.c:1094 +#: rpmqv.c:1103 msgid "no arguments given for query" msgstr "" -#: rpmqv.c:1107 +#: rpmqv.c:1116 msgid "no arguments given for verify" msgstr "" -#: rpmqv.c:1115 +#: rpmqv.c:1124 msgid "unexpected arguments to --querytags " msgstr "" -#: rpmqv.c:1131 +#: rpmqv.c:1140 msgid "no arguments given" msgstr "" @@ -1547,37 +1547,37 @@ msgstr "" msgid "%10d %s\n" msgstr "" -#: lib/fsm.c:1185 +#: lib/fsm.c:1193 #, c-format msgid "%s directory created with perms %04o.\n" msgstr "" -#: lib/fsm.c:1470 +#: lib/fsm.c:1478 #, c-format msgid "archive file %s was not found in header file list\n" msgstr "" -#: lib/fsm.c:1591 lib/fsm.c:1719 +#: lib/fsm.c:1599 lib/fsm.c:1729 #, c-format msgid "%s saved as %s\n" msgstr "" -#: lib/fsm.c:1745 +#: lib/fsm.c:1755 #, c-format msgid "%s rmdir of %s failed: Directory not empty\n" msgstr "" -#: lib/fsm.c:1751 +#: lib/fsm.c:1761 #, c-format msgid "%s rmdir of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1761 +#: lib/fsm.c:1771 #, c-format msgid "%s unlink of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1780 +#: lib/fsm.c:1793 #, c-format msgid "%s created as %s\n" msgstr "" @@ -3011,7 +3011,7 @@ msgstr "" msgid "error(%d) counting packages\n" msgstr "" -#: rpmdb/rpmdb.c:2097 rpmdb/rpmdb.c:3350 +#: rpmdb/rpmdb.c:2097 rpmdb/rpmdb.c:3352 #, c-format msgid "record number %u in database is bad -- skipping.\n" msgstr "" @@ -3036,84 +3036,84 @@ msgstr "" msgid "removing %d entries from %s index.\n" msgstr "" -#: rpmdb/rpmdb.c:2702 +#: rpmdb/rpmdb.c:2704 #, c-format msgid "error(%d) allocating new package instance\n" msgstr "" -#: rpmdb/rpmdb.c:2783 +#: rpmdb/rpmdb.c:2785 #, c-format msgid "adding \"%s\" to %s index.\n" msgstr "" -#: rpmdb/rpmdb.c:2794 +#: rpmdb/rpmdb.c:2796 #, c-format msgid "adding %d entries to %s index.\n" msgstr "" -#: rpmdb/rpmdb.c:3236 +#: rpmdb/rpmdb.c:3238 #, c-format msgid "removing %s after successful db3 rebuild.\n" msgstr "" -#: rpmdb/rpmdb.c:3269 +#: rpmdb/rpmdb.c:3271 msgid "no dbpath has been set" msgstr "" -#: rpmdb/rpmdb.c:3296 +#: rpmdb/rpmdb.c:3298 #, c-format msgid "rebuilding database %s into %s\n" msgstr "" -#: rpmdb/rpmdb.c:3300 +#: rpmdb/rpmdb.c:3302 #, c-format msgid "temporary database %s already exists\n" msgstr "" -#: rpmdb/rpmdb.c:3306 +#: rpmdb/rpmdb.c:3308 #, c-format msgid "creating directory %s\n" msgstr "" -#: rpmdb/rpmdb.c:3308 +#: rpmdb/rpmdb.c:3310 #, c-format msgid "creating directory %s: %s\n" msgstr "" -#: rpmdb/rpmdb.c:3315 +#: rpmdb/rpmdb.c:3317 #, c-format msgid "opening old database with dbapi %d\n" msgstr "" -#: rpmdb/rpmdb.c:3326 +#: rpmdb/rpmdb.c:3328 #, c-format msgid "opening new database with dbapi %d\n" msgstr "" -#: rpmdb/rpmdb.c:3390 +#: rpmdb/rpmdb.c:3392 #, c-format msgid "cannot add record originally at %u\n" msgstr "" -#: rpmdb/rpmdb.c:3408 +#: rpmdb/rpmdb.c:3410 msgid "failed to rebuild database: original database remains in place\n" msgstr "" -#: rpmdb/rpmdb.c:3416 +#: rpmdb/rpmdb.c:3418 msgid "failed to replace old database with new database!\n" msgstr "" -#: rpmdb/rpmdb.c:3418 +#: rpmdb/rpmdb.c:3420 #, c-format msgid "replace files in %s with files from %s to recover" msgstr "" -#: rpmdb/rpmdb.c:3428 +#: rpmdb/rpmdb.c:3430 #, c-format msgid "removing directory %s\n" msgstr "" -#: rpmdb/rpmdb.c:3430 +#: rpmdb/rpmdb.c:3432 #, c-format msgid "failed to remove directory %s: %s\n" msgstr "" diff --git a/rpm.spec.in b/rpm.spec.in index b9aea1625..0e11d672a 100644 --- a/rpm.spec.in +++ b/rpm.spec.in @@ -349,6 +349,7 @@ fi %attr(0644, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/macros %rpmattr %{__prefix}/lib/rpm/mkinstalldirs %rpmattr %{__prefix}/lib/rpm/rpm.* +%rpmattr %{__prefix}/lib/rpm/rpm2cpio.sh %rpmattr %{__prefix}/lib/rpm/rpm[deiukqv] %attr(0644, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/rpmpopt* %attr(0644, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/rpmrc @@ -444,6 +445,7 @@ fi %rpmattr %{__prefix}/lib/rpm/rpm[bt] %rpmattr %{__prefix}/lib/rpm/rpmdiff %rpmattr %{__prefix}/lib/rpm/rpmdiff.cgi +%rpmattr %{__prefix}/lib/rpm/trpm %rpmattr %{__prefix}/lib/rpm/u_pkg.sh %rpmattr %{__prefix}/lib/rpm/vpkg-provides.sh %rpmattr %{__prefix}/lib/rpm/vpkg-provides2.sh @@ -629,3 +631,4 @@ fi - 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. +- transaction rollbacks are functional. diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index dd4f1be1e..51f0a1abe 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -2632,7 +2632,9 @@ int rpmdbAdd(rpmdb db, int iid, Header h) if (db == NULL) return 0; +#ifdef NOTYET /* XXX headerRemoveEntry() broken on dribbles. */ xx = headerRemoveEntry(h, RPMTAG_REMOVETID); +#endif if (iid != 0 && iid != -1) { int_32 tid = iid; if (!headerIsEntry(h, RPMTAG_INSTALLTID)) @@ -478,7 +478,12 @@ int main(int argc, const char ** argv) ka->qva_flags |= VERIFY_MD5; else #endif - /*@-ifempty@*/ ; +#ifdef IAM_RPMEIU + if (bigMode & MODES_IE) + ia->transFlags |= RPMTRANS_FLAG_NOMD5; + else +#endif + {}; /*@switchbreak@*/ break; #endif /* IAM_RPMQV || IAM_RPMK */ @@ -1036,6 +1041,8 @@ int main(int argc, const char ** argv) if (!poptPeekArg(optCon)) { if (ia->rbtid == 0) argerror(_("no packages given for erase")); +ia->transFlags |= RPMTRANS_FLAG_NOMD5; +ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE; ec += rpmRollback(ts, ia, NULL); } else { ec += rpmErase(ts, (const char **)poptGetArgs(optCon), @@ -1076,6 +1083,8 @@ int main(int argc, const char ** argv) if (!poptPeekArg(optCon)) { if (ia->rbtid == 0) argerror(_("no packages given for install")); +ia->transFlags |= RPMTRANS_FLAG_NOMD5; +ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE; ec += rpmRollback(ts, ia, NULL); } else { /*@-compdef@*/ /* FIX: ia->relocations[0].newPath undefined */ diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 9ab7864e9..721090539 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -9,7 +9,7 @@ EXTRA_DIST = \ 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 \ - rpm.daily rpm.log rpm.xinetd \ + rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \ sql.prov sql.req tcl.req trpm u_pkg.sh \ vpkg-provides.sh vpkg-provides2.sh @@ -25,6 +25,6 @@ config_SCRIPTS = \ 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 \ - rpm.daily rpm.log rpm.xinetd \ - sql.prov sql.req tcl.req u_pkg.sh \ + rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \ + sql.prov sql.req tcl.req trpm u_pkg.sh \ vpkg-provides.sh vpkg-provides2.sh diff --git a/scripts/rpm2cpio.sh b/scripts/rpm2cpio.sh new file mode 100755 index 000000000..a9269c70b --- /dev/null +++ b/scripts/rpm2cpio.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +pkg=$1 +if [ "$pkg" = "" -o ! -e "$pkg" ]; then + echo "no package supplied" 1>&2 + exit 1 +fi + +leadsize=96 +o=`expr $leadsize + 8` +set `od -j $o -N 8 -t u1 $pkg` +il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5` +dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9` +# echo "sig il: $il dl: $dl" + +sigsize=`expr 8 + 16 \* $il + $dl` +o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8` +set `od -j $o -N 8 -t u1 $pkg` +il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5` +dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9` +# echo "hdr il: $il dl: $dl" + +hdrsize=`expr 8 + 16 \* $il + $dl` +o=`expr $o + $hdrsize` + +dd if=$pkg ibs=$o skip=1 2>/dev/null | gunzip |