I understand that as apt-get changelog <package> gets its changelogs from changelog.ubuntu.com, running this command does not work to get the changelog for a package in a PPA, and the only real way that I have found is to apt-get source <package> and then look in debian/changelog. Is there a more efficient way of viewing the changelog of a package that is in a PPA in Terminal?

share|improve this question
    
You can see changelog in a browser at ppa homepage. – Pilot6 Sep 2 '15 at 15:43
    
@Pilot6: Yes, but I want to do it in Terminal in an efficient way. – Paranoid Panda Sep 2 '15 at 15:45
1  
I added another script that checks the package version. – Pilot6 Sep 2 '15 at 20:55
up vote 1 down vote accepted

The last changes to a PPA package can bee seen at

https://launchpad.net/~<ppa_user_name>/+archive/ubuntu/<PPA_name>/+files/<package_name>_<package_version>_source.changes

You can write a simple script that will extract this data.

The script can be like this

#!/bin/sh

wget -q -O - https://launchpad.net/~$1/+archive/ubuntu/$2/+files/$3_$4_source.changes | \
awk '/Changes:/{f=1;next}/Checksums/{f=0}flag'

Run it this way:

./changelog.sh <ppa_user_name> <ppa_name> <package_name> <package_version>

e.g.

./changelog.sh hanipouspilot rtlwifi rtlwifi-new-dkms 0.5

If you need a full changelog, not only the last entry, then you have to download and extract source. That can be also done by a script.

Another script that checks changelog of an installed pacakage

#!/bin/bash

data=`apt-cache policy $1 | awk '/\*\*\*/ {print $2} f{print $2;f=0} /\*\*\*/{f=1}'`
version=`echo $data | awk '{print $1}'`
version=`echo $version | sed -r s/^[0-9]+://`
URL=`echo $data | awk '{print $2}'`
if [ -z `echo $URL | grep ppa` ]; then
    echo "The package is not installed from PPA"
    exit
else
    user=`echo $URL | cut -d / -f 4`
    name=`echo $URL | cut -d / -f 5`
    wget  -q -O - https://launchpad.net/~$user/+archive/ubuntu/$name/+files/$1_${version}_source.changes | \
    awk '/Changes:/{f=1;next}/Checksums/{f=0}f' 
fi

It can be run by

./changelog.sh <package_name>
share|improve this answer
    
Is there no way then to specifically just download part of the source (the bit that contains the changelog) and then just extract that? Or does it not work like that? – Paranoid Panda Sep 2 '15 at 17:00
    
You can't download a part of an archive. But you can download a full archive, then extract a file from it. – Pilot6 Sep 2 '15 at 17:03
    
What if the archive is very large though, is there no way of going around downloading the entire archive? – Paranoid Panda Sep 2 '15 at 17:12
    
I do not think there is a way. Launchpad will not extract a file for you. – Pilot6 Sep 2 '15 at 17:17
    
If I contacted Debian, is there any way they could do it differently so that something like apt-get changelog <package> would work? – Paranoid Panda Sep 2 '15 at 17:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.