From 081fbea14d12f79c8d91ce4fe1f1004c7bc08656 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Apr 2017 17:39:06 +0200 Subject: error in update on Release information changes The value of Origin, Label, Codename and co can be used in user configuration from apts own pinning to unattended upgrades. A repository changing this values can therefore have serious effects on the behaviour of apt and other tools using these values. In a first step we will generate error messages for these changes now explaining the need for explicit confirmation and provide config options and commandline flags to accept them. --- apt-pkg/metaindex.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'apt-pkg/metaindex.h') diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 531143bcb..eeeb9d807 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -25,6 +25,8 @@ class IndexTarget; class pkgCacheGenerator; class OpProgress; +class metaIndexPrivate; + class metaIndex { public: @@ -43,7 +45,7 @@ public: TRI_YES, TRI_DONTCARE, TRI_NO, TRI_UNSET }; private: - void * const d; + metaIndexPrivate * const d; protected: std::vector *Indexes; // parsed from the sources.list @@ -70,8 +72,12 @@ public: TriState GetTrusted() const; std::string GetSignedBy() const; + std::string GetOrigin() const; + std::string GetLabel() const; + std::string GetVersion() const; std::string GetCodename() const; std::string GetSuite() const; + signed short GetDefaultPin() const; bool GetSupportsAcquireByHash() const; time_t GetValidUntil() const; time_t GetDate() const; @@ -112,6 +118,11 @@ public: bool IsArchitectureSupported(std::string const &arch) const; bool IsArchitectureAllSupportedFor(IndexTarget const &target) const; bool HasSupportForComponent(std::string const &component) const; + // FIXME: should be members of the class on abi break + APT_HIDDEN void SetOrigin(std::string const &origin); + APT_HIDDEN void SetLabel(std::string const &label); + APT_HIDDEN void SetVersion(std::string const &version); + APT_HIDDEN void SetDefaultPin(signed short const defaultpin); }; #endif -- cgit v1.2.3 From 96ebab48c25fcd1ee83729cdba4be8a6343a8766 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 28 May 2017 13:24:33 +0200 Subject: show a Release-Notes URI if infos were changed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This gives the repository owner a chance to explain why this change was needed – e.g. explaining the organisational changes or simply detailing the changes in the new release made. Note that this URI is also shown if the change is accepted, so it also draws attention to release notes of minor updates (if users watch apt output closely). --- apt-pkg/metaindex.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg/metaindex.h') diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index eeeb9d807..1951f118f 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -77,6 +77,7 @@ public: std::string GetVersion() const; std::string GetCodename() const; std::string GetSuite() const; + std::string GetReleaseNotes() const; signed short GetDefaultPin() const; bool GetSupportsAcquireByHash() const; time_t GetValidUntil() const; @@ -123,6 +124,7 @@ public: APT_HIDDEN void SetLabel(std::string const &label); APT_HIDDEN void SetVersion(std::string const &version); APT_HIDDEN void SetDefaultPin(signed short const defaultpin); + APT_HIDDEN void SetReleaseNotes(std::string const ¬es); }; #endif -- cgit v1.2.3