Commit Graph

864 Commits

Author SHA1 Message Date
Luke Shumaker 189efd3bc0
makechrootpkg: usage(): Display the actual default makepkg flags.
It was displaing the value of the `makepkg_args` variable, which may
have already been changed by the argument parsing by the time it gets
to `-h`.  Now there is a separate `default_makepkg_args` variable.
2017-04-05 22:14:19 +02:00
Luke Shumaker cb35d74f8c
Avoid using string interpolation; use printf format strings instead.
This involves extending the signature of lib/common.sh's `stat_busy()`,
`lock()`, and `slock()`. The `mesg=$1; shift` in stat_busy even suggests
that this is what was originally intended from it.
2017-04-05 22:11:16 +02:00
Luke Shumaker 14d5e1c21b
Add a "License:" tag to all code files.
In cases where there is no license specified, the file is tagged as
"License: Unspecified".  Obviously, that is not ideal, but it
highlights the fact, and I hope that it encourages whoever has the
authority to specify the license to do so.

On that note, to anyone who may have the authority to specify the
license of files in devtools: the current licence of many files is
GPLv2 with no option for later versions; I impore you to re-license
them to have the "or any later version" option.
2017-04-05 22:10:03 +02:00
Luke Shumaker ae82f88e51
commitpkg: Adjust fancy quoting/escaping to not confuse Emacs.
It was confusing Emacs and screwing up the syntax highlighting and
auto-indentation for the rest of the file.
2017-04-05 22:10:03 +02:00
Luke Shumaker f55786b7a8
Add '#!/hint/bash' headers to non-executable bash files.
This provides a cross-editor hint that the syntax of the file is Bash.
2017-04-05 22:10:03 +02:00
Luke Shumaker 8ff247de13
lib/common.sh: Make setup_workdir()/cleanup() safe for programs to not use 2017-04-05 22:03:00 +02:00
Luke Shumaker d4f09b2c7b
lib/common.sh: lock, slock: Create directories for locks if necessary. 2017-04-05 22:03:00 +02:00
Luke Shumaker d333440810
lib/common.sh: lock, slock: Allow locks to be inherited.
Allow for locks to be inherited.  Inheriting the lock is something that
mkarchroot could do previously, but has since lost the ability to do.  This
allows for the programs to be more compos-able.

Do this by instead of unconditionally opening $file on $fd, first check if
$file is already open on $fd; and go ahead use it if it is.

The naive way of doing this would be to `$(readlink /dev/fd/$fd)` and
compare that to `$file`.  However, if `$file` is itself a symlink; or there
is a symlink somewhere in the path to `$file`, then this could easily fail.
Instead, check `[[ "/dev/fd/$fd" -ef "$file" ]]`.  Even though the Bash
documentation (`help test`) says that `-ef` checks for if the two files are
hard links to eachother, because it uses stat(3) (which resolves symlinks)
to do this check, it also works with the /dev/fd/ soft links.
2017-04-05 22:03:00 +02:00
Luke Shumaker 997bc1dc0d
lib/common.sh: add 'lock_close'; use it as appropriate.
`lock_close FD` is easier to remember than 'exec FD>&-`; and is especially
easier if FD is a variable (though that isn't actually taken advantage of
here).

This uses Bash 4.1+ `exec {var}>&-`, rather than the clunkier
`eval exec "$var>&-"` that was necessary in older versions of Bash.
Thanks to Dave Reisner for pointing this new bit of syntax out to me
the last time I submitted this (back in 2014, 4.1 had just come out).
2017-04-05 22:03:00 +02:00
Jan Alexander Steffens (heftig) f73c1f172f
Version 20170320 2017-03-20 19:23:50 +01:00
Jan Alexander Steffens (heftig) eec7fcf965
archbuild/makechrootpkg: Delete subvolumes in roots
The systemd package creates a subvolume at /var/lib/machines (through
tmpfiles), if it can. We need to delete this subvolume before we can
delete the parent subvolume.

