]> git.saurik.com Git - apt.git/commitdiff
* cmdline/apt-changelog: Read server name from configuration
authorMartin Pitt <martin.pitt@canonical.com>
Mon, 15 Nov 2010 09:05:32 +0000 (10:05 +0100)
committerMartin Pitt <martin.pitt@canonical.com>
Mon, 15 Nov 2010 09:05:32 +0000 (10:05 +0100)
  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.

cmdline/apt-changelog
debian/apt.conf.changelog [new file with mode: 0644]
debian/changelog
debian/rules
doc/apt-changelog.1.xml

index a333355a0983415fb02c1031f501bfa8f27d2f8d..6d7c0e95fca2ca219755f1973266f2e971177477 100755 (executable)
@@ -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
diff --git a/debian/apt.conf.changelog b/debian/apt.conf.changelog
new file mode 100644 (file)
index 0000000..3466bb6
--- /dev/null
@@ -0,0 +1,6 @@
+// Server information for apt-changelog
+APT {
+  Changelog {
+    Server "http://changelogs.ubuntu.com/changelogs";
+  }
+}
index b7f290713bccd69bf6b84ecadbb2cd85956daf08..2f95d2e002c0c38d2c355245e8859ddaf6cd93eb 100644 (file)
@@ -2,6 +2,12 @@ apt (0.8.8ubuntu3) UNRELEASED; urgency=low
 
   * cmdline/apt-changelog: Filter out multiple results for a source package,
     just take the latest one.
+  * 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.
 
  -- Martin Pitt <martin.pitt@ubuntu.com>  Fri, 12 Nov 2010 16:53:31 +0100
 
index 9f3dca6279554f478fa996934c20e3b53b0f491a..ea0fec443cb6c7817012db2b86663aefb8df3a4d 100755 (executable)
@@ -216,6 +216,7 @@ apt: build build-doc debian/shlibs.local
        cp debian/apt.logrotate debian/$@/etc/logrotate.d/apt
        cp share/ubuntu-archive.gpg debian/$@/usr/share/$@
        cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove
+       cp debian/apt.conf.changelog debian/$@/etc/apt/apt.conf.d/20changelog
 
        # copy lintian override
        cp share/lintian-overrides debian/$@/usr/share/lintian/overrides/apt
index 2f545bb6843b2a57d91689ae9685eb681ae1e728..f881dad8ac4e93641086bdcdf79f43913beb38dc 100644 (file)
 
  <refsect1><title>Description</title>
    <para>
-   <command>apt-changelog</command> downloads a package changelog from
-   <ulink>http://changelogs.ubuntu.com</ulink> and displays it through
-   <command>sensible-pager</command>.
+   <command>apt-changelog</command> downloads a package changelog and displays
+   it through <command>sensible-pager</command>. The server name and base
+   directory is defined in the <literal>APT::Changelog::Server</literal>
+   variable (e. g. <ulink>http://packages.debian.org/changelogs</ulink> for
+   Debian or <ulink>http://changelogs.ubuntu.com/changelogs</ulink> for
+   Ubuntu).
    </para>
 
    <para>