diff options
author | Michael Vogt <egon@bottom> | 2006-04-26 12:55:06 +0200 |
---|---|---|
committer | Michael Vogt <egon@bottom> | 2006-04-26 12:55:06 +0200 |
commit | 2268ad65d9f36433f2b3d46e05e8782285641ee3 (patch) | |
tree | c810ed490287038312ab32f8ced18e783aab8309 | |
parent | ce95a6f99ffa7bcb225bd9dd28dd73ee77553eb5 (diff) | |
parent | 432b168ce4ec7a7c2caef44c0c8470c7197d58b3 (diff) |
* merged with mainline
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 4 | ||||
-rw-r--r-- | apt-pkg/tagfile.cc | 92 | ||||
-rw-r--r-- | apt-pkg/tagfile.h | 5 | ||||
-rw-r--r-- | debian/changelog | 8 | ||||
-rwxr-xr-x | debian/rules | 2 | ||||
-rw-r--r-- | po/apt-all.pot | 139 |
6 files changed, 105 insertions, 145 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 3b7b2238a..667db8ff2 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -623,8 +623,8 @@ bool pkgDPkgPM::Go(int OutStatusFd) 'status: conffile-prompt: conffile : 'current-conffile' 'new-conffile' useredited distedited */ - char* list[4]; - TokSplitString(':', line, list, 5); + char* list[5]; + TokSplitString(':', line, list, sizeof(list)/sizeof(list[0])); char *pkg = list[1]; char *action = _strstrip(list[2]); diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 1fa007940..fc020436c 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -35,20 +35,20 @@ pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long Size) : 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 /*{{{*/ @@ -56,7 +56,7 @@ pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long Size) : /* */ pkgTagFile::~pkgTagFile() { - delete [] Buffer; + delete Map; } /*}}}*/ // TagFile::Step - Advance to the next section /*{{{*/ @@ -64,14 +64,13 @@ pkgTagFile::~pkgTagFile() /* 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(); @@ -80,50 +79,6 @@ bool pkgTagFile::Step(pkgTagSection &Tag) 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; -} - /*}}}*/ // TagFile::Jump - Jump to a pre-recorded location in the file /*{{{*/ // --------------------------------------------------------------------- /* This jumps to a pre-recorded file location and reads the record @@ -141,20 +96,7 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long Offset) // 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()); @@ -181,7 +123,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength) Stop = Section = Start; memset(AlphaIndexes,0,sizeof(AlphaIndexes)); - if (Stop == 0) + if (Stop == 0 || MaxLength == 0) return false; TagCount = 0; @@ -212,6 +154,12 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength) Stop++; } + if ((Stop+1 >= End) && (End[-1] == '\n' || End[-1] == '\r')) + { + Indexes[TagCount] = (End - 1) - Section; + return true; + } + return false; } /*}}}*/ diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 8c948754d..5cff2681c 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -25,6 +25,7 @@ #endif #include <apt-pkg/fileutl.h> +#include <apt-pkg/mmap.h> #include <stdio.h> class pkgTagSection @@ -69,15 +70,13 @@ class pkgTagSection class pkgTagFile { FileFd &Fd; + MMap *Map; char *Buffer; char *Start; char *End; - bool Done; unsigned long iOffset; unsigned long Size; - bool Fill(); - public: bool Step(pkgTagSection &Section); diff --git a/debian/changelog b/debian/changelog index 9a7ee7213..65dc1e862 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -apt (0.6.43.4) unstable; urgency=low +apt (0.6.44) unstable; urgency=low * apt-pkg/acquire.cc: don't show ETA if it is 0 or absurdely large * apt-pkg/contrib/sha256.{cc,h},hashes.{cc,h}: support for sha256 @@ -7,6 +7,12 @@ apt (0.6.43.4) unstable; urgency=low (thanks to Anthony Towns) * apt pdiff support from experimental merged * apt-pkg/deb/dpkgpm.cc: wording fixes (thanks to Matt Zimmerman) + * apt-pkg/deb/dpkgpm.cc: + - wording fixes (thanks to Matt Zimmerman) + - fix error in dpkg interaction (closes: #364513, thanks to Martin Dickopp) + * apt-pkg/tagfile.{cc,h}: + - use MMap to read the entries (thanks to Zephaniah E. Hull for the + patch) Closes: #350025 * Merge from http://www.perrier.eu.org/debian/packages/d-i/level4/apt-main: * bg.po: Added, complete to 512t. Closes: #360262 diff --git a/debian/rules b/debian/rules index 5647ebd23..a8bf88762 100755 --- a/debian/rules +++ b/debian/rules @@ -336,6 +336,6 @@ cvs-mkul: arch-build: rm -rf debian/arch-build mkdir -p debian/arch-build/apt-$(APT_DEBVER) - tar -c --exclude=arch-build -f - `bzr inventory` | (cd debian/arch-build/$(PKG)-$(APT_DEBVER);tar xf -) + tar -c --exclude=arch-build --no-recursion -f - `bzr inventory` | (cd debian/arch-build/$(PKG)-$(APT_DEBVER);tar xf -) $(MAKE) -C debian/arch-build/apt-$(APT_DEBVER) startup doc (cd debian/arch-build/apt-$(APT_DEBVER); $(DEB_BUILD_PROG)) diff --git a/po/apt-all.pot b/po/apt-all.pot index 23de34b5c..dc455c7af 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" 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" @@ -146,14 +146,14 @@ msgstr "" 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" @@ -535,7 +535,7 @@ msgstr "" 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 "" @@ -694,11 +694,11 @@ 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 "" @@ -727,7 +727,7 @@ 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 "" @@ -761,7 +761,7 @@ 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 "" @@ -770,7 +770,7 @@ 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 "" @@ -866,7 +866,7 @@ 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 "" @@ -880,27 +880,27 @@ 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" @@ -908,163 +908,163 @@ msgid "" "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" @@ -1666,34 +1666,34 @@ msgstr "" 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 "" @@ -2203,9 +2203,16 @@ 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 @@ -2346,35 +2353,35 @@ msgstr "" 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 "" @@ -2515,12 +2522,12 @@ 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 |