Look through the root for inodes with the number 256. These identify
subvolume roots.
2017-03-07 20:39:11 +01:00
Jan Alexander Steffens (heftig) c53a3e8017
lib/archroot.sh: Add is_btrfs helper 2017-03-07 20:37:54 +01:00
Jan Alexander Steffens (heftig) 45f87aa9d5
lib/archroot.sh: Simplify check_root
Move the function and save the orig_argv right along it.
2017-03-07 19:35:09 +01:00
Jan Alexander Steffens (heftig) 66553e7e07
lib/archroot.sh: Move CHROOT_VERSION to a common file 2017-03-07 19:35:09 +01:00
Alad Wenter cda9cf436b
makechrootpkg: run makepkg as specified user
makepkg --asroot was removed with pacman 4.2. Allow to specify a
separate makepkg user from the command line instead.

Fixes FS#43432
2017-03-07 19:02:21 +01:00
Alad Wenter 06c98c1b54
makechrootpkg: explain load_vars
The way in which makechrootpkg reads variables from makepkg.conf(5) is
different from makepkg, in that it reads a subset of defined
variables, and only if the were not set in the environment before.

Mention this in the usage text.

Fixes FS#44827
2017-03-07 19:02:21 +01:00
Jan Alexander Steffens (heftig) e10ce7fc70
Version 20170304 2017-03-04 15:10:11 +01:00
Levente Polyak ff48401963
makechrootpkg: fix potential non-writable directories of builduser in /build
This removes the preservation of HOME being /build just for the pacman
sudo call. Former leads to unbuildable packages when an to be installed
dependency writes something into the HOME dir (f.e. .config). The
resulting directories won't be writable by the builduser as they are
owned by root:root and ultimately will fail to build anything that
requires so.
2017-03-04 15:05:09 +01:00
Jelle van der Waa 15f16162fb
lib: remove unused version, pkgparts 2017-03-04 15:03:37 +01:00
Jelle van der Waa fea14fa286
lib: remove unused left, right 2017-03-04 15:03:05 +01:00
Jan Alexander Steffens (heftig) 4bafd641ab
makechrootpkg: Simplify symlink replacement 2017-03-04 15:00:50 +01:00
NicoHood 58968cfaa2
makechrootpkg: Fix broken symlink because of temporary chroot PKGDEST /pkgdest 2017-03-04 15:00:12 +01:00
Jan Alexander Steffens (heftig) c8147a3512
mkarchroot: Set LANG=en_US.UTF-8
In order to have an UTF-8 locale in the build root. This is something
normally set on real machines but is not set from our chroots. Meson,
for example, loudly complains when the locale charset is not UTF-8.

I'd like to have C.UTF-8, as most other distributions do. Unfortunately,
it's not part of vanilla glibc; en_US.UTF-8 will have to do.

mkarchroot already creates roots with both en_US.UTF-8 and de_DE.UTF-8,
the latter because builds of gcc (perhaps used to) require it.

Bump the CHROOT_VERSION due to the setting change.
2017-02-17 19:51:56 +01:00
Jan Alexander Steffens (heftig) 76dec8507e
makechrootpkg: Reset environment for builduser
The gnustep-base package ships a profile.d script that adds
"$HOME/GNUstep/Tools" to the PATH, which breaks when the user changes
and causes meson to exit with a "permission denied" error.
2016-10-08 14:44:31 +02:00
Jan Alexander Steffens (heftig) 9727b684e6 makechrootpkg: Shorten user-config loading code
Make use of load_vars returning 1 when the file is missing. Avoids
introducing another variable.
2016-06-13 00:06:54 +02:00
Johannes Löthberg e3fe7134e2 makechrootpkg: Use XDG_CONFIG_HOME for makepkg.conf
Implemented the same way as in makepkg.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2016-06-13 00:02:29 +02:00
Jan Alexander Steffens (heftig) 70d3c63b5c Version 20160528 2016-05-28 17:52:56 +02:00
Jan Alexander Steffens (heftig) eb6b0e3f11 arch-nspawn: Work around pacman master returning file-URLs from the cache 2016-05-28 12:33:00 +02:00
Jan Alexander Steffens (heftig) 69a3a0e7c0 makechrootpkg: Install packages in one step
Avoids having to specify them in dependency order.
2016-05-28 12:30:36 +02:00
Jan Alexander Steffens (heftig) ca819a2357 makechrootpkg: Simplify chroot preparation (v2)
Copy both UID and primary GID of the invoker to the builduser. Mount
srcdest and startdir read-write.

