1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-10-31 23:55:04 -04:00
Commit Graph

5974 Commits

Author SHA1 Message Date
Allan McRae
5d618438c4 _alpm_backup_dup: fix memory leak in error case
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 11:58:26 +10:00
Allan McRae
a7298c36fd makepkg: symlink files in noextract into $srcdir
File in noextract should still be symlinked into $srcdir so that they
can be accessed without using $SRCDEST.  Using noextract on VCS files
makes no sense as these are not being extracted, so now this does
nothing.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 11:58:25 +10:00
Allan McRae
d9aa7025ea Remove logging of NoExtract events
With globbing in NoExtract, these log events can quickly pile up hiding
important information from the log.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 11:58:25 +10:00
Allan McRae
8c00dd7341 Fix crash when using external downloader
Commit 9d96bed9 attempts to use the same effective URL for the db and its
signature download.  However, this information is not available when we use
an external downloader, resulting in a crash.

Fall back to the old method when the effective URL is unavailable.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-17 17:13:48 +10:00
Lukáš Jirkovský
4c1f41a7c1 makepkg: svn: update existing sources in srcdir without removing them first.
This matches the behaviour with non-VCS sources. It also allows incremental
builds when subversion is used to obtain sources.

Signed-off-by: Lukáš Jirkovský <l.jirkovsky@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-17 14:56:17 +10:00
Andrew Gregory
0d24994934 makepkg: only strip vcs prefixes from front of url
Referenced by FS#41811

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-17 13:02:12 +10:00
Andrew Gregory
6949012590 makepkg: do not strip bzr+ from bzr+ssh urls
bzr does not recognize bare ssh:// urls.

Fixes FS#41811

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-17 13:01:43 +10:00
Allan McRae
db2562113b makepkg: bzr: update existing sources in srcdir without removing them first.
The local changes are discarded when updating. This matches the behaviour
when non-VCS sources are used. It also allows incremental builds.

This also changes the checkout during bzr source "extraction" to a heavyweight
checkout so that pulling a specific revision does not alter the original
download.

Original-work-by: Lukáš Jirkovský <l.jirkovsky@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-17 12:58:06 +10:00
Lukáš Jirkovský
be3ce88bb2 makepkg: hg: update existing sources in srcdir without removing them first.
The local changes are discarded when updating. This matches the behaviour
when non-VCS sources are used. It also allows incremental builds.

Signed-off-by: Lukáš Jirkovský <l.jirkovsky@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-09 18:28:47 +10:00
Lukáš Jirkovský
f66ae5334e makepkg: checkout a revision specified in SVN fragment in download_svn.
Previously the sources were dowloaded in HEAD revision in the download_svn().
If a specific revision was requested in fragment, the code was updated to that
revision in extract_svn(). However, because SVN is a centralized system,
this means that the changed sources has to be downloaded again.

By moving the fragment handling to download_svn(), we get the correct revision
without having to download it later in extract_svn().

Signed-off-by: Lukáš Jirkovský <l.jirkovsky@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-09 17:28:22 +10:00
Lukáš Jirkovský
f6b3c9d803 makepkg: git: update existing sources in srcdir without removing them first.
The local changes are discarded when updating. This matches the behaviour
when non-VCS sources are used. It also allows incremental builds.

Signed-off-by: Lukáš Jirkovský <l.jirkovsky@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-09 16:09:27 +10:00
Allan McRae
ecf0e37fc5 makepkg: improve stripping pkgdesc of whitespace for .PKGINFO
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-09 15:53:16 +10:00
Dave Reisner
6029a77ac0 makepkg: introduce .SRCINFO files for source packages
Similar to .PKGINFO, .SRCINFO provides structured metadata from the
PKGBUILD to be included with source packages.

The format is structured such that it contains a "pkgbase" and one to
many "pkgname" sections.  Each "pkgname" section represents an "output
package", and inherits all of the attributes of the "pkgbase" section,
and then can define their own additive fields.

For example, a simple PKGBUILD:

  pkgbase=ponies
  pkgname=('applejack' 'pinkiepie')
  pkgver=1.2.3
  pkgrel=1
  arch=('x86_64' 'i686')
  depends=('friendship' 'magic')

  build() { ...; }

  package_applejack() {
    provides=('courage')

    ...;
  }

  package_pinkiepie() {
    provides=('laughter')

    ...;
  }

Would yield the following .SRCINFO file:

  pkgbase = ponies
  	pkgdesc = friendship is magic
  	pkgver = 1.2.3
  	pkgrel = 1
  	arch = x86_64
  	arch = i686
  	depends = friendship
  	depends = magic

  pkgname = applejack
  	provides = courage

  pkgname = pinkiepie
  	provides = laughter

The code to generate this new file is taken a project which I've been
incubating[0] under the guise of 'mkaurball', which creates .AURINFO
files for the AUR. AURINFO is the exactly same file as .SRCINFO, but
named as such to make it clear that this is specific to the AUR.

