ALT Linux Bugzilla
– Attachment 10219 Details for
Bug 41816
libapt кэширует информацию о подключенных репозиториях без API для её удаления или обновления
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
0001-Removing-caches-also-removes-in-memory-repository-me.patch
0001-Removing-caches-also-removes-in-memory-repository-me.patch (text/plain), 2.33 KB, created by
Aleksei Nikiforov
on 2022-01-27 15:44:00 MSK
(
hide
)
Description:
0001-Removing-caches-also-removes-in-memory-repository-me.patch
Filename:
MIME Type:
Creator:
Aleksei Nikiforov
Created:
2022-01-27 15:44:00 MSK
Size:
2.33 KB
patch
obsolete
>From 1f14a6a885649e96c6f02b14435de85e17d7ca5b Mon Sep 17 00:00:00 2001 >From: Aleksei Nikiforov <darktemplar@altlinux.org> >Date: Thu, 27 Jan 2022 14:35:59 +0300 >Subject: [PATCH] Removing caches also removes in-memory repository metainfo > cache > >--- > apt-pkg/cachefile.cc | 4 ++++ > apt-pkg/repository.h | 1 + > apt-pkg/rpm/rpmindexfile.cc | 10 ++++++++++ > apt-pkg/rpm/rpmindexfile.h | 2 ++ > 4 files changed, 17 insertions(+) > >diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc >index f81c26a4..1a54a933 100644 >--- a/apt-pkg/cachefile.cc >+++ b/apt-pkg/cachefile.cc >@@ -32,6 +32,8 @@ > #include <apt-pkg/version.h> > > #include <apti18n.h> >+ >+#include "rpm/rpmindexfile.h" > /*}}}*/ > > // lazyCacheFile::lazyCacheFile - Constructor /*{{{*/ >@@ -241,6 +243,8 @@ void pkgCacheFile::RemoveCaches() > const std::string pkgcache = _config->FindFile("Dir::Cache::pkgcache"); > const std::string srcpkgcache = _config->FindFile("Dir::Cache::srcpkgcache"); > >+ removeRepositoryCaches(); >+ > if ((!pkgcache.empty()) && RealFileExists(pkgcache)) > RemoveFile("RemoveCaches", pkgcache); > if ((!srcpkgcache.empty()) && RealFileExists(srcpkgcache)) >diff --git a/apt-pkg/repository.h b/apt-pkg/repository.h >index b0ff0913..e6a1838d 100644 >--- a/apt-pkg/repository.h >+++ b/apt-pkg/repository.h >@@ -52,6 +52,7 @@ class pkgRepository > if (Vendor) FingerPrintList = Vendor->FingerPrintList; > } > >+ virtual ~pkgRepository() = default; > }; > > #endif >diff --git a/apt-pkg/rpm/rpmindexfile.cc b/apt-pkg/rpm/rpmindexfile.cc >index 1fc454df..f55cb123 100644 >--- a/apt-pkg/rpm/rpmindexfile.cc >+++ b/apt-pkg/rpm/rpmindexfile.cc >@@ -34,6 +34,16 @@ > /*}}}*/ > vector<pkgRepository *> RepList; > >+void removeRepositoryCaches() >+{ >+ for (auto iter = RepList.begin(); iter != RepList.end(); ++iter) >+ { >+ delete *iter; >+ } >+ >+ RepList.clear(); >+} >+ > // rpmListIndex::Release* - Return the URI to the release file /*{{{*/ > // --------------------------------------------------------------------- > /* */ >diff --git a/apt-pkg/rpm/rpmindexfile.h b/apt-pkg/rpm/rpmindexfile.h >index 5f24e25c..13ee7c25 100644 >--- a/apt-pkg/rpm/rpmindexfile.h >+++ b/apt-pkg/rpm/rpmindexfile.h >@@ -23,6 +23,8 @@ class RPMHandler; > class RPMDBHandler; > class pkgRepository; > >+void removeRepositoryCaches(); >+ > class rpmIndexFile : public pkgIndexFile > { > >-- >2.33.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41816
: 10219 |
10230