]> git.saurik.com Git - apt.git/commitdiff
use @CHANGEPATH@ as placeholder in changelog URI templates
authorDavid Kalnischkies <david@kalnischkies.de>
Wed, 2 Dec 2015 11:43:33 +0000 (12:43 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 2 Dec 2015 11:59:23 +0000 (12:59 +0100)
This should make it more obvious that CHANGEPATH is a placeholder which
apt will replace with a package specific path rather than a string
constant.

Mail-Reference: <87d1upgvaf.fsf@deep-thought.43-1.org>
Mail-Archive: https://lists.debian.org/debian-dak/2015/12/msg00005.html

17 files changed:
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h
apt-pkg/init.cc
doc/apt.conf.5.xml
doc/examples/configure-index
doc/po/apt-doc.pot
doc/po/de.po
doc/po/es.po
doc/po/fr.po
doc/po/it.po
doc/po/ja.po
doc/po/nl.po
doc/po/pl.po
doc/po/pt.po
doc/po/pt_BR.po
test/integration/test-apt-get-changelog
test/integration/test-bug-738785-switch-protocol

index 189d1e06bf17aff371efd0a1cc95ecc1c3e2ce44..e0f02b8e20238339edfc1d8b6bcafb8046e83ec0 100644 (file)
@@ -3178,7 +3178,7 @@ std::string pkgAcqChangelog::URI(std::string const &Template,
         char const * const Component, char const * const SrcName,
         char const * const SrcVersion)
 {
-   if (Template.find("CHANGEPATH") == std::string::npos)
+   if (Template.find("@CHANGEPATH@") == std::string::npos)
       return "";
 
    // the path is: COMPONENT/SRC/SRCNAME/SRCNAME_SRCVER, e.g. main/a/apt/1.1 or contrib/liba/libapt/2.0
@@ -3190,7 +3190,7 @@ std::string pkgAcqChangelog::URI(std::string const &Template,
    if (Component != NULL && strlen(Component) != 0)
       path = std::string(Component) + "/" + path;
 
-   return SubstVar(Template, "CHANGEPATH", path);
+   return SubstVar(Template, "@CHANGEPATH@", path);
 }
                                                                        /*}}}*/
 // AcqChangelog::Failed - Failure handler                              /*{{{*/
index d77b5f9eff63e1982e7e3bc33ea3990d95d613f2..134bbab7e70cd36b14ca98025120bb464398b05f 100644 (file)
@@ -1103,7 +1103,7 @@ class pkgAcqChangelog : public pkgAcquire::Item
 
    /** returns the URI to the changelog of this version
     *
-    *  \param Template URI where CHANGEPATH has to be filled in
+    *  \param Template URI where @CHANGEPATH@ has to be filled in
     *  \param Component in which the package resides, can be empty
     *  \param SrcName is the source package name
     *  \param SrcVersion is the source package version
index eab198fac32fb2711e02926b14afb7450e5dbc3b..c35477bf6db9b5715b9a168aeb804a3331b3f70b 100644 (file)
@@ -116,10 +116,10 @@ bool pkgInitConfig(Configuration &Cnf)
    Cnf.CndSet("Acquire::IndexTargets::deb-src::Sources::flatDescription", "$(RELEASE) Sources");
    Cnf.CndSet("Acquire::IndexTargets::deb-src::Sources::Optional", false);
 
-   Cnf.CndSet("Acquire::Changelogs::URI::Origin::Debian", "http://metadata.ftp-master.debian.org/changelogs/CHANGEPATH_changelog");
-   Cnf.CndSet("Acquire::Changelogs::URI::Origin::Tanglu", "http://metadata.tanglu.org/changelogs/CHANGEPATH_changelog");
-   Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ubuntu", "http://changelogs.ubuntu.com/changelogs/pool/CHANGEPATH/changelog");
-   Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ultimedia", "http://packages.ultimediaos.com/changelogs/pool/CHANGEPATH/changelog.txt");
+   Cnf.CndSet("Acquire::Changelogs::URI::Origin::Debian", "http://metadata.ftp-master.debian.org/changelogs/@CHANGEPATH@_changelog");
+   Cnf.CndSet("Acquire::Changelogs::URI::Origin::Tanglu", "http://metadata.tanglu.org/changelogs/@CHANGEPATH@_changelog");
+   Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ubuntu", "http://changelogs.ubuntu.com/changelogs/pool/@CHANGEPATH@/changelog");
+   Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ultimedia", "http://packages.ultimediaos.com/changelogs/pool/@CHANGEPATH@/changelog.txt");
 
    bool Res = true;
 
index e6cbc8bc464eba2c1264ea566b705d02cfadd881..54f1de22fe914b8c674bd8002d9a3e1ec6e5fee6 100644 (file)
@@ -657,7 +657,7 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
          or <literal>Acquire::Changelogs::URI::Override::Origin::<replaceable>ORIGIN</replaceable></literal>.
 
          The value should be a normal URI to a text file, expect that package specific data is
-         replaced with the placeholder <literal>CHANGEPATH</literal>. The
+         replaced with the placeholder <literal>@CHANGEPATH@</literal>. The
          value for it is: 1. if the package is from a component (e.g. <literal>main</literal>)
          this is the first part otherwise it is omitted, 2. the first letter of source package name,
          expect if the source package name starts with '<literal>lib</literal>' in which case it will
index 1339335fa905f8a0682d20c050b0d7203557f2b6..db85654cacaedce8ee775c9d59cd247bcd86d227 100644 (file)
@@ -298,8 +298,8 @@ Acquire
      "fr";
   };
 
-  // Location of the changelogs with the placeholder CHANGEPATH (e.g. "main/a/apt/apt_1.1")
-  Changelogs::URI::Origin::Debian "http://metadata.ftp-master.debian.org/changelogs/CHANGEPATH_changelog";
+  // Location of the changelogs with the placeholder @CHANGEPATH@ (e.g. "main/a/apt/apt_1.1")
+  Changelogs::URI::Origin::Debian "http://metadata.ftp-master.debian.org/changelogs/@CHANGEPATH@_changelog";
 };
 
 // Directory layout
index da32a7269d193732c6a01f59cafcd85c049a8a2d..2b277b11dc913b41b1db8b27cf2e1fc04c983bcc 100644 (file)
@@ -3498,7 +3498,7 @@ msgid ""
 "<literal>Acquire::Changelogs::URI::Override::Origin::<replaceable>ORIGIN</replaceable></literal>.  "
 "The value should be a normal URI to a text file, expect that package "
 "specific data is replaced with the placeholder "
-"<literal>CHANGEPATH</literal>. The value for it is: 1. if the package is "
+"<literal>@CHANGEPATH@</literal>. The value for it is: 1. if the package is "
 "from a component (e.g. <literal>main</literal>)  this is the first part "
 "otherwise it is omitted, 2. the first letter of source package name, expect "
 "if the source package name starts with '<literal>lib</literal>' in which "
index 58d54976d2b31b1913d8ccc6d657f475a90e7bc1..953e8804f843255933ef84585d527b0b379913e8 100644 (file)
@@ -5057,7 +5057,7 @@ msgid ""
 "replaceable></literal> or <literal>Acquire::Changelogs::URI::Override::"
 "Origin::<replaceable>ORIGIN</replaceable></literal>.  The value should be a "
 "normal URI to a text file, expect that package specific data is replaced "
-"with the placeholder <literal>CHANGEPATH</literal>. The value for it is: 1. "
+"with the placeholder <literal>@CHANGEPATH@</literal>. The value for it is: 1. "
 "if the package is from a component (e.g. <literal>main</literal>)  this is "
 "the first part otherwise it is omitted, 2. the first letter of source "
 "package name, expect if the source package name starts with '<literal>lib</"
index 1fbe79554ef17749295959679991b3c07382eca6..a8191e2b2c69729f017b440ce8c30cf9b46c4698 100644 (file)
@@ -5099,7 +5099,7 @@ msgid ""
 "replaceable></literal> or <literal>Acquire::Changelogs::URI::Override::"
 "Origin::<replaceable>ORIGIN</replaceable></literal>.  The value should be a "
 "normal URI to a text file, expect that package specific data is replaced "
-"with the placeholder <literal>CHANGEPATH</literal>. The value for it is: 1. "
+"with the placeholder <literal>@CHANGEPATH@</literal>. The value for it is: 1. "
 "if the package is from a component (e.g. <literal>main</literal>)  this is "
 "the first part otherwise it is omitted, 2. the first letter of source "
 "package name, expect if the source package name starts with '<literal>lib</"
index 2cb53680b3b0f3193a7c81a01ae2c363cb2db3e3..f4c2e0ecd7597d5a1c0bc7fe56d0ad3dd8bf8d77 100644 (file)
@@ -5047,7 +5047,7 @@ msgid ""
 "replaceable></literal> or <literal>Acquire::Changelogs::URI::Override::"
 "Origin::<replaceable>ORIGIN</replaceable></literal>.  The value should be a "
 "normal URI to a text file, expect that package specific data is replaced "
-"with the placeholder <literal>CHANGEPATH</literal>. The value for it is: 1. "
+"with the placeholder <literal>@CHANGEPATH@</literal>. The value for it is: 1. "
 "if the package is from a component (e.g. <literal>main</literal>)  this is "
 "the first part otherwise it is omitted, 2. the first letter of source "
 "package name, expect if the source package name starts with '<literal>lib</"
index 56ceb1ccc3e553726ac39711174699d102224ac5..e3e767c55071b8f8d97253f70b4c9e67d8a4a3d0 100644 (file)
@@ -5074,7 +5074,7 @@ msgid ""
 "replaceable></literal> or <literal>Acquire::Changelogs::URI::Override::"
 "Origin::<replaceable>ORIGIN</replaceable></literal>.  The value should be a "
 "normal URI to a text file, expect that package specific data is replaced "
-"with the placeholder <literal>CHANGEPATH</literal>. The value for it is: 1. "
+"with the placeholder <literal>@CHANGEPATH@</literal>. The value for it is: 1. "
 "if the package is from a component (e.g. <literal>main</literal>)  this is "
 "the first part otherwise it is omitted, 2. the first letter of source "
 "package name, expect if the source package name starts with '<literal>lib</"
index b007e0dd9baf8fe68f9ce7a0852239da1d199464..8dd876b0e5cdcff3e045eadbad82e09e737bb93c 100644 (file)
@@ -4883,7 +4883,7 @@ msgid ""
 "replaceable></literal> or <literal>Acquire::Changelogs::URI::Override::"
 "Origin::<replaceable>ORIGIN</replaceable></literal>.  The value should be a "
 "normal URI to a text file, expect that package specific data is replaced "
-"with the placeholder <literal>CHANGEPATH</literal>. The value for it is: 1. "
+"with the placeholder <literal>@CHANGEPATH@</literal>. The value for it is: 1. "
 "if the package is from a component (e.g. <literal>main</literal>)  this is "
 "the first part otherwise it is omitted, 2. the first letter of source "
 "package name, expect if the source package name starts with '<literal>lib</"
index f461a9ca8a7aa42c61ce18e8a9d6a22957ef0a9a..7a9c9fbaeaf10ae3e0c79f3cae596278bed4a938 100644 (file)
@@ -5138,7 +5138,7 @@ msgid ""
 "replaceable></literal> or <literal>Acquire::Changelogs::URI::Override::"
 "Origin::<replaceable>ORIGIN</replaceable></literal>.  The value should be a "
 "normal URI to a text file, expect that package specific data is replaced "
-"with the placeholder <literal>CHANGEPATH</literal>. The value for it is: 1. "
+"with the placeholder <literal>@CHANGEPATH@</literal>. The value for it is: 1. "
 "if the package is from a component (e.g. <literal>main</literal>)  this is "
 "the first part otherwise it is omitted, 2. the first letter of source "
 "package name, expect if the source package name starts with '<literal>lib</"
index 91017eb96b8aa4890f1ca2d8f976add06df8b0a5..cef4ca893664bd706274ac5d7e707a1064757077 100644 (file)
@@ -4720,7 +4720,7 @@ msgid ""
 "replaceable></literal> or <literal>Acquire::Changelogs::URI::Override::"
 "Origin::<replaceable>ORIGIN</replaceable></literal>.  The value should be a "
 "normal URI to a text file, expect that package specific data is replaced "
-"with the placeholder <literal>CHANGEPATH</literal>. The value for it is: 1. "
+"with the placeholder <literal>@CHANGEPATH@</literal>. The value for it is: 1. "
 "if the package is from a component (e.g. <literal>main</literal>)  this is "
 "the first part otherwise it is omitted, 2. the first letter of source "
 "package name, expect if the source package name starts with '<literal>lib</"
index 01f6bd8649b973e751bc75feeb9091ca19985121..a74cab262602cd3468cfd433b7f17d003e0295b5 100644 (file)
@@ -5028,7 +5028,7 @@ msgid ""
 "replaceable></literal> or <literal>Acquire::Changelogs::URI::Override::"
 "Origin::<replaceable>ORIGIN</replaceable></literal>.  The value should be a "
 "normal URI to a text file, expect that package specific data is replaced "
-"with the placeholder <literal>CHANGEPATH</literal>. The value for it is: 1. "
+"with the placeholder <literal>@CHANGEPATH@</literal>. The value for it is: 1. "
 "if the package is from a component (e.g. <literal>main</literal>)  this is "
 "the first part otherwise it is omitted, 2. the first letter of source "
 "package name, expect if the source package name starts with '<literal>lib</"
index 39944e99ba288d8eb0acbc056035c4b749853f1b..312ab815d983a84229f5f95d78fe4ece8803aa25 100644 (file)
@@ -3467,7 +3467,7 @@ msgid ""
 "replaceable></literal> or <literal>Acquire::Changelogs::URI::Override::"
 "Origin::<replaceable>ORIGIN</replaceable></literal>.  The value should be a "
 "normal URI to a text file, expect that package specific data is replaced "
-"with the placeholder <literal>CHANGEPATH</literal>. The value for it is: 1. "
+"with the placeholder <literal>@CHANGEPATH@</literal>. The value for it is: 1. "
 "if the package is from a component (e.g. <literal>main</literal>)  this is "
 "the first part otherwise it is omitted, 2. the first letter of source "
 "package name, expect if the source package name starts with '<literal>lib</"
index 1c0c45c61b266c2a8e2e475192294ec88a03fd9b..0a7cf662e3b48008504c7bc6d5fb4dd304801215 100755 (executable)
@@ -34,17 +34,17 @@ testsuccessequal "'http://changelogs.ubuntu.com/changelogs/pool/main/f/foo/foo_1
 'http://changelogs.ubuntu.com/changelogs/pool/main/libb/libbar/libbar_1.0/changelog' libbar.changelog" aptget changelog foo libbar --print-uris
 
 testsuccessequal "'http://localhost:${APTHTTPPORT}/main/f/foo/foo_1.0.changelog' foo.changelog
-'http://localhost:${APTHTTPPORT}/main/libb/libbar/libbar_1.0.changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Label::Debian="http://localhost:${APTHTTPPORT}/CHANGEPATH.changelog"
+'http://localhost:${APTHTTPPORT}/main/libb/libbar/libbar_1.0.changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Label::Debian="http://localhost:${APTHTTPPORT}/@CHANGEPATH@.changelog"
 
 sed -i '/^Origin: / a\
-Changelogs: http://example.org/CHANGEPATH-changelog' $(find rootdir/var/lib/apt/lists -name '*Release')
+Changelogs: http://example.org/@CHANGEPATH@-changelog' $(find rootdir/var/lib/apt/lists -name '*Release')
 rm -f rootdir/var/cache/apt/*.bin
 
 testsuccessequal "'http://example.org/main/f/foo/foo_1.0-changelog' foo.changelog
-'http://example.org/main/libb/libbar/libbar_1.0-changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Label::Debian="http://localhost:${APTHTTPPORT}/CHANGEPATH.changelog"
+'http://example.org/main/libb/libbar/libbar_1.0-changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Label::Debian="http://localhost:${APTHTTPPORT}/@CHANGEPATH@.changelog"
 
 testsuccessequal "'http://localhost:${APTHTTPPORT}/main/f/foo/foo_1.0.changelog' foo.changelog
-'http://localhost:${APTHTTPPORT}/main/libb/libbar/libbar_1.0.changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Override::Label::Debian="http://localhost:${APTHTTPPORT}/CHANGEPATH.changelog"
+'http://localhost:${APTHTTPPORT}/main/libb/libbar/libbar_1.0.changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Override::Label::Debian="http://localhost:${APTHTTPPORT}/@CHANGEPATH@.changelog"
 
 releasechanger 'Changelogs' 'no'
 if [ "$(id -u)" = '0' ]; then
@@ -57,11 +57,11 @@ fi
 sed -i '/^Changelogs: / d' $(find rootdir/var/lib/apt/lists -name '*Release')
 releasechanger 'Label' 'Testcases'
 
-echo "Acquire::Changelogs::URI::Label::Testcases \"http://localhost:${APTHTTPPORT}/CHANGEPATH/change.txt\";" > rootdir/etc/apt/apt.conf.d/changelog.conf
+echo "Acquire::Changelogs::URI::Label::Testcases \"http://localhost:${APTHTTPPORT}/@CHANGEPATH@/change.txt\";" > rootdir/etc/apt/apt.conf.d/changelog.conf
 testsuccessequal "'http://localhost:${APTHTTPPORT}/main/f/foo/foo_1.0/change.txt' foo.changelog
 'http://localhost:${APTHTTPPORT}/main/libb/libbar/libbar_1.0/change.txt' libbar.changelog" aptget changelog foo libbar --print-uris
 
-echo "Acquire::Changelogs::URI::Label::Testcases \"http://localhost:${APTHTTPPORT}/pool/CHANGEPATH/changelog\";" > rootdir/etc/apt/apt.conf.d/changelog.conf
+echo "Acquire::Changelogs::URI::Label::Testcases \"http://localhost:${APTHTTPPORT}/pool/@CHANGEPATH@/changelog\";" > rootdir/etc/apt/apt.conf.d/changelog.conf
 testsuccessequal "'http://localhost:${APTHTTPPORT}/pool/main/f/foo/foo_1.0/changelog' foo.changelog" aptget changelog foo --print-uris
 
 
@@ -97,11 +97,11 @@ testfilestats 'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAUL
 testfileequal 'foo.changelog' "$(cat  ../aptarchive/pool/main/f/foo/foo_1.0/changelog)"
 rm -f foo.changelog
 
-# no CHANGEPATH in the URI
+# no @CHANGEPATH@ in the URI
 testequal 'E: Failed to fetch changelog:/foo.changelog  Changelog unavailable for foo=1.0
 ' aptget changelog foo -qq -d -o Acquire::Changelogs::URI::Label::Testcases="http://localhost:${APTHTTPPORT}/change.txt"
 testfailure test -e foo.changelog
 
 testequal "E: Failed to fetch http://localhost:${APTHTTPPORT}/does/not/exist/main/f/foo/foo_1.0/change.txt  Changelog unavailable for foo=1.0 (404  Not Found)
-" aptget changelog foo -qq -d -o Acquire::Changelogs::URI::Label::Testcases="http://localhost:${APTHTTPPORT}/does/not/exist/CHANGEPATH/change.txt"
+" aptget changelog foo -qq -d -o Acquire::Changelogs::URI::Label::Testcases="http://localhost:${APTHTTPPORT}/does/not/exist/@CHANGEPATH@/change.txt"
 testfailure test -e foo.changelog
index 2f8a7ae5df8fac10f3546e937479491d3e5c104d..0e84f55d90f5111f79f3fd63f148c9f20ff010cb 100755 (executable)
@@ -22,7 +22,7 @@ testsuccess aptget update -o Debug::Acquire::http=1 -o Debug::Acquire::https=1 -
 msgtest 'Test that the webserver does not answer' 'http requests'
 downloadfile "http://localhost:${APTHTTPPORT}/pool/main/a/apt/apt_1.0/changelog" changelog >/dev/null 2>&1 && msgfail || msgpass
 
-echo "Acquire::Changelogs::URI::Label::Testcases \"http://localhost:${APTHTTPPORT}/redirectme/pool/CHANGEPATH/changelog\";" > rootdir/etc/apt/apt.conf.d/changelog.conf
+echo "Acquire::Changelogs::URI::Label::Testcases \"http://localhost:${APTHTTPPORT}/redirectme/pool/@CHANGEPATH@/changelog\";" > rootdir/etc/apt/apt.conf.d/changelog.conf
 testsuccessequal "'http://localhost:${APTHTTPPORT}/redirectme/pool/main/a/apt/apt_1.0/changelog' apt.changelog" aptget changelog apt --print-uris
 
 cd downloaded