summaryrefslogtreecommitdiff
path: root/cmdline/apt-changelog
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@canonical.com>2010-11-15 10:05:32 +0100
committerMartin Pitt <martin.pitt@canonical.com>2010-11-15 10:05:32 +0100
commitf229813f60e33ce78f8cd0733a55c36a17a9adf3 (patch)
tree78e07485383d54c75c808c7beb96638504625a8c /cmdline/apt-changelog
parente0043d1d27462edd71df1a3a8005383f9a3f5616 (diff)
* cmdline/apt-changelog: Read server name from configuration
APT::Changelog::Server instead of hardcoding it. This allows local users to point to a local changelog mirror, or make this script work for Debian. * Add debian/apt.conf.changelog: Configuration for apt-changelog with the server for Ubuntu (changelogs.ubuntu.com). Install it in debian/rules. * doc/apt-changelog.1.xml: Document the new option.
Diffstat (limited to 'cmdline/apt-changelog')
-rwxr-xr-xcmdline/apt-changelog10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmdline/apt-changelog b/cmdline/apt-changelog
index a333355a0..6d7c0e95f 100755
--- a/cmdline/apt-changelog
+++ b/cmdline/apt-changelog
@@ -47,10 +47,18 @@ version=${version#*:}
dir=`echo "$showsrc"| grep ^Directory:`
dir=${dir#Directory: }
+# get configuration
+eval `apt-config shell SERVER Apt::Changelog::Server`
+
+if [ -z "$SERVER" ]; then
+ echo "ERROR: You need to set Apt::Changelog::Server configuration option" >&2
+ exit 1
+fi
+
# fetch it
OUT=`mktemp -t "${pkg}.changes.XXXXXX"`
trap "rm $OUT" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
-if ! wget -q -O- http://changelogs.ubuntu.com/changelogs/$dir/${pkg}_${version}/changelog > "$OUT"
+if ! wget -q -O- ${SERVER}/$dir/${pkg}_${version}/changelog > "$OUT"
then
echo "ERROR: changelog for this version is not (yet) available; try https://launchpad.net/ubuntu/+source/$pkg/+changelog" >&2
exit 1