summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.h
Commit message (Collapse)AuthorAgeFilesLines
* use +0000 instead of UTC by default as timezone in outputDavid Kalnischkies2016-07-021-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | All apt versions support numeric as well as 3-character timezones just fine and its actually hard to write code which doesn't "accidently" accepts it. So why change? Documenting the Date/Valid-Until fields in the Release file is easy to do in terms of referencing the datetime format used e.g. in the Debian changelogs (policy §4.4). This format specifies only the numeric timezones through, not the nowadays obsolete 3-character ones, so in the interest of least surprise we should use the same format even through it carries a small risk of regression in other clients (which encounter repositories created with apt-ftparchive). In case it is really regressing in practice, the hidden option -o APT::FTPArchive::Release::NumericTimezone=0 can be used to go back to good old UTC as timezone. The EDSP and EIPP protocols use this 'new' format, the text interface used to communicate with the acquire methods does not for compatibility reasons even if none of our methods would be effected and I doubt any other would (in these instances the timezone is 'GMT' as that is what HTTP/1.1 requires). Note that this is only true for apt talking to methods, (libapt-based) methods talking to apt will respond with the 'new' format. It is therefore strongly adviced to support both also in method input.
* accept only the expected UTC timezones in date parsingDavid Kalnischkies2016-05-281-0/+15
| | | | | | | | | | | | | | | | | | HTTP/1.1 hardcodes GMT (RFC 7231 §7.1.1.1) and what is good enough for the internet must be good enough for us™ as we reuse the implementation internally to parse (most) dates we encounter in various places like the Release files with their Date and Valid-Until header fields. Implementing a fully timezone aware parser just feels too hard for no effective benefit as it would take 5+ years (= until LTS's are out of fashion) until a repository could use non-UTC dates and expect it to work. Not counting non-apt implementations which might or might not only want to encounter UTC here as well. As a bonus, this eliminates the use of an instance of setlocale in libapt. Closes: 819697
* Fix several typosVeres Lajos2016-03-071-1/+1
| | | | | | | | | | | | | This effectively merges branch 'typofixes-vlajos-20150807' of github.com:vlajos/apt with the following commit: commit 13cacb3e2e2352ba701e769fc889e3344fabbf7e Author: Veres Lajos <vlajos@gmail.com> Date: Sun Aug 9 00:12:53 2015 +0100 typofix - https://github.com/vlajos/misspell_fixer It has been rebased for a better commit message.
* Switch performance critical code to use APT::StringViewJulian Andres Klode2016-01-071-1/+6
| | | | | | This improves performance of the cache generation on my ARM platform (4x Cortex A15) by about 10% to 20% from 2.35-2.50 to 2.1 seconds.
* Turn tolower_ascii() and isspace_ascii() into inline functionsJulian Andres Klode2015-12-291-2/+16
| | | | | | | | | | To preserve compatibility, the new inline functions have _inline as a suffix, and a macro defines the old names to refer to the inline variants. The old functions are still preserved for binary compatibility. Also simplify the implementation of both functions.
* Introduce isspace_ascii() for use by parsersJulian Andres Klode2015-12-271-0/+2
| | | | This is like isspace(), but ignores the current locale.
* add messages to our deprecation warnings in libaptDavid Kalnischkies2015-11-271-1/+1
| | | | Git-Dch: Ignore
* show URI.Path in all acquire item descriptionsDavid Kalnischkies2015-06-111-0/+1
| | | | | | | | | | | | | | It is a rather strange sight that index items use SiteOnly which strips the Path, while e.g. deb files are downloaded with NoUserPassword which does not. Important to note here is that for the file transport Path is pretty important as there is no Host which would be displayed by Site, which always resulted in "interesting" unspecific errors for "file:". Adding a 'middle' ground between the two which does show the Path but potentially modifies it (it strips a pending / at the end if existing) solves this "file:" issue, syncs the output and in the end helps to identify which file is meant exactly in progress output and co as a single site can have multiple repositories in different paths.
* Merge branch 'debian/jessie' into debian/experimentalDavid Kalnischkies2015-04-191-1/+1
|\ | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc cmdline/apt-key.in methods/https.cc test/integration/test-apt-key test/integration/test-multiarch-foreign
| * demote VectorizeString gcc attribute from const to pureDavid Kalnischkies2015-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | g++-5 generates a slightly broken libapt which doesn't split architecture configurations correctly resulting in e.g. Packages files requested for the bogus architecture 'amd64,i386' instead of for amd64 and i386. The reason is an incorrectly applied attribute marking the function as const, while functions with pointer arguments are not allowed to be declared as such (note that char& is a char* in disguise). Demoting the attribute to pure fixes this issue – better would be dropping the & from char but that is an API change… Neither earlier g++ versions nor clang use this attribute to generate broken code, so we don't need a rebuild of dependencies or anything and g++-5 isn't even included in jessie, but the effect is so strange and apt popular enough to consider avoiding this problem anyhow.
* | mark private methods as hiddenDavid Kalnischkies2014-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | We are the only possible users of private methods, so we are also the only users who can potentially export them via using them in inline methods. The point is: We don't need these symbols exported if we don't do this, so marking them as hidden removes some methods from the API without breaking anything as nobody could have used them. Git-Dch: Ignore
* | Only allow "apt-get build-dep path" when path starts with ./ or /Michael Vogt2014-07-081-0/+1
| | | | | | | | | | | | This avoid the subtle problem that someone might have a directory with the same package name as the build-depends he/she is trying to fetch. Also print a note that the specific file/dir is used.
* | Add new Base256ToNum long long overload functionGuillem Jover2014-07-081-0/+1
|/
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-18/+18
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-10/+13
| | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
* warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-131-19/+19
| | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
* add "APT::String::Endswith" and automatic adding of ".list" in apt edit-sourceMichael Vogt2013-11-291-0/+1
|
* re-add missing APT::String::StripMichael Vogt2013-10-181-0/+7
|
* change maxsplit default from "0" to maxintMichael Vogt2013-10-011-2/+2
|
* improve documentation for StringSplit()Michael Vogt2013-10-011-2/+17
|
* doc updateMichael Vogt2013-09-071-2/+8
|
* add maxsplit parameter to StringSplitMichael Vogt2013-09-071-1/+1
|
* implement StringSplit() as we need this to fix the dpkg status-fd output parsingMichael Vogt2013-09-071-0/+2
|
* squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt2013-08-121-0/+4
| | | | experimental
* split out a method to strip whitespaces only on the right sideMichael Vogt2013-03-151-0/+1
|
* revert 2184.1.2: do not pollute namespace in headersDavid Kalnischkies2011-12-131-0/+6
| | | | | The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-56/+52
|
* merge with debian/experimentalDavid Kalnischkies2011-09-131-0/+4
|\
| * fix typos in changelog, make DeEscapeString const, improve descriptionMichael Vogt2011-07-261-1/+1
| |
| * add another escape test case, fixup octal one (its \0XX instead of \0XXX)Michael Vogt2011-07-261-1/+1
| |
| * * apt-pkg/contrib/strutl.{h,cc}, test/libapt/strutil_test.cc:Michael Vogt2011-07-261-0/+4
| | | | | | | | - add new DeEscapeString() similar to DeQuoteQuotedWord but unescape charackter escapes like \0XXX and \xXX (plus add test)
* | Support large files in the complete toolset. Indexes of thisDavid Kalnischkies2011-09-131-0/+1
|/ | | | size are pretty unlikely for now, but we need it for deb packages which could become bigger than 4GB now (LP: #815895)
* merge 'after squeeze release'-stuffDavid Kalnischkies2011-02-031-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ David Kalnischkies ] * apt-pkg/depcache.cc: - add SetCandidateRelease() to set a candidate version and the candidates of dependencies if needed to a specified release (Closes: #572709) * cmdline/apt-get.cc: - if --print-uris is used don't setup downloader as we don't need progress, lock nor the directories it would create otherwise - show dependencies of essential packages which are going to remove only if they cause the remove of this essential (Closes: #601961) - keep not installed garbage packages uninstalled instead of showing in the autoremove section and installing those (Closes: #604222) - change pkg/release behavior to use the new SetCandidateRelease so installing packages from experimental or backports is easier - really do not show packages in the extra section if they were requested on the commandline, e.g. with a modifier (Closes: #184730) * debian/control: - add Vcs-Browser now that loggerhead works again (Closes: #511168) - depend on debhelper 7 to raise compat level - depend on dpkg-dev (>= 1.15.8) to have c++ symbol mangling * apt-pkg/contrib/fileutl.cc: - add a RealFileExists method and check that your configuration files are real files to avoid endless loops if not (Closes: #604401) - ignore non-regular files in GetListOfFilesInDir (Closes: #594694) * apt-pkg/contrib/weakptr.h: - include stddefs.h to fix compile error (undefined NULL) with gcc-4.6 * methods/https.cc: - fix CURLOPT_SSL_VERIFYHOST by really passing 2 to it if enabled * deb/dpkgpm.cc: - fix popen/fclose mismatch reported by cppcheck. Thanks to Petter Reinholdtsen for report and patch! (Closes: #607803) * doc/apt.conf.5.xml: - fix multipl{y,e} spelling error reported by Jakub Wilk (Closes: #607636) * apt-inst/contrib/extracttar.cc: - let apt-utils work with encoded tar headers if uid/gid are large. Thanks to Nobuhiro Hayashi for the patch! (Closes: #330162) * apt-pkg/cacheiterator.h: - do not segfault if cache is not build (Closes: #254770) * doc/apt-get.8.xml: - remove duplicated mentioning of --install-recommends * doc/sources.list.5.xml: - remove obsolete references to non-us (Closes: #594495) * debian/rules: - use -- instead of deprecated -u for dh_gencontrol - remove shlibs.local creation and usage - show differences in the symbol files, but never fail * pre-build.sh: - remove as it is not needed for a working 'bzr bd' * debian/{apt,apt-utils}.symbols: - ship experimental unmangled c++ symbol files * methods/rred.cc: - operate optional on gzip compressed pdiffs * apt-pkg/acquire-item.cc: - don't uncompress downloaded pdiff files before feeding it to rred - try downloading clearsigned InRelease before trying Release.gpg - change the internal handling of Extensions in pkgAcqIndex - add a special uncompressed compression type to prefer those files - download and use i18n/Index to choose which Translations to download * cmdline/apt-key: - don't set trustdb-name as non-root so 'list' and 'finger' can be used without being root (Closes: #393005, #592107) * apt-pkg/deb/deblistparser.cc: - rewrite LoadReleaseInfo to cope with clearsigned Releasefiles * ftparchive/writer.cc: - add config option to search for more patterns in release command - include Index files by default in the Release file * methods/{gzip,bzip}.cc: - print a good error message if FileSize() is zero * apt-pkg/aptconfiguration.cc: - remove the inbuilt Translation files whitelist
| * * apt-inst/contrib/extracttar.cc:David Kalnischkies2011-01-131-0/+1
| |\ | | | | | | | | | - let apt-utils work with encoded tar headers if uid/gid are large. Thanks to Nobuhiro Hayashi for the patch! (Closes: #330162)
| | * Permit base256 encoded value in the numeric field of tar header.Nobuhiro Hayashi2010-12-031-0/+1
| |/
* / add support for third party changelogsMichael Vogt2010-11-161-0/+1
|/
* move the users away from the deprecated StrToTime() methodDavid Kalnischkies2010-06-091-2/+2
|
* * apt-pkg/contrib/strutl.cc:David Kalnischkies2010-06-081-1/+3
| | | | - split StrToTime() into HTTP1.1 and FTP date parser methods and use strptime() instead of some selfmade scanf mangling
* Userinfo is urlencoded in URIs (RFC 3986)David Kalnischkies2010-03-311-0/+1
| | | | | | | | | Thanks to Jean-Baptiste Lallement for spotting and fixing it! * apt-pkg/contrib/strutl.cc: - always escape '%' (LP: #130289) (Closes: #500560) - unescape '%' sequence only if followed by 2 hex digit - username/password are urlencoded in proxy string (RFC 3986)
* rename ExplodeString to VectorizeStringDavid Kalnischkies2010-03-301-1/+1
|
* replace every call to toupper with one to our own tolower_asciiDavid Kalnischkies2010-03-301-15/+6
| | | | | | | | | | This sounds like a premature optimization and since Mr. Knuth we all know that they are the root of all evil - but, and here it starts to be interesting: As the tolower_ascii method is by far the most called method we have (~60 Mio. times) and as we compare only strings containing ascii characters (package names, configuration options) using our own method reduces execution time of APT by 4% plus it avoids that the locale settings can influence us.
* merge from the lp:~donkult/apt/sid branchMichael Vogt2010-02-181-0/+1
|\
| * dd support for the LANGUAGE environment variableDavid Kalnischkies2010-02-181-0/+1
| |
* | Change the package index Info methods to allow apt-cache policy to beMichael Vogt2010-02-181-0/+1
|/ | | | useful when using several different archives on the same host. (Closes: #329814, LP: #22354)
* Avoid extra inner copy in APT_MKSTRCMP and APT_MKSTRCMP2David Kalnischkies2009-10-241-6/+6
| | | | | Backported from lp:~mvo/apt/debian-experimental Patch by Eugene V. Lyubimkin
* Apply patch from Sami Liedes <sliedes@cc.hut.fi> to avoid unecessaryOtavio Salvador2009-07-251-0/+1
| | | temporary allocations.
* * apt-pkg/acquire.cc:Michael Vogt2009-07-211-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - make the max pipeline depth of the acquire queue configurable via Acquire::Max-Pipeline-Depth * apt-pkg/deb/dpkgpm.cc: - add Dpkg::UseIoNice boolean option to run dpkg with ionice -c3 (off by default) - send "dpkg-exec" message on the status fd when dpkg is run - provide DPkg::Chroot-Directory config option (useful for testing) - fix potential hang when in a backgroud process group * apt-pkg/algorithms.cc: - consider recommends when making the scores for the problem resolver * apt-pkg/acquire-worker.cc: - show error details of failed methods * apt-pkg/contrib/fileutl.cc: - if a process aborts with signal, show signal number * methods/http.cc: - ignore SIGPIPE, we deal with EPIPE from write in HttpMethod::ServerDie() (LP: #385144) * apt-pkg/indexcopy.cc: - support having CDs with no Packages file (just a Packages.gz) by not forcing a verification on non-existing files (LP: #255545) - remove the gettext from a string that consists entirely of variables (LP: #56792) * apt-pkg/cacheiterators.h: - add missing checks for Owner == 0 in end() * apt-pkg/indexrecords.cc: - fix some i18n issues * apt-pkg/contrib/strutl.h: - add new strprintf() function to make i18n strings easier - fix compiler warning * apt-pkg/deb/debsystem.cc: - make strings i18n able * fix problematic use of tolower() when calculating the version hash by using locale independant tolower_ascii() function. Thanks to M. Vefa Bicakci (LP: #80248) * build fixes for g++-4.4 * cmdline/apt-mark: - add "showauto" option to show automatically installed packages * document --install-recommends and --no-install-recommends (thanks to Dereck Wonnacott, LP: #126180) * Updated cron script to support backups by hardlinks and verbose levels. All features turned off by default. * Added more error handlings. Closes: #438803, #462734, #454989, * Refactored condition structure to make download and upgrade performed if only previous steps succeeded. Closes: #341970 * Documented all cron script related configuration items in configure-index. * apt-ftparchive might write corrupt Release files (LP: #46439) * Apply --important option to apt-cache depends (LP: #16947)
| * fix problematic use of tolower() when calculating the version Michael Vogt2009-04-231-0/+1
| | | | | | | | | | hash by using locale independant tolower_ascii() function. Thanks to M. Vefa Bicakci (LP: #80248)
| * * apt-pkg/indexrecords.cc:Michael Vogt2008-12-081-0/+1
| | | | | | | | | | - fix some i18n issues * apt-pkg/contrib/strutl.h: - add new strprintf() function to make i18n strings easier
* | merge r1797 from lp:~donkult/apt/experimentalMichael Vogt2009-06-291-0/+1
|/