1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00
Commit Graph

1297 Commits

Author SHA1 Message Date
Allan McRae
018fa2b48c Merge branch 'maint' 2015-01-12 15:23:30 +10:00
Allan McRae
a31426d3ea makepkg: clear destination array in array_build
If an already used array is passed array_build, some entries from the old
array could be carried over if the old array was longer than the new one.
Clear the destination array before adding elements to it to prevent this
issue.

Fixes: https://bugs.archlinux.org/task/43387

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-12 15:23:01 +10:00
Florian Pritz
f617b6acd4 makepkg-template: Remove linenumber/file from errors
die prints "at $scriptname line $linenumber." if the string does not
end with "\n". This information is not of much use for us and it makes
testing harder because we'd to remove it there.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-11 18:58:24 +10:00
Allan McRae
77ca6e4062 Merge branch 'maint' 2015-01-11 18:57:54 +10:00
Dave Reisner
fb9db2df5d makepkg: restore attr merging for write_pkginfo
acc639adf2 removed this, but shouldn't have.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-11 18:57:06 +10:00
Dave Reisner
83d5512bf1 makepkg: avoid nested quoting in string replacement
I suspect this is just wrong -- you never need to quote the replacement
side of a PE. In bash 4.3, this is essentially a no-op, but because of
a bug in bash 4.2, we get embedded quotes as a result of this
replacement. The relevant changelog item in bash is:

  Fixed a bug that caused single quotes that resulted from $'...' quoting
  in the replacement portion of a double-quoted ${word/pat/rep} expansion
  to be treated as quote characters.

But this doesn't apply to us. Let's just drop the excessive quoting...

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-11 18:56:57 +10:00
Allan McRae
9e5e86aa14 makepkg: fix removing static libraries when shared use absolute symlinks
When a shared library uses an absolute symlink for its its .so file, the check
if the shared version of a static library exists fails.  Test for the presence
of a broken symlink too.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-11 18:56:44 +10:00
Mohammad Alsaleh
95da285f56 pkgdelta: Use high compression options offered by xdelta3
* Add -9 which is the highest compression level.
 * Use lzma for secondary compression.

 Decompression speed is largely unaffected as most cycles are consumed
 by xz for re-compression.

 Some numbers:

 clang x86_64 [3.5.0-2.1 to 3.5.0-3]
 17.21MiB      default      (0.73)
 15.67MiB      -9           (0.67)
 13.59MiB      -9 -S djw    (0.58)
 12.01MiB      -9 -S lzma   (0.51)

 inkscape x86_64 [0.48.5-3 to 0.48.5-4]
 02.69MiB      default      (0.21)
 01.64MiB      -9           (0.13)
 01.30MiB      -9 -S djw    (0.10)
 01.01MiB      -9 -S lzma   (0.08)

Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-02 21:48:59 +10:00
Allan McRae
fafcbdeb8c Merge branch 'maint' 2015-01-02 21:43:56 +10:00
Dave Reisner
80e6d8a6fe makepkg: avoid expansion of var in arithmetic context
This bombs out when "$trusted" expands to the empty string. We're
better off passing the var by name and letting bash default to "0" when
the var is empty

Fixes: https://bugs.archlinux.org/task/43269

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-02 21:43:28 +10:00
Allan McRae
2759858e8c Merge branch 'maint' 2014-12-28 13:06:04 +10:00
Allan McRae
acc639adf2 Fix .SRCINFO output with architecture specific fields
Do not merge the architecture specific fields when creating a .SRCINFO file.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-28 13:05:41 +10:00
Dave Reisner
6356567ae0 makepkg: print the name of the source array being checked
I don't see an easy fix to avoid printing this more than once, so let's
at least differentiate the messaging so that it's more clear what's
going on.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:08:33 +10:00
Dave Reisner
7c0ff7f4b7 makepkg: call out the source array(s) missing checksums
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:08:33 +10:00
Dave Reisner
286dc83451 makepkg: fix typo in dep array name
We fixed this up to check architecture specific sources in ec679e09b2,
but fudged the array name in the in_array call.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-27 17:04:29 +10:00
Dave Reisner
d2d00e4543 makepkg: properly correlate checksums for multiple sources
Previously, we used a single boolean value to determine correlation of
sources to checksums. Since the introduction of arch-specific sources,
this is no longer sufficient, as we must ensure that we have checksums
for (potentially) multiple source arrays.