v2: Fixed GnuPG keyring owner and moved running namcap from a heredoc
    to a function.
2016-05-28 12:30:36 +02:00
Pierre Schmitz eb88a303b7 Merge branch 'master' of git.archlinux.org:/srv/git/devtools 2016-05-28 10:09:45 +02:00
Sven-Hendrik Haase 8f94d8118f This is 20160527.1 2016-05-27 22:17:02 +02:00
Sven-Hendrik Haase 882f5d0451 mkarchroot: Manually generate machine-id because nspawn expects it 2016-05-27 22:16:09 +02:00
Sven-Hendrik Haase f36c45e0c6 Makefile: change version to 20160527 2016-05-27 21:11:46 +02:00
Sven-Hendrik Haase 7fc22b9aba Use repos.archlinux.org everywhere instead of hostname based domains
This makes it a lot easier to swap out the host that actually serves the repos in the future.
2016-05-27 21:02:46 +02:00
Pierre Schmitz 7fe0f68856 Set target vendor to pc for usge with gcc 6 2016-05-07 10:53:48 +02:00
Pierre Schmitz f85fc32d78 Update bundled pacman and makepkg configuration 2016-02-07 10:12:56 +01:00
Evangelos Foutras c5128dc45c makechrootpkg: set builduser's shell to /bin/bash
Having it set to nologin breaks a couple of tests in Git and Python.
2016-01-09 12:00:21 +02:00
Levente Polyak f1effdf989 makechrootpkg: use /build as HOME for the builduser
This way the HOME dir is writable and no ugly hacks are required
in the PKGBUILD if $HOME is accessed (f.e. maven, gradle and also
some python tests etc.)
2016-01-09 11:59:44 +02:00
Evangelos Foutras 38957783a2 Bump version to 20151129 2015-11-29 12:06:58 +02:00
Evangelos Foutras 5a7890f076 arch-nspawn: preserve systemd-nspawn's stderr
It is passed down to the container when stdin/stdout is not a tty; this
is the case when archbuild's output is redirected to a pipe or file.
2015-11-29 12:01:34 +02:00
Evangelos Foutras ba45e06d3e Bump version to 20151002 2015-10-02 15:02:45 +03:00
Evangelos Foutras 393b9757cf Sync makepkg.conf files with pacman 4.2.1-4 2015-10-02 14:59:52 +03:00
Jan Alexander Steffens (heftig) 3231cf8c36 Layer gnome-unstable above staging, not testing 2015-09-25 14:37:20 +03:00
Evangelos Foutras f5ef88ec59 Bump version to 20150606 2015-06-06 15:27:00 +03:00
Evangelos Foutras 80ba87881a makechrootpkg: verify sources before preparing chroot
This is needed in order to use GPG's auto-key-retrieve keyserver option,
otherwise the keyring will get copied to the chroot before the required
keys are retrieved during 'makepkg --verifysource'.
2015-06-06 15:22:51 +03:00
Johannes Löthberg 763d8ffb53 commitpkg: Force unarmored signatures
Pacman cannot handle armored signatures, so force a generation of a
binary one using the --no-armor flag.
2015-06-06 15:22:33 +03:00
Pierre Schmitz a1594ae1f6 Prepare release 2015-05-14 10:38:49 +02:00
Christian Hesse 49ad7e6dbe fix handling of public keyring
Chances are that pubring.kbx has been created by gpgsm but pubring.gpg
is still around with valid data. We do not know what file contains what
we need, so just copy both.

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2015-05-14 10:36:24 +02:00
Dave Reisner 85705363cd prepare 20150228 release 2015-02-28 10:53:37 -05:00