Fd(*pFd),
Size(Size)
{
- if (Fd.IsOpen() == false)
+ if (Fd.IsOpen() == false || Fd.Size() == 0)
{
Buffer = 0;
Start = End = Buffer = 0;
- Done = true;
iOffset = 0;
+ Map = NULL;
return;
}
- Buffer = new char[Size];
- Start = End = Buffer;
- Done = false;
+ Map = new MMap (Fd, MMap::Public | MMap::ReadOnly);
+ Buffer = (char *) Map->Data ();
+ Start = Buffer;
+ End = Buffer + Map->Size ();
iOffset = 0;
- Fill();
}
/*}}}*/
// TagFile::~pkgTagFile - Destructor /*{{{*/
/* */
pkgTagFile::~pkgTagFile()
{
- delete [] Buffer;
+ delete Map;
}
/*}}}*/
// TagFile::Step - Advance to the next section /*{{{*/
/* If the Section Scanner fails we refill the buffer and try again. */
bool pkgTagFile::Step(pkgTagSection &Tag)
{
+ if (Start == End)
+ return false;
+
if (Tag.Scan(Start,End - Start) == false)
{
- if (Fill() == false)
- return false;
-
- if (Tag.Scan(Start,End - Start) == false)
- return _error->Error(_("Unable to parse package file %s (1)"),
- Fd.Name().c_str());
+ return _error->Error(_("Unable to parse package file %s (1)"),
+ Fd.Name().c_str());
}
Start += Tag.size();
iOffset += Tag.size();
Tag.Trim();
- return true;
-}
- /*}}}*/
-// TagFile::Fill - Top up the buffer /*{{{*/
-// ---------------------------------------------------------------------
-/* This takes the bit at the end of the buffer and puts it at the start
- then fills the rest from the file */
-bool pkgTagFile::Fill()
-{
- unsigned long EndSize = End - Start;
- unsigned long Actual = 0;
-
- memmove(Buffer,Start,EndSize);
- Start = Buffer;
- End = Buffer + EndSize;
-
- if (Done == false)
- {
- // See if only a bit of the file is left
- if (Fd.Read(End,Size - (End - Buffer),&Actual) == false)
- return false;
- if (Actual != Size - (End - Buffer))
- Done = true;
- End += Actual;
- }
-
- if (Done == true)
- {
- if (EndSize <= 3 && Actual == 0)
- return false;
- if (Size - (End - Buffer) < 4)
- return true;
-
- // Append a double new line if one does not exist
- unsigned int LineCount = 0;
- for (const char *E = End - 1; E - End < 6 && (*E == '\n' || *E == '\r'); E--)
- if (*E == '\n')
- LineCount++;
- for (; LineCount < 2; LineCount++)
- *End++ = '\n';
-
- return true;
- }
-
return true;
}
/*}}}*/
// Reposition and reload..
iOffset = Offset;
- Done = false;
- if (Fd.Seek(Offset) == false)
- return false;
- End = Start = Buffer;
-
- if (Fill() == false)
- return false;
-
- if (Tag.Scan(Start,End - Start) == true)
- return true;
-
- // This appends a double new line (for the real eof handling)
- if (Fill() == false)
- return false;
+ Start = Buffer + iOffset;
if (Tag.Scan(Start,End - Start) == false)
return _error->Error(_("Unable to parse package file %s (2)"),Fd.Name().c_str());
Stop = Section = Start;
memset(AlphaIndexes,0,sizeof(AlphaIndexes));
- if (Stop == 0)
+ if (Stop == 0 || MaxLength == 0)
return false;
TagCount = 0;
Stop++;
}
+ if ((Stop+1 >= End) && (End[-1] == '\n' || End[-1] == '\r'))
+ {
+ Indexes[TagCount] = (End - 1) - Section;
+ return true;
+ }
+
return false;
}
/*}}}*/
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2006-01-20 14:06+0100\n"
+"POT-Creation-Date: 2006-04-20 12:50+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid " %4i %s\n"
msgstr ""
-#: cmdline/apt-cache.cc:1651 cmdline/apt-cdrom.cc:138 cmdline/apt-config.cc:70
+#: cmdline/apt-cache.cc:1652 cmdline/apt-cdrom.cc:138 cmdline/apt-config.cc:70
#: cmdline/apt-extracttemplates.cc:225 ftparchive/apt-ftparchive.cc:550
-#: cmdline/apt-get.cc:2378 cmdline/apt-sortpkgs.cc:144
+#: cmdline/apt-get.cc:2369 cmdline/apt-sortpkgs.cc:144
#, c-format
msgid "%s %s for %s %s compiled on %s %s\n"
msgstr ""
-#: cmdline/apt-cache.cc:1658
+#: cmdline/apt-cache.cc:1659
msgid ""
"Usage: apt-cache [options] command\n"
" apt-cache [options] add file1 [file2 ...]\n"
msgid "Y"
msgstr ""
-#: cmdline/apt-get.cc:142 cmdline/apt-get.cc:1515
+#: cmdline/apt-get.cc:142 cmdline/apt-get.cc:1506
#, c-format
msgid "Regex compilation error - %s"
msgstr ""
msgid "Internal error, Ordering didn't finish"
msgstr ""
-#: cmdline/apt-get.cc:791 cmdline/apt-get.cc:1809 cmdline/apt-get.cc:1842
+#: cmdline/apt-get.cc:791 cmdline/apt-get.cc:1800 cmdline/apt-get.cc:1833
msgid "Unable to lock the download directory"
msgstr ""
-#: cmdline/apt-get.cc:801 cmdline/apt-get.cc:1890 cmdline/apt-get.cc:2126
+#: cmdline/apt-get.cc:801 cmdline/apt-get.cc:1881 cmdline/apt-get.cc:2117
#: apt-pkg/cachefile.cc:67
msgid "The list of sources could not be read."
msgstr ""
msgid "After unpacking %sB disk space will be freed.\n"
msgstr ""
-#: cmdline/apt-get.cc:846 cmdline/apt-get.cc:1980
+#: cmdline/apt-get.cc:846 cmdline/apt-get.cc:1971
#, c-format
msgid "Couldn't determine free space in %s"
msgstr ""
msgid "Do you want to continue [Y/n]? "
msgstr ""
-#: cmdline/apt-get.cc:961 cmdline/apt-get.cc:1365 cmdline/apt-get.cc:2023
+#: cmdline/apt-get.cc:961 cmdline/apt-get.cc:1365 cmdline/apt-get.cc:2014
#, c-format
msgid "Failed to fetch %s %s\n"
msgstr ""
msgid "Some files failed to download"
msgstr ""
-#: cmdline/apt-get.cc:980 cmdline/apt-get.cc:2032
+#: cmdline/apt-get.cc:980 cmdline/apt-get.cc:2023
msgid "Download complete and in download only mode"
msgstr ""
msgid "The update command takes no arguments"
msgstr ""
-#: cmdline/apt-get.cc:1326 cmdline/apt-get.cc:1420
+#: cmdline/apt-get.cc:1326
msgid "Unable to lock the list directory"
msgstr ""
msgid "Internal error, AllUpgrade broke stuff"
msgstr ""
-#: cmdline/apt-get.cc:1502 cmdline/apt-get.cc:1538
+#: cmdline/apt-get.cc:1493 cmdline/apt-get.cc:1529
#, c-format
msgid "Couldn't find package %s"
msgstr ""
-#: cmdline/apt-get.cc:1525
+#: cmdline/apt-get.cc:1516
#, c-format
msgid "Note, selecting %s for regex '%s'\n"
msgstr ""
-#: cmdline/apt-get.cc:1555
+#: cmdline/apt-get.cc:1546
msgid "You might want to run `apt-get -f install' to correct these:"
msgstr ""
-#: cmdline/apt-get.cc:1558
+#: cmdline/apt-get.cc:1549
msgid ""
"Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a "
"solution)."
msgstr ""
-#: cmdline/apt-get.cc:1570
+#: cmdline/apt-get.cc:1561
msgid ""
"Some packages could not be installed. This may mean that you have\n"
"requested an impossible situation or if you are using the unstable\n"
"or been moved out of Incoming."
msgstr ""
-#: cmdline/apt-get.cc:1578
+#: cmdline/apt-get.cc:1569
msgid ""
"Since you only requested a single operation it is extremely likely that\n"
"the package is simply not installable and a bug report against\n"
"that package should be filed."
msgstr ""
-#: cmdline/apt-get.cc:1583
+#: cmdline/apt-get.cc:1574
msgid "The following information may help to resolve the situation:"
msgstr ""
-#: cmdline/apt-get.cc:1586
+#: cmdline/apt-get.cc:1577
msgid "Broken packages"
msgstr ""
-#: cmdline/apt-get.cc:1612
+#: cmdline/apt-get.cc:1603
msgid "The following extra packages will be installed:"
msgstr ""
-#: cmdline/apt-get.cc:1683
+#: cmdline/apt-get.cc:1674
msgid "Suggested packages:"
msgstr ""
-#: cmdline/apt-get.cc:1684
+#: cmdline/apt-get.cc:1675
msgid "Recommended packages:"
msgstr ""
-#: cmdline/apt-get.cc:1704
+#: cmdline/apt-get.cc:1695
msgid "Calculating upgrade... "
msgstr ""
-#: cmdline/apt-get.cc:1707 methods/ftp.cc:702 methods/connect.cc:101
+#: cmdline/apt-get.cc:1698 methods/ftp.cc:702 methods/connect.cc:101
msgid "Failed"
msgstr ""
-#: cmdline/apt-get.cc:1712
+#: cmdline/apt-get.cc:1703
msgid "Done"
msgstr ""
-#: cmdline/apt-get.cc:1777 cmdline/apt-get.cc:1785
+#: cmdline/apt-get.cc:1768 cmdline/apt-get.cc:1776
msgid "Internal error, problem resolver broke stuff"
msgstr ""
-#: cmdline/apt-get.cc:1885
+#: cmdline/apt-get.cc:1876
msgid "Must specify at least one package to fetch source for"
msgstr ""
-#: cmdline/apt-get.cc:1915 cmdline/apt-get.cc:2144
+#: cmdline/apt-get.cc:1906 cmdline/apt-get.cc:2135
#, c-format
msgid "Unable to find a source package for %s"
msgstr ""
-#: cmdline/apt-get.cc:1959
+#: cmdline/apt-get.cc:1950
#, c-format
msgid "Skipping already downloaded file '%s'\n"
msgstr ""
-#: cmdline/apt-get.cc:1983
+#: cmdline/apt-get.cc:1974
#, c-format
msgid "You don't have enough free space in %s"
msgstr ""
-#: cmdline/apt-get.cc:1988
+#: cmdline/apt-get.cc:1979
#, c-format
msgid "Need to get %sB/%sB of source archives.\n"
msgstr ""
-#: cmdline/apt-get.cc:1991
+#: cmdline/apt-get.cc:1982
#, c-format
msgid "Need to get %sB of source archives.\n"
msgstr ""
-#: cmdline/apt-get.cc:1997
+#: cmdline/apt-get.cc:1988
#, c-format
msgid "Fetch source %s\n"
msgstr ""
-#: cmdline/apt-get.cc:2028
+#: cmdline/apt-get.cc:2019
msgid "Failed to fetch some archives."
msgstr ""
-#: cmdline/apt-get.cc:2056
+#: cmdline/apt-get.cc:2047
#, c-format
msgid "Skipping unpack of already unpacked source in %s\n"
msgstr ""
-#: cmdline/apt-get.cc:2068
+#: cmdline/apt-get.cc:2059
#, c-format
msgid "Unpack command '%s' failed.\n"
msgstr ""
-#: cmdline/apt-get.cc:2069
+#: cmdline/apt-get.cc:2060
#, c-format
msgid "Check if the 'dpkg-dev' package is installed.\n"
msgstr ""
-#: cmdline/apt-get.cc:2086
+#: cmdline/apt-get.cc:2077
#, c-format
msgid "Build command '%s' failed.\n"
msgstr ""
-#: cmdline/apt-get.cc:2105
+#: cmdline/apt-get.cc:2096
msgid "Child process failed"
msgstr ""
-#: cmdline/apt-get.cc:2121
+#: cmdline/apt-get.cc:2112
msgid "Must specify at least one package to check builddeps for"
msgstr ""
-#: cmdline/apt-get.cc:2149
+#: cmdline/apt-get.cc:2140
#, c-format
msgid "Unable to get build-dependency information for %s"
msgstr ""
-#: cmdline/apt-get.cc:2169
+#: cmdline/apt-get.cc:2160
#, c-format
msgid "%s has no build depends.\n"
msgstr ""
-#: cmdline/apt-get.cc:2221
+#: cmdline/apt-get.cc:2212
#, c-format
msgid ""
"%s dependency for %s cannot be satisfied because the package %s cannot be "
"found"
msgstr ""
-#: cmdline/apt-get.cc:2273
+#: cmdline/apt-get.cc:2264
#, c-format
msgid ""
"%s dependency for %s cannot be satisfied because no available versions of "
"package %s can satisfy version requirements"
msgstr ""
-#: cmdline/apt-get.cc:2308
+#: cmdline/apt-get.cc:2299
#, c-format
msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new"
msgstr ""
-#: cmdline/apt-get.cc:2333
+#: cmdline/apt-get.cc:2324
#, c-format
msgid "Failed to satisfy %s dependency for %s: %s"
msgstr ""
-#: cmdline/apt-get.cc:2347
+#: cmdline/apt-get.cc:2338
#, c-format
msgid "Build-dependencies for %s could not be satisfied."
msgstr ""
-#: cmdline/apt-get.cc:2351
+#: cmdline/apt-get.cc:2342
msgid "Failed to process build dependencies"
msgstr ""
-#: cmdline/apt-get.cc:2383
+#: cmdline/apt-get.cc:2374
msgid "Supported modules:"
msgstr ""
-#: cmdline/apt-get.cc:2424
+#: cmdline/apt-get.cc:2415
msgid ""
"Usage: apt-get [options] command\n"
" apt-get [options] install|remove pkg1 [pkg2 ...]\n"
msgid "Could not connect to %s:%s (%s), connection timed out"
msgstr ""
-#: methods/connect.cc:106
+#: methods/connect.cc:108
#, c-format
msgid "Could not connect to %s:%s (%s)."
msgstr ""
#. We say this mainly because the pause here is for the
#. ssh connection that is still going
-#: methods/connect.cc:134 methods/rsh.cc:425
+#: methods/connect.cc:136 methods/rsh.cc:425
#, c-format
msgid "Connecting to %s"
msgstr ""
-#: methods/connect.cc:165
+#: methods/connect.cc:167
#, c-format
msgid "Could not resolve '%s'"
msgstr ""
-#: methods/connect.cc:171
+#: methods/connect.cc:173
#, c-format
msgid "Temporary failure resolving '%s'"
msgstr ""
-#: methods/connect.cc:174
+#: methods/connect.cc:176
#, c-format
msgid "Something wicked happened resolving '%s:%s' (%i)"
msgstr ""
-#: methods/connect.cc:221
+#: methods/connect.cc:223
#, c-format
msgid "Unable to connect to %s %s:"
msgstr ""
msgid "Archive directory %spartial is missing."
msgstr ""
-#: apt-pkg/acquire.cc:821
+#. only show the ETA if it makes sense
+#. two days
+#: apt-pkg/acquire.cc:823
+#, c-format
+msgid "Retrieving file %li of %li (%s remaining)"
+msgstr ""
+
+#: apt-pkg/acquire.cc:825
#, c-format
-msgid "Downloading file %li of %li (%s remaining)"
+msgid "Retrieving file %li of %li"
msgstr ""
#: apt-pkg/acquire-worker.cc:113
msgid "rename failed, %s (%s -> %s)."
msgstr ""
-#: apt-pkg/acquire-item.cc:236 apt-pkg/acquire-item.cc:950
+#: apt-pkg/acquire-item.cc:236 apt-pkg/acquire-item.cc:945
msgid "MD5Sum mismatch"
msgstr ""
-#: apt-pkg/acquire-item.cc:645
+#: apt-pkg/acquire-item.cc:640
msgid "There are no public key available for the following key IDs:\n"
msgstr ""
-#: apt-pkg/acquire-item.cc:758
+#: apt-pkg/acquire-item.cc:753
#, c-format
msgid ""
"I wasn't able to locate a file for the %s package. This might mean you need "
"to manually fix this package. (due to missing arch)"
msgstr ""
-#: apt-pkg/acquire-item.cc:817
+#: apt-pkg/acquire-item.cc:812
#, c-format
msgid ""
"I wasn't able to locate file for the %s package. This might mean you need to "
"manually fix this package."
msgstr ""
-#: apt-pkg/acquire-item.cc:853
+#: apt-pkg/acquire-item.cc:848
#, c-format
msgid ""
"The package index files are corrupted. No Filename: field for package %s."
msgstr ""
-#: apt-pkg/acquire-item.cc:940
+#: apt-pkg/acquire-item.cc:935
msgid "Size mismatch"
msgstr ""
#: apt-pkg/deb/dpkgpm.cc:378
#, c-format
-msgid "Preparing for remove with config %s"
+msgid "Preparing to completely remove %s"
msgstr ""
#: apt-pkg/deb/dpkgpm.cc:379
#, c-format
-msgid "Removed with config %s"
+msgid "Completely removed %s"
msgstr ""
#: methods/rsh.cc:330