This change inlines the logic of have_sources to build an associative
array of source array names, unsetting them as we discover their
checksums. The error condition then becomes a non-empty correlation
array.

Fixes: https://bugs.archlinux.org/task/43192

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:15:38 +10:00
Peter Wu
a1c50a08c9 pacman-db-upgrade: set umask 022
This prevents the database from becoming inaccessible for non-root
users when the script was executed with a umask of 027.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:15:15 +10:00
Allan McRae
325e20dea1 makepkg: download sources for all architectures when making source package
We validated all sources when making a source package, whether or not they
are included in the tarball.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:15:00 +10:00
Allan McRae
23850c7c99 pacman-db-upgrade: be more verbose
People have mentioned that the silent upgrade to DB version 9 when no
adjustments are needed for directory symlinks is confusion.  Always print
the upgrading message.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-24 11:14:50 +10:00
Florian Pritz
c8448bb466 makepkg-template: Remove unused printf format string
I'm pretty sure this is some kind of left over stuff that was supposed
to print the filename, linenumber and line content. This is already
done so just remove it.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-22 14:01:43 +10:00
Allan McRae
ec679e09b2 Check architecture specific fields for VCS support
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-22 14:01:34 +10:00
Timothy Redaelli
91a56a7072 Fix double spaces in "Running %s as root is not allowed" message
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-21 16:26:45 +10:00
Allan McRae
54db3745d6 Update translations from transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-19 13:53:35 +10:00
Dave Reisner
0cd174efd5 makepkg: correctly add changelog files
Before this, we'd see bizzare behavior of:

  -> Adding changelog file (systemd.install)...

And, changelog files in the global section would not be added at all.

The code is clearly wrong here, as it references 'install' within a
loop of 'changelog' and 'install'. Let's use parameter indirection to
ensure that the proper file is identified and added.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-18 16:33:37 +10:00
Allan McRae
ed4032a908 pacman-db-upgrade: fix issue with find argument list length overflow
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-26 12:53:44 +10:00
Tobias Powalowski
41c8263ba2 pacman-key: compatibility with gnupg-2.1
GnuPG 2.1 no longer allow empty passphrases by default.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-21 20:54:58 +10:00
Allan McRae
3446453c72 Fix translation error and remove empty po files
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-19 14:13:15 +10:00
Allan McRae
193b2b33f8 Update po files to send to Transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 15:14:51 +10:00
Allan McRae
db402d6029 Pull translation updates from Transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-18 15:12:40 +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
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
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
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
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
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
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
Dave Reisner
50296576d0 makepkg: allow less than the full fingerprint in validpgpkeys
I found this feature confusing, and the documentation wasn't any help.
It was pointed out to me on IRC that validpgpkeys expects full
fingerprints, and won't accept shorter forms. This makes the
documentation insufficient, and the variable name itself misleading.

This patch bolsters the documentation to explain more about what the
contents should be, and implements suffix matching to allow matching on
shorters fingerprint suffices. Now, when makepkg tells you that a key
ID isn't valid, it's sufficient to manually check the key ID against
the known good ID, and add it as is to validpgpkeys.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-30 14:00:43 +10:00
Dave Reisner
60c1f2857b makepkg: move negation in inequality comparisons
This commit changes the few remaining instances of:

  [[ ! $foo = "$bar" ]]

to the more common:

  [[ $foo != "$bar" ]]

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-30 12:57:25 +10:00