summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2012-12-14makepkg: normalize whitespace in $pkgdesc when writing .PKGINFODave Reisner1-1/+1
Specifically, we shouldn't allow newlines in the pkgdesc field, as pacman will ignore the continuation and end the description prematurely as written to the local DB. Normalize ALL whitespace, replacing it with single whitespace characters. Fixes strange errors as seen by FS#32852. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14pkgdelta: avoid use of eval and IFS manipulationDave Reisner1-16/+12
Instead of blindly consuming data from the .PKGINFO file, parse it more closely and only declare variables as needed. Should help to avoid nonsensical errors and possibly dangerous command execution as seen in FS#32852. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Display install status of optdependenciesAllan McRae1-2/+18
When a packages (new) optdepends are printed in install (update), add a note of their current installation status. Packages currently installed are labelled with [installed] and packages to be installed in this transaction are labelled [pending]. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Make alpm_pkg_find publicAllan McRae7-24/+30
This function is particularly useful, so make it public. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add pactest for "Optional for" outputBenedikt Morbach1-0/+13
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add "Optional for" to package information outputAllan McRae3-8/+38
Much like packages that require a give package are displayed in the "Required by" field of its information output, alos display packages that optionally require the package. Inspired-by: Benedikt Morbach <benedikt.morbach@googlemail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add pactests for displaying optdep installation statusBenedikt Morbach2-0/+27
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Display optdep install status in package query outputAllan McRae1-6/+14
Indicate which optional dependencies are installed when viewing local package information (-Qi). Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Notify of removed package required as optdependAllan McRae3-1/+37
When a package is being removed, provide a notification (via a callback) if any local package requires it as an optdepend. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14It turns out we do care about directories...Allan McRae3-23/+9
This is a bug that has been around since at least 2007. On a package upgrade (either by -S or -U) a new directory could overwrite any file. This is caused by the filelist difference calculation ignoring all directories and thus no new directories were checked for conflicting files on the filesystem. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add pactests for not detecting directory conflicts with upgradesFlorian Pritz2-0/+38
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Fix overzealous package removal with unmet dependenciesAndrew Gregory4-47/+41
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> [Allan: Remove expected failure from fixed pactests] Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14pactest: variant of package removal due to unmet dependenciesAllan McRae1-0/+28
Duplicate of sync140.py but with the alphabetical ordering of the packages changed. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14pactest: removal of packages with unmet dependenciesAllan McRae1-0/+28
Provide a package for removing packages with unmet dependencies. Currently pacman removes too many packages from the transaction (FS#30649). Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14_alpm_filelist_resolve: add useful return codeAndrew Gregory2-38/+47
Return -1 if a path is too long to resolve or we run out of memory. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Avoid upgrade conflict with unchanged effective pathAllan McRae3-5/+3
This applies to a case such as when /lib is a symlink to /usr/lib. If a package is installed which contains /lib/libfoo.so, pacman will complain if this package is then "fixed" to contain /usr/lib/libfoo.so. Since these have the same effective path and it exists within the same package, ignore the conflict. Fixes FS#30681. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Resolve file paths during inter-package conflict checkAllan McRae5-12/+36
File paths are resolved if necessary during inter-package conflict checks so that packages carrying the same effective file due to directory symlinks on the filesystem are flagged as conflicting. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14_alpm_filelist_resolve: use original filenames where possibleAndrew Gregory2-22/+34
If a filename isn't resolved, the original can be used instead of strdup()ing it. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add _alpm_filelist_resolveAndrew Gregory2-0/+181
The _alpm_filelist_resolve function takes a filelist and creates a list with any symlinks in directory paths resolved. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Add resolved_path to alpm_filelist_tAllan McRae2-1/+11
Add an array to hold the resolved paths of the files in alpm_filelist_t. When the file name and its resolved file name are identical, the pointer to the original file name is used to avoid duplicate memory allocation. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14Detect inter-package conflicts between files and directoriesAllan McRae3-17/+38
Detect a conflict between a file/symlink in one package and a directory in another when both are being installed at once. A side effect is the creation of conflicts between a directory symlink and a real directory (e.g lib -> usr/lib in pkg1 and /lib in pkg2). Given we can not guarantee pkg1 is installed before pkg2, this is a genuine conflict. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14pactest: Provide a full filelist to the pactests that need itAllan McRae2-4/+11
It turns out when you set the filelist for a package to include "usr/lib/foo" in the pactest suite, it thinks there is only the file "usr/lib/foo" in there... No "usr/" or "usr/lib/" directory. This makes life difficult when testing code that scrolls through a filelist looking for directory entries. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: install debug symbol packages if requestedAllan McRae1-0/+4
When using "makepkg -i", install the debugging symbol packages too if present. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: assign debugging symbol directory to a variableAllan McRae1-14/+13
Simplifies the stripping of files a lot. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: allow debug package suffix to be configurableAllan McRae3-15/+24
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: create package from stripped debug symbolsAllan McRae3-1/+29
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: output the name of the package being createdAllan McRae1-12/+5
Although it should be currently quite obvious what package is being created when "Creating package..." is printed, it will not be in the future when a debug package is potentially created too. Also, given $pkgname is always correctly set when split packaging now, we no longer need to pass that around. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: strip debugging symbols into separate folderAllan McRae1-0/+50
When using the "debug" option in combination with "strip", move the debugging symbols into a separate directory ($pkgdir-debug/usr/lib/debug) suitable for creating a package from. Create hardlinks between debugging symbols of hardlinked files and add symlinks in the .build_id directory if the binary has a build ID. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: always use pkg/$pkgname as $pkgdirAllan McRae1-0/+6
Unify split and single packages to always use a folder within pkg/ as thier $pkgdir. This will allow a folder for storing a package with stripped debug symbols to be added within pkg/ too. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: move debug symbol stripping to separate functionAllan McRae1-4/+12
Move stripping of files to a spearate function that will be expanded for the handling of creating debug symbol packages. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: add option to include debugging compiler flagsAllan McRae4-3/+28
Add a "debug" option that appends the compiler flags specified in the variables DEBUG_CFLAGS and DEBUG_CXXFLAGS in makepkg.conf to their counterpart buildflags. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: always run tidy_install on repackagingAllan McRae1-8/+3
When using "makepkg -R" without a packge function, we should still run tidy_install as the user might have added other packaging options such as (e.g.) '!emptydir' to remove empty directories on repackaging. Of course we can not revert some options when repackaging without a package function. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: unindent first limbAndrew Gregory1-1/+1
Removing the leader for the toplevel package shifted the name left but not it's limb. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: unify output between utf8 and asciiDave Reisner1-16/+20
Ensure that both output formats have equal spacing, and therefore an equivalent layout. This change also removes the styling from the toplevel package being searched for. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: fix style violationsDave Reisner1-2/+3
Stick to c89 and avoid mixed code and declarations, and always brace block statements, even if they're only 1 line. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: autodetect and use unicode line drawing charactersDave Reisner3-5/+40
Add a compile time check for langinfo.h so that we can possibly use unicode line drawing characters if the current locale is supportive of them. This can be explicitly disabled at runtime with the use of a new switch: -a, --ascii. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: style last branch node differentlyAndrew Gregory1-13/+17
Also removes the less helpful provides-specific branch tip. Old: New: |--pkg |--pkg +--dep1 provides dep5 |--dep1 provides dep5 | |--dep2 | `--dep2 |--dep3 `--dep3 |--dep4 `--dep4 [dreisner@archlinux.org: switch original suggestion of \-- to `--] Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pactree: fix --sync getopt valueAndrew Gregory1-1/+1
The long --sync options has apparently never worked. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27Add --needed option to makepkgwgiokas2-1/+7
Simply add the option to pass the --needed flag to pacman when using -i with makepkg. When using makepkg in scripts, particularly for git packages with the new version functions and not just a date, this can save disk io and time instead of reinstalling. This would mostly be useful with the --noconfirm option. Signed-off-by: wgiokas <1007380@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27Use sentence case in makepkgJason St. John1-4/+4
Most of makepkg already uses sentence case. This cleans up the last few stragglers. Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: save path to PACMAN and test availabilityAllan McRae1-5/+13
After we install dependencies, we source /etc/profile so that new elements get added to the path. As this can override any local setting of PATH, we store the full path of the PACMAN variable passed to makepkg. Also, add a check for PACMAN availability if it is needed to deal with any dependency operations. Reported-by: Martin Panter <vadmium à gmail·com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27Remove last traces of handling command arguments in $PACMANMartin Panter1-2/+2
This resolves an inconsistency with how the $PACMAN variable was interpreted. Previously “makepkg” would extract the first word from the $PACMAN variable and check that it existed as a command. This appears to have been happening ever since the variable was implemented in revision 66c6d28 (makepkg: allow to specify an alternative pacman command). Thus it looks like command arguments were originally allowed in the variable. However the run_pacman() function now quotes $PACMAN, so the whole variable has to be just the command name. This quoting was introduced more recently, perhaps in revision 622326b (makepkg: fix sudo/su calling of pacman). Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: fix signing built packageChristian Hesse1-0/+1
Fixes issue introduced in 9dd42dc0 Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: deprecate PKGBUILDs without a package() functionAllan McRae1-0/+4
The package() function has been around since pacman-3.3 and has significant advantages including limited fakeroot usage and correct repackaging. The ability to use PKGBUILDs without a package function will be removed in a future release. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: print "SKIP" for signature checksumsAllan McRae1-4/+8
There are valid reasons for a source files PGP signature to be changed (expired key, expired signature, additional person signing...). Thus providing a checksum for signature files can potentially cause a PKGBUILD to require unnecessary updating. Avoid this issue by using "SKIP" for the signature checksum. Fixes FS#31590. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27makepkg: use last match in BUILDENV/OPTIONS arrayAllan McRae2-4/+7
Using the last match in the BUILDENV and OPTIONS arrays allows the user to easily override these values without specifying the entire array. For example add "BUILDENV+=(sign)" in ~/.makepkg.conf. Fixes FS#26701. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27pacman: add -n/--native filter to -QSimon Gomizelj4-0/+12
Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27doc: PKGBUILD.5 - fix output of bzr commandAllan McRae1-1/+1
Add quotes around 'bzr help revisionspec' to make it clearer that this is a command to be run. Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27fixed erroneous memory access to newurl in alpm_db_remove_serverPaul Barbu Gheorghe1-3/+6
Signed-off-by: Barbu Paul - Gheorghe <barbu.paul.gheorghe@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27repo-add: quote filename for consistent output styleAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>