New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show changelog from PPA packages #56

Closed
darealshinji opened this Issue Aug 1, 2014 · 11 comments

Comments

Projects
None yet
6 participants
@darealshinji
Copy link
Contributor

darealshinji commented Aug 1, 2014

I'd be nice if mintUpdate would somehow be able to download the changelog from PPA packages too.

@monsta

This comment has been minimized.

Copy link
Contributor

monsta commented Aug 12, 2014

@darealshinji

This comment has been minimized.

Copy link
Contributor Author

darealshinji commented Aug 12, 2014

I could think of three possible solutions:

  1. Download the *.debian.tar.gz file if it doesn't exceed a certain file size and use the changelog file inside.
  2. LP always shows the last changelog entry. The site with the entry could be saved and the changelog entry could be extracted from the HTML file.
  3. Download the available *.diff.gz file and get the newest changelog entry from there.
    Solution No.1 is probably the easiest.

edit:
It seems like someone contributed a patch for update-manager 4 years ago which would fix that: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/254552
Perhaps the code could be integrated into mintupdate?

@clefebvre

This comment has been minimized.

Copy link
Member

clefebvre commented Nov 6, 2014

That'd be nice. If someone wants to make this a PR.

Also in mintsources it would be nice to be able to see the content (i.e. the list of provided source packages) of the PPAs.

@darealshinji

This comment has been minimized.

Copy link
Contributor Author

darealshinji commented Dec 1, 2014

I don't know how to do this in Python, so here's a shell script that will display the changelog of a PPA source package:

#!/bin/sh

# PPA adress, i.e.: ppa:djcj/nightingale
ppa=${1}

# source package name, i.e.: nightingale
srcpkg=${2}

# version, i.e.: 1.13+20141127-1~utopic
version=${3}

# Maximum size of the *.debian.tar.* file.
# If the filesize exceeds, the file won't be downloaded.
debtarball_maxsize=800000


debsrc=http://ppa.launchpad.net/$(echo $ppa | cut -d: -f2)/ubuntu

if [ $(echo $srcpkg | head -c3) = lib ] ; then
   short=$(echo $srcpkg | head -c4)
else
   short=$(echo $srcpkg | head -c1)
fi
srcurl=${debsrc}/pool/main/${short}/${srcpkg}

debtarball_info=$(wget -q -O - ${srcurl}/${srcpkg}_${version}.dsc | \
                  grep ${srcpkg}_${version}.debian.tar. | head -n1)
test -z "$debtarball_info" && exit 0

debtarball=$(echo $debtarball_info | cut -d' ' -f3)
debtarball_size=$(echo $debtarball_info | cut -d' ' -f2)
test $debtarball_size -ge $debtarball_maxsize && exit 0

cd /tmp
rm -rf $debtarball debian
wget -q $srcurl/$debtarball

tar xvf $debtarball >/dev/null
cat debian/changelog
rm -rf $debtarball debian

Usage is ./get-ppa-changelog.sh <ppa> <source package name> <version>.

Example: ./get-ppa-changelog.sh ppa:djcj/nightingale nightingale 1.13+20141127-1~utopic

To list the PPA's content for usage in mintsources you can use the information provided in the Sources file:

#!/bin/sh

# PPA adress, i.e.: ppa:lubuntu-dev/lubuntu-daily
ppa=${1}

# distribution codename, i.e.: utopic
distro=${2}

debsrc=http://ppa.launchpad.net/$(echo $ppa | cut -d: -f2)/ubuntu
sources=${debsrc}/dists/${distro}/main/source/Sources
wget -q -O - $sources

Usage: ./get-ppa-sources.sh <ppa> <distro>
Example: ./get-ppa-sources.sh lubuntu-dev/lubuntu-daily trusty

edit: scripts updated

@darealshinji

This comment has been minimized.

Copy link
Contributor Author

darealshinji commented Dec 13, 2014

I've reworked the changelog script a little: https://gist.github.com/darealshinji/68e63b7591898dd8cf0c

Input is now ./get-ppa-changelog.sh <binary package URL> <source package name>

Example: ./get-ppa-changelog.sh http://ppa.launchpad.net/lubuntu-dev/lubuntu-daily/ubuntu/pool/main/k/kguiaddons/libkf5guiaddons-dev_5.3.0-0ubuntu1%7Eppa1_amd64.deb kguiaddons

@TheDevKing

This comment has been minimized.

Copy link

TheDevKing commented Aug 2, 2015

I'd love to see this attempted, even if there isn't a 100% reliable way to get a changelog. In the event a changelog is not found it could just default to the "Changelog not found" message. Sometimes is better than never, no?

brennanhm added a commit to brennanhm/mintupdate that referenced this issue Nov 27, 2015

@brennanhm

This comment has been minimized.

Copy link
Contributor

brennanhm commented Nov 27, 2015

Hi guys,

I was looking for a way to contribute to the Linux Mint codebase and after asking on IRC where to begin, I decided to start working on this issue. The new code checks whether or not the change information was successfully fetched from the official sources. If not, it attempts to extract the latest change record from Launchpad's site. So far I've tested it successfully on four different PPAs. I'm relatively new to Python, but eager to learn and open to feedback :)

@brennanhm

This comment has been minimized.

Copy link
Contributor

brennanhm commented Nov 27, 2015

I tried using two different methods to get the PPA owner and name, which are required to build the Launchpad URL. The first method, which is commented out, would throw an exception (during the apt-cache command) if the package hadn't been installed. The second method works even if the package hasn't been installed.

@brennanhm

This comment has been minimized.

Copy link
Contributor

brennanhm commented Sep 19, 2016

Hi,
The coded solution for this feature request was merged on April 19th, so can it be closed now?
https://github.com/linuxmint/mintupdate/pull/128/files

@monsta

This comment has been minimized.

Copy link
Contributor

monsta commented Sep 19, 2016

Yes, and thanks for this feature 😄

@monsta monsta closed this Sep 19, 2016

@brennanhm

This comment has been minimized.

Copy link
Contributor

brennanhm commented Sep 19, 2016

No problem! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment