diff options
| author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-09-14 11:46:06 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-14 22:22:13 +0100 |
| commit | edc92ea8def507ee6cdc6fb2946ca444bc9461a6 (patch) | |
| tree | 97a8c329cce62901c1b9f042a5c468564569d493 /meta/recipes-devtools/python/python-smartpm | |
| parent | 3f95a21c71938697a3c7d254909598ba38f9a07f (diff) | |
| download | poky-edc92ea8def507ee6cdc6fb2946ca444bc9461a6.tar.gz | |
python-smartpm: use md5 as the digest for rpm_sys channel
Use md5 sum instead of mtime as the "digest" method for rpm_sys channel.
The digest is used to determine if the channel has been updated. It was
found out that mtime was not a reliable digest. On some systems mtime
of the rpm db does not get updated after every transaction if transactions
(smart install / remove commands) are fired in quick succession. As a
consequence smartpm cache and rpm db get out of sync.
[YOCTO #10244]
(From OE-Core rev: e7267b4e78461e71a1175f93e2eb5e90272c2b47)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python-smartpm')
| -rw-r--r-- | meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch b/meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch new file mode 100644 index 0000000000..2f14a124ef --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | channels/rpm_sys: use md5sum instead of mtime as the digest | ||
| 2 | |||
| 3 | Use the internal getFileDigest() function (which defaults to md5) instead of | ||
| 4 | mtime for getting the file digest. On some systems mtime proved to be | ||
| 5 | unreliable because of delayed update. This caused smart to miss rpm db updates | ||
| 6 | and thus get its understanding of installed packages out of sync. | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> | ||
| 11 | --- | ||
| 12 | smart/channels/rpm_sys.py | 3 ++- | ||
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/smart/channels/rpm_sys.py b/smart/channels/rpm_sys.py | ||
| 16 | index b9fda27..6f1fe94 100644 | ||
| 17 | --- a/smart/channels/rpm_sys.py | ||
| 18 | +++ b/smart/channels/rpm_sys.py | ||
| 19 | @@ -22,6 +22,7 @@ | ||
| 20 | from smart.backends.rpm.header import RPMDBLoader | ||
| 21 | from smart.backends.rpm.base import getTS, rpm_join_dbpath | ||
| 22 | from smart.channel import PackageChannel | ||
| 23 | +from smart.util.filetools import getFileDigest | ||
| 24 | from smart import * | ||
| 25 | import os | ||
| 26 | |||
| 27 | @@ -35,7 +36,7 @@ class RPMSysChannel(PackageChannel): | ||
| 28 | dbdir = rpm_join_dbpath(sysconf.get("rpm-root", "/"), | ||
| 29 | sysconf.get("rpm-dbpath", "var/lib/rpm")) | ||
| 30 | path = os.path.join(dbdir, "Packages") | ||
| 31 | - digest = os.path.getmtime(path) | ||
| 32 | + digest = getFileDigest(path) | ||
| 33 | if digest == self._digest: | ||
| 34 | return True | ||
| 35 | self.removeLoaders() | ||
| 36 | -- | ||
| 37 | 2.6.6 | ||
| 38 | |||
