[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

trivial APT repositories and Translation-*... just *? :(



I am trying this again with my e-mail specifically encoded into plain text, to see if that is what is keeping the message from hitting the list. :( -J

----- Original Message ----- From: Jay Freeman (saurik)
To: deity@lists.debian.org
Sent: Wednesday, April 15, 2009 12:45 PM
Subject: trivial APT repositories and Translation-*... just *? :(

I was not on this mailing list when I sent this (to what I thought was just the maintainer of APT ;P), so I'm assuming that's why it didn't end up posted into the list archives (which I later found). I am therefore posting it again ;P. If the previous post /did/ get through somehow, and I'm just not able to find it in the archives for an unrelated reason, I'm sorry. :(

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com
http://www.saurik.com/

----- Original Message ----- From: Jay Freeman (saurik)
To: deity@lists.debian.org
Sent: Monday, April 13, 2009 6:59 PM
Subject: trivial APT repositories and Translation-*... just *? :(

I am not /certain/ this is a bug: in essence I'm asking for verification. It definitely seems wrong: my current guess is that most people don't use trivial repositories, so testing and verification of how they operate doesn't happen very often. Unfortunately, I am the primary maintainer of an APT-based distribution (Telesphoreo, for the iPhone) in use by millions of people where almost all of the 50+ known repositories are trivial repositories, and I am about to upgrade us to Lenny's version of APT. This specific feature (translated package descriptions) is one of the major reasons we are upgrading, and as we are bandwidth (even more: latency) constrained I want to make certain that the URIs are future proof going into the whole thing.

So, when you are using a trivial repository, what is the filename supposed to be for Translation-* files? I would have guessed Translation-en_US (same as a regular repository), except all in the same base folder. However, the code for debTranslationsIndex::IndexFile returns simply "http://whatever/en_US";, without the "Translation-". I would have guessed that the "Translation-" would have been preserved, and only the "*/i18n/" would be dropped. If nothing else, it seems like a dangerous possible namespace collision to drop the prefix from the file and have the entire name be something caused by the current language code.

The code is:

string debTranslationsIndex::IndexURI(const char *Type) const
{
  string Res;
  if (Dist[Dist.size() - 1] == '/')
  {
     if (Dist != "/")
        Res = URI + Dist;
     else
        Res = URI;
  }
  else
     Res = URI + "dists/" + Dist + '/' + Section +
     "/i18n/Translation-";

  Res += Type;
  return Res;
}


I am guessing this code was simply stolen from debPackagesIndex::IndexURI, and a change was made to the following code:

     Res = URI + "dists/" + Dist + '/' + Section +
     "/binary-" + _config->Find("APT::Architecture") + '/';

This, and the only other similar instance (debSourcesIndex::IndexURI) leave a directory in Res, not a filename, and leave it up to the Type to set the name. However, the Type here seems to function differently, as it doesn't include the "Translation-". This makes it seem like maybe this /is/ at least conceptually correct behavior within the code, even if it doesn't match the behavior anywhere else. Hence why I am not 100% certain this is a bug :(.

So, what is the intended filename? If it is "Translation-*" then I will make the change to my copy of debTranslationsIndex::IndexURI before unleashing it on my users, and if it is just "*" I'll obviously leave it alone ;P.

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com
http://www.saurik.com/
Reply to: