summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-09-23Add version file to empty local databaseAllan McRae2-12/+35
If a user manually creates the local database directory, or has an empty local database for some other reason, we silently add a version file Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-23Add version file when creating local database directoryAllan McRae2-0/+20
The version of the local pacman database is stored in its root in the file ALPM_DB_VERSION. The version is starting at 9, corresponding to the next libalpm library version. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-23Create local database directory if it is missingAllan McRae1-14/+26
This means that a missing local database becomes an error (as it should be immediately created). Note this only creates the "local" directory and not its parent, which is checked for during locking. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-23Extend database upgrade script to handle alpm db version 9Andrew Gregory1-10/+86
Original-work-by: Allan McRae <allan@archlinux.org> Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-16pacman-db-upgrade: use pacman-style optionsAndrew Gregory2-21/+53
* convert dbpath from argument to option * add --config and --root options * read dbpath and root from config file * if root is set but not dbpath, dbpath is set relative to root Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-16fix improper FREELIST callsAndrew Gregory2-3/+6
* conflicts need to be freed with alpm_conflict_free * sync dbs need to be unregistered and are handled by alpm_release Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-15updpkgsums: use a throwaway build dirDave Reisner1-0/+2
This prevents updpkgsums from potentially dirtying an otherwise pristine directory (likely $PWD) when makepkg creates the srclinks. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-15makepkg: do not eval dlcmdlolilolicon1-11/+10
This eval enables the following in a PKGBUILD to "just work": source=('$pkgname-$pkgver.tar.gz'::'https://host/$pkgver.tar.gz') This has at least two problems: - It violated the principle of least surprise. - It could be a security issue since URLs are arbitrary input. Instead, expand the dlagent command line into an array, replace the %o, %u place holders, and run the resultant command line as is. Embedded spaces in the DLAGENTS entry can be escaped with a backslash. Fixes FS#41682 Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-15makepkg: Allow using sources with :: in themWilliam Giokas1-3/+3
Git has the ability to use helper applications for interfacing with hg, and from what we had before, the following url:: foo::git+hg::http://foo.bar/foobar would get converted to something along the lines of: filename: foo URL: http://foo.bar/foobar and the 'git+hg' part would essentially be ignored when it's getting set up in the 'get_protocol' and 'get_downloadclient' functions. With this patch it is possible to have a source link with '::' in it, however it is not possible to have a filename with '::', which is the current behavior. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-15paccache: read default cachedir from pacman.confDave Reisner1-2/+21
Implements FS#40738.
2014-09-15paccache: add support for multiple cachedirsMaxim Andersson1-23/+37
Signed-off-by: Maxim Andersson <thesilentboatman@gmail.com>
2014-09-15PKGBUILD(5): arch-specific fields are always additionalDave Reisner1-2/+2
Change e10775340 should have included this. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-09pacman-key: stricter parsing for -verifyAllan McRae1-1/+1
Prevents trust being spoofed by using TRUST_FULLY in the signatory's name or in an added notation. Fixes FS#41147. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-09pkgdelta(8): Fix broken example of --min-pkg-size with human-readable valuesJason St. John1-2/+2
The example for human-readable values must not contain a space between the value and the unit; otherwise, pkgdelta will not recognize the command options and will error out. In prose, however, there should be a space between the value and the unit. Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-09man: Improve grammar and add missing single quotes around command optionsJason St. John11-47/+49
Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-09man: Use uniform line spacing between sectionsJason St. John12-6/+30
Remove blank lines immediately following section headings. Ensure two blank lines before the start of a new section. Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-09pacman(8): Improve grammar and quotingJason St. John1-5/+5
Notable changes: * Add double quotes around printf-like formatting options for "--print-format" * Add a missing backslash in '--force' Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-09Fix loading invalid packageOlivier Brunel1-1/+3
In 5acfa65f when adding a new variable (hit_mtree), the initialization of a variable (config) was dropped, which could lead to loading invalid package files, i.e. files that aren't archive (no metadata loaded) would return a new alpm_pkg_t with everything set to 0/NULL. Depending on the operation/use of the package, this could lead to segfault. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-08makepkg: replace bare eval with var extraction functionsDave Reisner1-6/+12
2014-08-08PKGBUILD: handle arch specific attributesDave Reisner2-3/+66
This introduces support for architecture-specific conflicts, depends, optdepends, makedepends, replaces, and conflicts by appending "_$CARCH" to the array name. For example, in the global section: arch=('i686' 'x86_64') depends=('foo') depends_x86_64=('bar') This will generate depends of 'foo' and 'bar' on x86_64, but only 'foo' on i686. Moreover, this is supported in the package functions with the same heuristics as the generic names, e.g. ... arch=('i686' 'x86_64') depends=('foo') ... package_somepkg() { depends_x86_64=('bar') ... } Again, will cause x86_64 to have depends of 'foo' and 'bar', but only 'foo' for i686.
2014-08-08makepkg: refactor check_sanity, give it some sanity of its ownDave Reisner1-107/+299
Break apart each of the blocks into their own separate functions. And, instead of the hand crafted eval statements, reuse the logic from pkgbuild-introspection[0] to abstract away the complexities of parsing bash. This commit fixes at least 3 bugs in check_sanity: 1) The wrong variable is shown for the error which would be thrown when, e.g. pkgname=('foopkg' 'bar^pkg') 2) The "arch" variable is not sanity checked when the PKGBUILD has an arch override, but only one output package. 3) https://bugs.archlinux.org/task/40361 Lastly, there's some string changes here which should help to clarify a few errors emitted in the linting process. [0] https://github.com/falconindy/pkgbuild-introspection
2014-08-08Update PKGBUILD documentation for removed override optionsAllan McRae1-3/+3
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-08makepkg: disallow pkgver/pkgrel/epoch overrides in packagesDave Reisner1-33/+12
This is a confusing feature, and no one uses it.
2014-08-08remove --destination-dir argument from a2x optionsDave Reisner1-2/+1
This option is only for HTML output, and we're building manpages here. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04Add Andrew to maintainers list.Allan McRae1-0/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04trans_commit: log beginning and end of transactionAndrew Gregory1-0/+10
This makes it clear whether a transaction successfully completed and allows log parsers to group related actions. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04filecache_find_url: dereference the 'filebase' pointerRyo Munakata1-1/+1
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04replace strdup with STRDUPAndrew Gregory3-11/+7
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04sync.c: fix style violationsAndrew Gregory1-5/+7
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04pacman.c: simplify stdin parsingAndrew Gregory1-19/+8
Incorporate memory exhaustion and end-of-stream checks into the main loop. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04handle_unlock: log error when lock file is missingAndrew Gregory1-6/+14
Problems due to concurrent running instances of pacman can be difficult to diagnose. Log a warning to make it more obvious that that's what happened, that it's a bad idea, and hopefully encourage people who do things like removing the lock file to run pacman from an install script to at least be courteous enough to put it back when they're done. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04handle_unlock: log lock removal failureAndrew Gregory3-11/+6
Rather than have individual callers log failure, just do it directly in _alpm_handle_unlock. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04signing.c: remove useless error checkAndrew Gregory1-1/+0
CHECK_ERR checks gpg_err which is a local variable. Calling gpg_op_import_result cannot modify it. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04deps.c: use alpm_list_find_ptrAndrew Gregory1-8/+3
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04dep_graph_init: filter ignored packages by nameAndrew Gregory1-1/+1
Ignored packages are from the transaction remove list which consists of duplicated packages so a direct pointer comparison is not appropriate. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04pactest: delay test object creationAndrew Gregory1-3/+3
The actual test object is only used to run the test. Storing test cases as strings limits the test object scope and allows it to be garbage collected, reducing memory usage when multiple tests are run. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04pactest: only snapshot needed filesAndrew Gregory2-6/+17
Only a few of our tests need file snapshots at all and most of them only need a few files. Taking snapshots of the entire test environment for every single test is a massive waste. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04handle: factor out string list option handlingAndrew Gregory2-58/+39
Consolidates repeated code and replaces dangerous strdup calls with STRDUP. Also fix a couple variables named "pkg" that refer to file paths. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04makepkg: skip dependency checking with --verifysourceAllan McRae2-3/+5
Dependencies are now handled with --nobuild unless specificially skipped. Using --verifysource will skip dependency checks unless --syncdeps is specified. Fixes FS#35057 and FS#36999. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04makepkg: ensure vcs download tool are installed when requiredAllan McRae2-0/+75
Add an array VCSCLIENTS to makepkg.conf that matches vcs source protocols to the package containing the software needed for handling the source. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03makepkg: improve check and error message for buildfile locationDave Reisner1-2/+2
The documentation very clearly states that the buildfile has to be in $PWD, but the error thrown by makepkg reference some mysterious "build directory". Simplify this check so that we more directly check that the file being referred to is in fact in our $PWD. Revise the error message when the check fails to more plainly point out the problem. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03sync_prepare: remove useless check for replacersAndrew Gregory1-2/+0
Since 017184fa, alpm_sync_sysupgrade will not add both a replacement and a literal upgrade to the transaction. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03check_pkg_fast: check file typeAndrew Gregory2-4/+13
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03check_file_exists: replace lstat with llstatAndrew Gregory1-3/+3
Paths are constructed directly from package file lists and may contain trailing slashes, causing lstat to dereference symlinks. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03llstat: modify path in placeAndrew Gregory2-8/+12
This makes llstat's signature differ from lstat's, but we never actually use it on a const string and this saves a large number of strdup's. This also allows stripping multiple trailing slashes and corrects a bug where calling llstat on "/" would result in calling lstat on an empty string. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03move _alpm_lstat into util-commonAndrew Gregory8-32/+34
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03add test for file type check with -QkAndrew Gregory2-0/+15
If a directory has been replaced by a symlink, -Qk currently stats the symlink target rather than the symlink itself and doesn't check that the actual file type matches the package file list. This will make it difficult to discover errors once 4.2 is released and replacing directories with symlinks is no longer supported. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03pacdiff: allow DIFFPROG to contain commandline optionsAllan McRae1-3/+3
Also use 'vim -d' as default diff viewer. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-03pactest: check for tests before environment setupAndrew Gregory1-5/+4
Setting up the temporary directory and environment is pointless if there are no tests to run. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-08-03pactest: check for pacman binary before runningAndrew Gregory1-1/+5
Using fakeroot or fakechroot as the command with subprocess.call prevents the detection and reporting of a missing pacman binary. Some tests even pass when run with a non-existent binary. Checking manually allows us to provide a meaningful error message and prevent the false positives. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>