Commit Graph

5093 Commits

Author SHA1 Message Date
Gary van der Merwe 03ea8ca6a9 makepkg: Improvements to get_filename:
* For any vcs other that git, the fall through resulted in being handled by the
  code for std url, hence fragments were being left on.
* Handle vcs urls than end in a slash correctly, eg http://example.com/project/

Signed-off-by: Gary van der Merwe <garyvdm@gmail.com>
2012-09-18 08:39:37 -05:00
Mohammad Alsaleh c926c39b04 makepkg: check if $dir is a local clone of the right git repo
Before this patch, makepkg does not check if $dir is a local clone of
the right repo.

For example, git fetch would be run even if $dir is not a local
bare clone of a git repo in present in source(), but a subdir of
a checked-out one. That means makepkg can potentially fetch from
a completely unrelated remote and update completely unrelated
dirs/files.

This patch adds a check to make sure we are fetching from the right
remote.

Signed-off-by: Mohammad Alsaleh <msal@i2pmail.org>
2012-09-18 08:39:18 -05:00
Mohammad Alsaleh 34b52c9a60 makepkg: git clone instead of git fetch if $dir exists but empty
Before this patch, makepkg would only check if $dir exists as an
indication that a local clone exists. And if $dir does exist, makepkg
will run git fetch inside it unconditionally.

After applying this patch, makepkg will check if the existent $dir is
empty. And if it is, it will be used to store a local clone.

Signed-off-by: Mohammad Alsaleh <msal@i2pmail.org>
2012-09-18 08:39:08 -05:00
Allan McRae 8f5ee72974 Avoid interger overflow when calculating remaining line length
When the len and cidx were changed to size_t in a8a1b093, it was
possible to have an integer overflow when a line ended right at the
edge of the terminal width.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:38:45 -05:00
Allan McRae 7262f4bed4 Fix typo in documentation
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:38:15 -05:00
Allan McRae 8550680924 makepkg: fix warnings with --noextract
Three warnings after someone deliberately typed --noextract is a
tad excessive...   Also, an empty $srcdir is perfectly valid when
the source array is empty, although using --noextact then is
wasteful.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:38:08 -05:00
Dave Reisner aa50df630c makepkg: implement dir_is_empty for dir content checks
Rather than calling upon ls for this, use a proper shell function which
uses globbing to determine the existance of files in a directory.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-18 08:37:46 -05:00
Dan McGee 369c5aa7dd Merge branch 'maint' 2012-09-18 08:36:10 -05:00
Allan McRae c4ab50584f pacman.8: remove redundant section
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:35:57 -05:00
Florian Pritz f7558856b1 signing.c: warn if time went backwards
GPG signatures have a timestamp which is checked and if it's in the
future, verification will fail.

Dan: slight wording change.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-09-18 08:35:53 -05:00
Dave Reisner 37de9df7c0 pkgdelta: pass correct args to create_delta
Somewhere in the arg parse refactoring, the args array went away and we
simply stashed our remaining parameters as positionals. Fix this up so
that pkgdelta doesn't mysteriously hang in read_pkginfo().

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-18 08:30:17 -05:00
Allan McRae 87f9377b32 Fix documentation typo
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-09-18 08:30:05 -05:00
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