Because we're parsing shell in the packaging functions rather than
executing it, there *are* some limitations, but these only really crop
up in more "exotic" PKGBUILDs. Smoketesting[1] for accuracy in the Arch
repos yields 100% accuracy for [core] and [extra]. [community] clocks in
at ~98% accuracy (.3% difference per PKGBUILD), largely due to silly
haskell packages calling pacman from inside the PKGBUILD to determine
dependencies. [multilib] currently shows about 92% accuracy -- a
statistic which can be largely improved by utilizing the recently merged
arch-specific attribute work. This is also a smaller repo so the numbers
are somewhat inflated. In reality, this is only a .8% variance per
PKGBUILD.

Together, we can make PKGBUILD better.

[0] https://github.com/falconindy/pkgbuild-introspection
[1] https://github.com/falconindy/pkgbuild-introspection/blob/master/test/smoketest

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-09 15:41:50 +10:00
Dave Reisner
bd746568f6 makepkg: simplify epoch handling
We can avoid setting a default value for epoch since we intend to mean
unset and "0" as the same thing. This is also a more consistent default
as the display of epoch=0 is no epoch at all in the full package
version.

The extra paranoia in get_full_version can be removed due to lint_epoch
guarding against non-integer values of epoch.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-09 15:35:12 +10:00
Dave Reisner
03aa44a3ec makepkg: ignore empty global attributes in extraction
This bug isn't currently exposed by any of the existing codepaths, but
an upcoming patch to introduce SRCINFO files to makepkg will expose
this.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-09 13:46:51 +10:00
Florian Pritz
f77933ea1e Add --assume-installed to shell completion
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-09 13:46:23 +10:00
Florian Pritz
9594f513a4 Add --assume-installed to pacman --help
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-05 11:01:09 +10:00
Dave Reisner
37aeb43644 makepkg.8: remove superfluous "::" in envvar description
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-05 11:00:43 +10:00
Dave Reisner
de442b6867 bash_completion: add --noarchive to makepkg's completions
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-05 10:59:57 +10:00
Dave Reisner
167a598265 updpkgsums: avoid exec'ing awk, so the trap actually works
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-05 10:59:30 +10:00
Andrew Gregory
bd744d067d add pacman-db-upgrade-v9.py to check_SCRIPTS
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04 20:11:18 +10:00
Andrew Gregory
8cd41ec62b tests/pacman-db-upgrade-v9: set additional paths
--config does not respect root, causing pacman-db-upgrade to read the
local pacman.conf rather than the one in the test root.

Also add a rule to ensure the ALPM_DB_VERSION file is actually being
created.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04 20:11:18 +10:00
Andrew Gregory
4114e25df1 pmtest: make test paths easily available to tests
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04 20:11:18 +10:00
Andrew Gregory
1e0b2f6629 pacman-db-upgrade: fix --config option typo
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04 20:11:18 +10:00
Eric Schultz
566dc23357 Exit with 0/SUCCESS if there are no packages to remove
Previously the lack of candidate packages was considered an error
and return 1/FAILURE but really this isn't an issue. Also, for
systemd (and others) this flagged the instance as having failed
for no good reason.

Signed-off-by: Eric Schultz <eric@schultzter.ca>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-04 20:10:29 +10:00
Dave Reisner
75c80caebc makepkg.8: fix typo in reference to other flag
it's --syncdeps, not --syndeps
2014-10-19 21:36:19 +10:00
Andrew Gregory
82208c0239 testdb: ignore ALPM_DB_VERSION
Replaces the test for hidden files which appears to be leftover from
2e431e1cc before sync db checking was moved to a separate function.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-19 21:32:46 +10:00
Dave Reisner
9d4d81783d paccache: avoid spurious blank line written to stderr
this is just stylistic formatting, so write it to stdout.

ref: https://bugs.archlinux.org/task/42389

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-19 21:32:22 +10:00
Christian Hesse
d649dc669d dload: mark final_url as const
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-19 20:48:40 +10:00
Miguel de Val-Borro
91876c21f1 doc/translation-help.txt: Removed out-of-date paragraph
Signed-off-by: Miguel de Val-Borro <miguel@archlinux.net>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-19 20:48:18 +10:00
Miguel de Val-Borro
44bcb73327 doc/translation-help.txt: Minor rewording of Transifex usage
Updated as per Allan's suggestion and fixed Transifex URLs.

Signed-off-by: Miguel de Val-Borro <miguel@archlinux.net>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-19 20:48:08 +10:00
Dave Reisner
d6785a5726 makepkg: always look for sources in source=()
This regression snuck in during some reviewing of 963f7fe02f
(arch-specific sources). We must always check the source=() array for
sources.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-19 20:47:01 +10:00
Christian Hesse
d8f395fb56 dload: unlink file on filesize exceeded error
On filesize exceeded error pacman leaves a .part file in cache dir,
resulting in this error on next try:

