summaryrefslogtreecommitdiff
path: root/ftparchive
Commit message (Collapse)AuthorAgeFilesLines
...
* C++11: Switch from auto_ptr to unique_ptrJulian Andres Klode2015-08-131-10/+10
| | | | This is nicer
* add c++11 override marker to overridden methodsDavid Kalnischkies2015-08-102-5/+5
| | | | | | | | | C++11 adds the 'override' specifier to mark that a method is overriding a base class method and error out if not. We hide it in the APT_OVERRIDE macro to ensure that we keep compiling in pre-c++11 standards. Reported-By: clang-modernize -add-override -override-macros Git-Dch: Ignore
* fix memory leaks reported by -fsanitizeDavid Kalnischkies2015-08-104-54/+61
| | | | | | | | Various small leaks here and there. Nothing particularily big, but still good to fix. Found by the sanitizers while running our testcases. Reported-By: gcc -fsanitize Git-Dch: Ignore
* rewrite all TFRewrite instances to use the new pkgTagSection::WriteDavid Kalnischkies2015-05-117-192/+170
| | | | | | | | | While it is mostly busywork to rewrite all instances it actually fixes bugs as the data storage used by the new method is std::string rather than a char*, the later mostly created by c_str() from a std::string which the caller has to ensure keeps in scope – something apt-ftparchive actually didn't ensure and relied on copy-on-write behavior instead which c++11 forbids and hence the new default gcc abi doesn't use it.
* fix 'Source' to 'Package' rename in apt-ftparchiveDavid Kalnischkies2015-05-111-1/+2
| | | | | | This rename with value is ordered by the 'old' name 'Source', but should be ordered by the new name… by splitting the operation in a delete and a new field we can easily fix this problem locally for now.
* calculate only expected hashes in methodsDavid Kalnischkies2015-04-192-4/+4
| | | | | | | | | | | | | | Methods get told which hashes are expected by the acquire system, which means we can use this list to restrict what we calculate in the methods as any extra we are calculating is wasted effort as we can't compare it with anything anyway. Adding support for a new hash algorithm is therefore 'free' now and if a algorithm is no longer provided in a repository for a file, we automatically stop calculating it. In practice this results in a speed-up in Debian as we don't have SHA512 here (so far), so we practically stop calculating it.
* reimplement the last uses of sprintfDavid Kalnischkies2015-04-101-4/+4
| | | | | | | | Working with strings c-style is complicated and error-prune, so by converting to c++ style we gain some simplicity and avoid buffer overflows by later extensions. Git-Dch: Ignore
* stop displaying time of build in online helpJérémy Bobbio2015-03-161-2/+1
| | | | | | | | | | | | | | | | | | As part of the “reproducible builds” effort [1], we have noticed that apt could not be built reproducibly. One issue is that it uses the __DATE__ and __TIME__ macros of the C preprocessor to display the time of build in the online help. We believe this information not to be really useful to users as they can always look at the package data and metadata to figure it out. The attached patch simply removes this information. All non-documentation packages can then be built reproducibly with our current experimental framework. [David: changed the string slightly to be untranslateable as well] Closes: 774342
* merge debian/sid into debian/experimentalDavid Kalnischkies2015-03-164-44/+41
|\
| * 128 KiB DSC files ought to be enough for everyoneDavid Kalnischkies2015-01-104-44/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Your mileage may vary, but don't worry: There is more than one way to do it, but our one size fits all is not a bigger hammer, but an entire roundhouse kick! So brace yourself for the tl;dr: The limit is gone.* Beware: This fixes also the problem that a double newline is unconditionally added 'later' which is an overcommitment in case the dsc filesize is limit-2 <= x <= limit. * limited to numbers fitting into an unsigned long long. Closes: 774893
* | use the same code to detect quiet setting in all toolsDavid Kalnischkies2014-11-091-14/+5
| | | | | | | | Git-Dch: Ignore
* | streamline display of --help in all toolsDavid Kalnischkies2014-11-092-17/+6
| | | | | | | | | | | | | | By convention, if I run a tool with --help or --version I expect it to exit successfully with the usage, while if I do call it wrong (like without any parameters) I expect the usage message shown with a non-zero exit.
* | promote filesize to a hashstringDavid Kalnischkies2014-10-242-1/+7
| | | | | | | | | | | | | | | | | | It is a very simple hashstring, which is why it isn't contributing to the usability of a list of them, but it is also trivial to check and calculate, so it doesn't hurt checking it either as it can combined even with the simplest other hashes greatly complicate attacks on them as you suddenly need a same-size hash collision, which is usually a lot harder to achieve.
* | fix: warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-09-273-10/+10
| | | | | | | | | | Reported-By: gcc -Wpedantic Git-Dch: Ignore
* | fix: Member variable 'X' is not initialized in the constructor.David Kalnischkies2014-09-271-1/+1
| | | | | | | | | | Reported-By: cppcheck Git-Dch: Ignore
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-051-33/+66
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc configure.ac debian/changelog doc/apt-verbatim.ent 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/pt.po po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/tr.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
| * Make Packages & Sources generation optional, during Generate callDimitri John Ledkov2014-09-031-33/+66
| | | | | | | | | | | | | | | | refactor a bit, extract code out of Generate() into DoGenerate{PackagesAndSources,Contents}, add new APT::FTPArchive::ContentsOnly option to allow skipping the generation of Package/Source files (if they are generated e.g. by some db outside of apt-ftparchives control)
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-06-185-19/+112
|\| | | | | | | | | Conflicts: debian/changelog
| * Add compat mode for old (32bit FileSize) CacheDB (LP: #1274466)Michael Vogt2014-06-042-11/+78
| |
| * use free() instead of delete() when realloc is usedMichael Vogt2014-05-275-8/+34
| | | | | | | | | | | | | | ContentsExtract::~ContentsExtract() needs to use free() because Data got allocated via realloc() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
* | deal with hashes in ftparchive more dynamic as wellDavid Kalnischkies2014-05-094-294/+195
| | | | | | | | | | | | | | | | | | | | | | Now that libapts acquire system happily passes around hashes and can be made to support new ones without an ABI break in the future, we can free ftparchive from all the deprecation warnings the last commit introduced for it. The goal here isn't to preserve ABI as we have none to keep here, but to help avoiding introduction problems of 'new' hashes later as bugs creep into the copy&paste parts, so short/less of them is good.
* | use a std::vector instead of hardcoded arrayDavid Kalnischkies2014-05-081-41/+39
|/ | | | | | | | Arrays with predefined lengths are very fragile as they are likely forgotten in future changes and the size in this case is dynamic making it even more dangerous. Git-Dch: Ignore
* Merge remote-tracking branch 'mvo/feature/apt-ftparchive-srccache2' into ↵Michael Vogt2014-05-081-14/+4
|\ | | | | | | debian/sid
| * fix regression from commit 215b0fafMichael Vogt2014-05-081-14/+4
| |
* | Merge remote-tracking branch 'mvo/feature/apt-ftparchive-srccache2' into ↵Michael Vogt2014-05-078-195/+408
|\| | | | | | | debian/sid
| * ensure "--db" also works with the new srcpkgdbMichael Vogt2014-04-072-1/+9
| |
| * refactor _InitQuery()Michael Vogt2014-04-042-9/+22
| |
| * ensure clean worksMichael Vogt2014-04-042-10/+29
| |
| * refactor to make OpenFile/OpenDebFile more robustMichael Vogt2014-04-041-120/+110
| |
| * add test for binary cachedb and contents generationMichael Vogt2014-04-041-0/+1
| |
| * Implement CacheDB for source packages in apt-ftparchiveMichael Vogt2014-04-048-106/+288
| |
* | reduce delta from ubuntuMichael Vogt2014-04-251-2/+2
|/
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-1310-24/+57
| | | | | | | | 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: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies2014-03-134-6/+6
| | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
* warning: no previous declaration for foobar() [-Wmissing-declarations]David Kalnischkies2014-03-131-9/+9
| | | | | Git-Dch: Ignore Reported-By: gcc -Wmissing-declarations
* warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-131-4/+4
| | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
* fix -Wmissing-field-initializers warningsDavid Kalnischkies2014-03-131-1/+1
| | | | | Reported-By: gcc Git-Dch: Ignore
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-1/+1
|
* use utimes instead of utimensat/futimensDavid Kalnischkies2014-02-111-1/+2
| | | | | | | | | | | cppcheck complains about the obsolete utime as it was removed in POSIX1.2008 and recommends usage of utimensat/futimens instead as those are in POSIX and so commit 9ce3cfc9 switched to them. It is just that they aren't as portable as the standard suggests: At least our kFreeBSD and Hurd ports stumble over it at runtime. So to make both, the ports and cppcheck happy, we use utimes instead. Closes: 738567
* multicompress with externals sets wrong file modesColin Watson2014-02-061-1/+1
| | | | | | | | | | | | | | Copy from the bug description: After we upgraded the Ubuntu master archive from lucid to precise, we noticed that Translation-en.bz2 was being written with mode 0600 rather than 0644, which broke our mirroring. This is no longer reproducible as such in unstable because apt now links against libbz2, but it's still reproducible with xz; it happens because multicompress fchmods one end of the compression pipe in this case rather than the target file. [Original testcase slightly modified to comply with house-style] Closes: 737130
* correct some style/performance/warnings from cppcheckDavid Kalnischkies2014-01-161-6/+4
| | | | | | | | The most "visible" change is from utime to utimensat/futimens as the first one isn't part of POSIX anymore. Reported-By: cppcheck Git-Dch: Ignore
* rework some code to fix some scan-build warningsDavid Kalnischkies2014-01-162-31/+27
| | | | | | | | No visible functional changes, just code moved around and additional checks to eliminate impossible branches Reported-By: scan-build Git-Dch: Ignore
* ftparchive/override.cc: fix "skip empty lines" code, the pointer needs to ↵Michael Vogt2013-08-231-1/+1
| | | | get de-referenced first
* fix -Wall errorsMichael Vogt2013-08-081-1/+2
|
* merged lp:~mvo/apt/add-missing-dsc-hashesMichael Vogt2013-04-083-13/+47
|\
| * merge patch apt_0.9.7.7ubuntu2~md1.debdiff, thanks to Marc DeslauriersMichael Vogt2013-01-313-13/+47
| |
* | - add method to open (maybe) clearsigned files transparentlyDavid Kalnischkies2013-03-181-59/+46
|/ | | | | * ftparchive/writer.cc: - use OpenMaybeClearSignedFile to be free from detecting and skipping clearsigning metadata in dsc files
* * ftparchive/writer.cc:David Kalnischkies2012-07-041-1/+1
| | | | - handle the APT::FTPArchive::Packages::SHA512 option correctly instead of overriding SHA256, thanks Christian Marillat! (Closes: #680252)
* * ftparchive/apt-ftparchive.cc:David Kalnischkies2012-06-091-1/+1
| | | | - default to putting the Contents-* files below $(SECTION) as apt-file expects them there - thanks Martin-Éric Racine! (Closes: #675827)
* * ftparchive/writer.cc:David Kalnischkies2012-05-211-0/+1
| | | - include Contents-* files in Release files (Closes: #673647)