Commit Graph

5031 Commits

Author SHA1 Message Date
Allan McRae e32d129967 Remove incorrect documentation for unlink_file
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:29:55 -05:00
Andrew Gregory ea35ce5d2e query_fileowner, mdirname: add error checks
Also consolidates cleanup for query_fileowner.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-09-18 08:28:34 -05:00
Andrew Gregory de7a5cf346 query_fileowner: remove assumption that root is "/"
Returning "/" from mdirname removes it as a special case which allows us to
test it like any other directory.  This corrects a false positive when querying
a file in / and root is not set to /.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-09-18 08:27:59 -05:00
Andrew Gregory 03f2e2360a query_fileowner: remove trailing '/' from targets
Trailing '/' in paths causes lstat to dereference symlinks to
directories which causes it to break even though the symlink is a valid
target.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-09-18 08:27:23 -05:00
Andrew Gregory 140c76d328 query_fileowner: resolve root early
Resolving root early prevents later calls to realpath from having to do the
work of actually resolving any symlinks in root.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-18 08:24:02 -05:00
Andrew Gregory 9648887481 query_fileowner: remove resolve_path function
resolve_path is a equivalent to calling realpath(path, NULL) except that the
returned string is guaranteed to be PATH_MAX long.  We never append to the
returned string, so this is unnecessary.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-09-18 08:21:42 -05:00
Andrew Gregory bad00696f3 query_fileowner: break/continue pkgfile loop
Break out of pkgfile loop on match or continue if
the pkgfile path is too long.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-09-18 08:19:11 -05:00
Allan McRae 89319b5bfd Document system and user specific makepkg.conf
Add details of the system wide and user specific versions of
makepkg.conf to the man page.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-18 08:10:24 -05:00
Allan McRae 19b8298ce8 pactest: allow running with valgrind from any directory
When using the --valgrind flag with the pactest.py script, the path
to the suppression file relies on the script being called from the
source root directory.  Construct the path from the scripts location
to allow it to be called from directory.

Dan: style cleanup.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-18 08:09:57 -05:00
Allan McRae 0fe562011c Move important information up in -Si output
Currently, the package description is printed at the end of the -Si output.
This is probably one of the more important pieces of information so should
be nearer the top. Also move the package architecture up.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-07 21:10:16 -05:00
Jason St. John 632912261a PKGBUILD.vim: improve 'options' highlighting, add extra keywords
This fixes the current syntax highlighting behavior in the 'options'
array, which does *not* flag illegal options (e.g. typos, unsupported
options). The shDoubleQuote and shSingleQuote options were the culprits.
Now, if you enter `'!imptydurs'`, the typoed option will be flagged red.

I also added syntax highlighting for the new options listed in `man 5
makepkg.conf`, which I believe were introduced around pacman 4.0.0.

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-07 20:59:27 -05:00
Barbu Paul - Gheorghe c52bb7030c removed the condition in alpm_db_set_servers since FREELIST is NULL safe
Signed-off-by: Barbu Paul - Gheorghe <barbu.paul.gheorghe@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-07 20:56:57 -05:00
Barbu Paul - Gheorghe 527ae7092d added coding standard
Signed-off-by: Barbu Paul - Gheorghe <barbu.paul.gheorghe@gmail.com>
2012-08-07 20:56:45 -05:00
Barbu Paul - Gheorghe a50d1bc9ab fixed typo
Signed-off-by: Barbu Paul - Gheorghe <barbu.paul.gheorghe@gmail.com>
2012-08-07 20:56:02 -05:00
Dan McGee 024bc44a25 Merge remote-tracking branch 'allan/working-split/vcs' 2012-08-07 20:55:11 -05:00
Dan McGee 0c95b294e9 Merge branch 'maint' 2012-08-07 20:54:59 -05:00
Florian Pritz 8853a6f282 coding style fixes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-07 20:32:30 -05:00
Allan McRae c9b31ad622 Print repo being search for replaces in debug output
Given the message is repeated for each repo, it is a good idea to
print the repo name in the output.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-07 20:30:54 -05:00
Allan McRae a818766c6e makepkg: delay checking for build package with pkgver()
If a pkgver() function is specified, delay checking the package is
built until the pkgver is updated..

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae 7e4aa9e524 makepkg: add hg url support
Supported fragments are branch, revision and tag.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae d51902c978 doc: Add --holdver information for makepkg
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae 062204daa1 doc: Document using svn source url
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae c887ccf905 doc: document automatically updating the pkgver variable
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae e0cd7b0293 doc: Document using VCS sources in a PKGBUILD
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae 4b129d4843 makepkg: check pkgver validity after updating
If a PKGBUILD has a pkgver() function, skip checking the pkgver validity
until it has been updated.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:39 +10:00
Allan McRae b1e75d7dd6 makepkg: only update pkgver when all sources are available
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 6c8def6ae0 makepkg: add --holdver to control VCS source updating
Do not update VCS sources if --holdver is used. If the VCS checkout
is not present, it will still be downloaded.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 7fd56118d0 makepkg: do not download VCS sources unless needed
VCS sources are not needed for --geninteg or --source operations.
This also prevents VCS downloads outputting to stdout, which
prevented piping -g output to the PKGBUILD.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae b3e82ec59e makepkg: rename myver
myver is a bit generic for an internal variable name.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 2042b79bcc makepkg: add support for SVN urls
Allow SVN repo sources in the form:

source=("<folder>::<repo>#<fragment>")

where <repo> must start with svn (e.g svn+http://) and a <fragment>
can specify a revision (e.g. revision=22).

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 888020de90 makepkg: provide mechanism for auto-updating pkgver
Now that VCS repos are provided in the source array, it becomes too
complicated to have automatic updating pkgver as was the case with
the old VCS PKGBUILDs (there can be multiple repos of different types
in the source array, the VCS repo may not be the package primary
source, etc).

Instead provide an optional way for a PKGBUILD to update the pkgver
value through the specifing of a pkgver() function that returns the
new version string.  This is run after all source files are downloaded
so can access the VCS repo if needed.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae cca9849fc2 makepkg: modify get_filepath to handle VCS sources
With VCS sources, get_filepath should return the directory of the
checkout. This allows backing up of the VCS checkout when using
--allsource.  Fixes FS#21098.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae aa6fe1160b makepkg: modify get_filename to handle VCS sources
Modify get_filename to return the name of the folder with VCS sources.
This fixes output issues in checksum checking.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 682c9af846 makepkg: fix checksum generation with VCS sources
VCS sources should have "SKIP" for their checksum value

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 91d119af1c makepkg: allow using GIT source URLs
Allow specifing GIT sources using the following syntax

source=('<folder>::<repo>#<fragment>')

This will download the git repo <repo> into <folder> (into $SRCDIR
if set, otherwise $startdir). <repo> must start with "git", but
non-git protocols are handled using (e.g.) "git+http://...".

The <fragment> can be used to specify a branch, tag, or commit to
build from. e.g. branch=maint.

Checksum entries for git sources should be "SKIP".

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 57e06394dd makepkg: skip integrity checking early
If "SKIP" is provided for an integrity check, abort checking as soon
as possible.

Also swap fork to tr for bash4 conversion.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae 1a04e2e11a makepkg: generalize download_sources
In order to treat all VCS sources as URLs, we need to be able to
deal with more protocols. Rewrite download_sources to use a case
statement so additional protocols are easily added.

Also fix the use of scp to not pass the protocol in the URL
(noticed by William J. Bowman <wjb@williamjbowman.com>)

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae a922d18056 makepkg: add function to return download protocol
Extract the download protocol from a source entry.  Returns "local"
for local source files.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae e806414407 makepkg: reorder source handling functions
There is no actual code change here, but these related functions
were all over the place which makes this code difficult to adjust.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Allan McRae d338b3981d makepkg: remove VCS package support
The current VCS packaging support is really, really, really bad.
It is best to strip it out completely before rewriting it.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-04 00:16:38 +10:00
Pierre Schmitz ec5e6d9029 pacman-key: Use lsign_keys function in --populate
This reduces code duplication and also makes --populate a non-interactive function.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-08-02 09:46:16 -05:00
Allan McRae d46bb6b27b Split _alpm_filelist_operation function
To improve conflict checking, we will need to make these functions
diverge to an extent where having two separate functions will be
preferable.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02 09:40:44 -05:00
Dan McGee 72d3713cc7 Move filelist functions into separate source file
We have a few of these and might as well gather them together. This also
cleans up the code a bit by using an enum instead of integer values, as
well as makes a "search for file in filelist" function public so
frontends can do better than straight linear search of the filelists.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02 09:39:08 -05:00
Dave Reisner 70d8c2150e pactest: avoid upgrade conflict with unchanged effective path
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02 09:38:58 -05:00
Allan McRae 41dae68952 pactest: Do not remove symlink to directory if a to be installed package uses it
If a pacakge has a directory symlink (e.g. /lib -> usr/lib), do not
allow it to be removed if any other package is trying to install a
file into that path (e.g. /lib/foo).  This is because the local
database can become invalidated if the symlink is removed after the
package with file /lib/foo is installed (sync702.py).  If the symlink
is removed before the file is installed (sync701.py), the upgrade is
actually a success, but we can not guarantee the ordering so both
cases should fail.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02 09:38:45 -05:00
Allan McRae fa2eadcec7 pactest: Do not remove symlink to directory if local package uses that path
If we have a symlink to a directory (e.g. /lib -> usr/lib), then
we can not remove it if a local package thinks it has files in the
symlink directory (e.g. /lib/foo), because this will invalidate the
local file database.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02 09:38:37 -05:00
Allan McRae eb87155391 pactest: conflict between files having same effective path
Note failure to detect a conflict between files having the same
effective path across packages due to a directory symlink.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02 09:38:24 -05:00
Allan McRae 6f47dfc920 pactest: conflict between directory and a file
Note failure to detect a conflict between a directory in one package
and a file in the other when the directory is not currently on the
filesystem.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02 09:38:16 -05:00
Allan McRae e3772f7654 Add pactest for empty subdirectory conflict
The wrong test file was inadvertantly committed in 44e9fdd0. Add the
correct test and tidy up the test which was committed.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02 09:37:48 -05:00
Jan Alexander Steffens (heftig) 49dbebcc36 Allow cleaning only some cachedirs
When cleaning the cache, ask for each cachedir separately.

Allan: add some white space in output

Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-02 09:34:45 -05:00