error: failed to commit transaction (wrong or NULL argument passed)
Errors occurred, no packages were upgraded.

Unlink the file on error to avoid this.
2014-10-16 23:19:52 +10:00
Christian Hesse
11dff8a50e dload: use better error message on exceeded file size
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-16 23:19:52 +10:00
Christian Hesse
9d96bed9d6 be_sync: use effective URL for db file signature download
If download server is dynamic mirror chances are that db file download
and db file signature download are redirected to different mirrors,
resulting in invalid signature.
This uses effective URL for db file signature download and makes the
files always match.

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-16 22:45:47 +10:00
Dave Reisner
a0cfed7df2 makepkg: reorder args to pkgbuild_get_attribute for consistency
In all other cases, this code gets the outvalue from the final
parameter.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 23:22:09 +10:00
Andrew Gregory
627ede8779 add pacman-db-upgrade test
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 15:10:37 +10:00
Andrew Gregory
c1d6cec2e2 sync.c: download packages before starting commit
download_files sets the transaction state to STATE_DOWNLOADING.
Modifying the state after it has already been set to STATE_COMMITTING
created a brief window where SIGINT would fail to interrupt the process
and caused interrupted downloads to result in a 'transaction started'
message in the log with no matching transaction end.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-10-13 14:28:29 +10:00
Andrew Gregory
42c859e4cc pmtest: allow tests to specify test binary
Adds a cmd property to tests (defaults to pacman) which is resolved
using directories specified with --bindir (defaults to PATH).  The
ability to manually specify a particular binary is preserved in order to
allow running individual tests with differently named binaries such as
lt-pacman.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 12:54:29 +10:00
Andrew Gregory
01beca5df7 pacman: add --confirm option
--confirm cancels the effect of a previous --noconfirm.
This makes it easier for scripts to default to --noconfirm
but allow users to override it.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 12:54:29 +10:00
Andrew Gregory
7ddc967d7c pmtest: allow tests to specify db version
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 12:54:29 +10:00
Andrew Gregory
6dd593c293 pmrule: make backup file test more robust
This prevents an exception in the event backup entries are not in the
correct format and brings the test in line with alpm's backup parsing
which splits on the last tab rather than the first.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 12:54:29 +10:00
Andrew Gregory
19c3179b7e pmdb: include directories in package file lists
Needed for checking directories with PKG_FILES.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 12:54:29 +10:00
Dave Reisner
62c11e450a makepkg: simplify attr matching in extract_function_var
Interesting attributes created with 'local' or 'declare' won't be
surfaced in .PKGINFO, so we shouldn't try to look for them.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 12:54:26 +10:00
Dave Reisner
3f0303dc92 makepkg: show full fingerprint on pgp failure
Rather than implementing suffix matching, which might clash, let's just
print the full fingerprint of the err'ing key so that the user can
copy/paste it into validpgpkeys. Also, make it clear in the manpage
that validpgpkeys needs full fingerprints, and nothing else.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 12:54:19 +10:00
Dave Reisner
926d998a75 Revert "makepkg: allow less than the full fingerprint in validpgpkeys"
This reverts commit 50296576d0.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-13 12:54:09 +10:00
Allan McRae
faf0246437 There are not hooks!
Refer to install scripts as scripts and not hooks.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-10 10:02:05 +10:00
Andrew Gregory
5002227296 pacman-db-upgrade: do not mangle file lists
grep'ing out blank lines and sorting output thoroughly breaks any file
lists with %BACKUP% entries which must be separated from the file list
by a blank line.  Adds a custom function to ensure that all paths
printed are non-empty and unique.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-06 19:00:34 +10:00
Olivier Brunel
1e3c088c2e alpm: Fix wrong xferred/total sizes when resuming downloads
When a package is already partially downloaded in the cache, its download
size will only be of what's left to be downloaded. Since pkg->download_size
is what's used when calculating the total download size for the totaldl
callback, same thing apply.

However, the download progress callback was including this initial size,
which would thus lead to invalid values (and percentage) used in frontends.
That is, the progress bar could e.g. go further than 100%

In the case of pacman, there is a sanity check for different historical
reason (44a57c89), so before the possible "overflow" was noticed, the total
download size/progress reported was wrong. Once caught, the TotalDownload
option was ignored and it would use individual file download values as
fallback instead.

Signed-off-by: Olivier Brunel <jjk@jjacky.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-02 22:50:17 +10:00
Miguel de Val-Borro
ca8319aec9 doc/translation-help.txt: Remove link to tutorial on sarovar.org
The website sarovar.org has been shut down and the tutorial is
not relevant any more.

Signed-off-by: Miguel de Val-Borro <miguel@archlinux.net>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-10-02 22:40:17 +10:00