aptly-dev / aptly

aptly - Debian repository management tool
https://www.aptly.info/
MIT License
2.58k stars 375 forks source link

Feature Request: support of changelogs #170

Open Un1oR opened 9 years ago

Un1oR commented 9 years ago

Hi, apt-get has changelog option:

changelog downloads a package changelog and displays it through sensible-pager. The server name and base directory is defined in the APT::Changelogs::Server variable (e.g. packages.debian.org/changelogs[1] for Debian or changelogs.ubuntu.com/changelogs[2] for Ubuntu).

For third party repositories apt uses this function to determine changelog URI. It would be nice to allow publishing changelogs along with packages at appropriate URIs.

Un1oR commented 9 years ago

But it seems there is a problem: synaptic and apt uses different algorithms to calculate changelog URI: https://github.com/Debian/apt/blob/debian/experimental/cmdline/apt-get.cc#L1421 vs https://github.com/linuxmint/synaptic/blob/master/common/rpackage.cc#L989 In this way I get http://my-repo-host/my-package_1.2.3.changelog for apt and http://my-repo-host/my-package_1.2.3_amd64.changelog for synaptic.

fpytloun commented 9 years ago

Hello,

I would also appreciate possibility to access package changelogs. Maybe also via REST API with possibility to show whole changelog or just it's diff between two versions. So in my use case I could easily diff packages between snapshots and show it's differences.

jlu5 commented 7 years ago

AFAIK, apt has since changed the way it looks up changelogs. man apt.conf hints that the location of a changelog can be set using a "Changelogs" field in the Release file, but I'm not clear on what format it's exactly looking for.

Synaptic, on the other hand, still uses the NAME_VERSION_ARCH.changelog format. In order to generate changelogs for Synaptic, I've been running this script over the aptly public/ folder this script, which automatically writes .changelog files into the same folder as each .deb.

man apt.conf snippet:

       Changelogs::URI scope
           Acquiring changelogs can only be done if an URI is known from where to get them. Preferable the Release file indicates this in a 'Changelogs' field. If this isn't
           available the Label/Origin field of the Release file is used to check if a Acquire::Changelogs::URI::Label::LABEL or Acquire::Changelogs::URI::Origin::ORIGIN option
           exists and if so this value is taken. The value in the Release file can be overridden with Acquire::Changelogs::URI::Override::Label::LABEL or
           Acquire::Changelogs::URI::Override::Origin::ORIGIN. The value should be a normal URI to a text file, except that package specific data is replaced with the placeholder
           @CHANGEPATH@. The value for it is: 1. if the package is from a component (e.g.  main) this is the first part otherwise it is omitted, 2. the first letter of source
           package name, except if the source package name starts with 'lib' in which case it will be the first four letters. 3. The complete source package name. 4. the complete
           name again and 5. the source version. The first (if present), second, third and fourth part are separated by a slash ('/') and between the fourth and fifth part is an
           underscore ('_'). The special value 'no' is available for this option indicating that this source can't be used to acquire changelog files from. Another source will be
           tried if available in this case.
bauen1 commented 2 years ago

Aptitude has a hardcoded check against the Origin field, and will only show/download a changelog if it believes the repository to come from debian:

https://sources.debian.org/src/aptitude/0.8.13-4/src/generic/apt/pkg_changelog.cc/#L687-L705

A bug has already been filed in 2018 about it, but so far nothing has changed upstream: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=889924