summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-04-05mkarchroot, arch-nspawn: Add an `-s` flag to inhibit `setarch`.Luke Shumaker2-2/+9
This allows us to run an ARM chroot on an x86 box; as the binfmt runner will set the architecture for us, and the x86 `/usr/bin/setarch` program won't know about the ARM architecture string.
2017-04-05mkarchroot, arch-nspawn: Add an `-f` flag to add files to copy.Luke Shumaker2-2/+21
This allows us to copy in files like `qemu-arm-static`, which is necessary for running an ARM chroot on an x86 box.
2017-04-05makechrootpkg: Adjust to have the functions work with `set -u`.Luke Shumaker1-4/+4
Even though main() doesn't call `set -u`; this way the functions will continue to work if copied into an environment with `set -u`, or so that we are ready if we ever want to start using `set -u`.
2017-04-05makechrootpkg: Have functions be more function-y.Luke Shumaker1-13/+75
Rather than them simply being named blocks of code with braces around them. That is: have them take things via arguments rather than global variables. Specific notes: - create_chroot->sync_chroot: I pulled out locking the destination chroot; getting that lock is now the caller's responsibility. It still handles locking the source chroot though. I pulled the `if [[ ! -d $copydir ]] || $clean_first;` check out; it is now the caller's responsibility to use that check when deciding if to call sync_chroot. However, when pulling that check out, I left it as `if true;`, to keep an indentation level. This patch has had to be rebased/merged many times, and changing the indentation is a sure way to make that go less smoothly; I'm not going to re-indent this block until I see the check removed in the git.archlinux.org/devtools.git repository. - install_packages: 1. Receive the list of packages as arguments, rather than a global variable. 2. Make the caller responsible for looking at PKGBUILD. From the name and arguments, one would never expect it to look at PKGBUILD.
2017-04-05Handle makepkg.conf more consistentlylukeshu@parabola.nu3-4/+15
2017-04-05lib/common.sh: Make it safe to include multiple times.Luke Shumaker1-0/+3
This is similar to common C #ifdef guards. I was tempted to wrap the entire thing in the if/fi, rather than use 'return' to bail early. However, that means it won't execute anything until after it reaches 'fi'. And if `shopt -s extglob` isn't executed before parsing, then it will syntax-error on the extended globs. One solution would have been to move `shopt -s extglob` up above the include-guard. But the committed solution is all-around simpler.
2017-04-05lib/common.sh: Adjust to work properly with `set -u`.Luke Shumaker1-3/+4
2017-04-05makechrootpkg: install_pkg was an unused variableLuke Shumaker1-1/+0
2017-04-05makechrootpkg: Quote directory passed to `rm -rf`.Luke Shumaker1-1/+1
2017-04-05makechrootpkg: /chrootbuild: accept makepkg_args as arguments rather than ↵Luke Shumaker1-4/+2
embedding.
2017-04-05makechrootpkg: usage(): Display the actual default makepkg flags.Luke Shumaker1-2/+3
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-05Avoid using string interpolation; use printf format strings instead.Luke Shumaker12-38/+38
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-05Add a "License:" tag to all code files.Luke Shumaker19-0/+24
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-05commitpkg: Adjust fancy quoting/escaping to not confuse Emacs.Luke Shumaker1-1/+1
It was confusing Emacs and screwing up the syntax highlighting and auto-indentation for the rest of the file.
2017-04-05Add '#!/hint/bash' headers to non-executable bash files.Luke Shumaker4-0/+8
This provides a cross-editor hint that the syntax of the file is Bash.
2017-04-05lib/common.sh: Make setup_workdir()/cleanup() safe for programs to not useLuke Shumaker1-4/+7
2017-04-05lib/common.sh: lock, slock: Create directories for locks if necessary.Luke Shumaker1-0/+2
2017-04-05lib/common.sh: lock, slock: Allow locks to be inherited.Luke Shumaker1-2/+10
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-05lib/common.sh: add 'lock_close'; use it as appropriate.Luke Shumaker3-2/+10
`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-03-20Version 2017032020170320Jan Alexander Steffens (heftig)1-1/+1
2017-03-07archbuild/makechrootpkg: Delete subvolumes in rootsJan Alexander Steffens (heftig)3-7/+23
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-07lib/archroot.sh: Add is_btrfs helperJan Alexander Steffens (heftig)4-7/+12
2017-03-07lib/archroot.sh: Simplify check_rootJan Alexander Steffens (heftig)6-24/+19
Move the function and save the orig_argv right along it.
2017-03-07lib/archroot.sh: Move CHROOT_VERSION to a common fileJan Alexander Steffens (heftig)3-4/+3
2017-03-07makechrootpkg: run makepkg as specified userAlad Wenter1-6/+10
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-07makechrootpkg: explain load_varsAlad Wenter1-0/+4
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-04Version 2017030420170304Jan Alexander Steffens (heftig)1-1/+1
2017-03-04makechrootpkg: fix potential non-writable directories of builduser in /buildLevente Polyak1-1/+0
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-04lib: remove unused version, pkgpartsJelle van der Waa1-1/+1
2017-03-04lib: remove unused left, rightJelle van der Waa1-2/+0
2017-03-04makechrootpkg: Simplify symlink replacementJan Alexander Steffens (heftig)1-2/+1
2017-03-04makechrootpkg: Fix broken symlink because of temporary chroot PKGDEST /pkgdestNicoHood1-0/+6
2017-02-17mkarchroot: Set LANG=en_US.UTF-8Jan Alexander Steffens (heftig)2-3/+3
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.
2016-10-08makechrootpkg: Reset environment for builduserJan Alexander Steffens (heftig)1-3/+1
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-06-13makechrootpkg: Shorten user-config loading codeJan Alexander Steffens (heftig)1-6/+1
Make use of load_vars returning 1 when the file is missing. Avoids introducing another variable.
2016-06-13makechrootpkg: Use XDG_CONFIG_HOME for makepkg.confJohannes Löthberg1-1/+6
Implemented the same way as in makepkg. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2016-05-28Version 2016052820160528Jan Alexander Steffens (heftig)1-1/+1
2016-05-28arch-nspawn: Work around pacman master returning file-URLs from the cacheJan Alexander Steffens (heftig)1-1/+1
2016-05-28makechrootpkg: Install packages in one stepJan Alexander Steffens (heftig)1-11/+8
Avoids having to specify them in dependency order.
2016-05-28makechrootpkg: Simplify chroot preparation (v2)Jan Alexander Steffens (heftig)1-101/+43
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-28Merge branch 'master' of git.archlinux.org:/srv/git/devtoolsPierre Schmitz6-7/+10
2016-05-27This is 20160527.120160527.1Sven-Hendrik Haase1-1/+1
2016-05-27mkarchroot: Manually generate machine-id because nspawn expects itSven-Hendrik Haase1-0/+2
2016-05-27Makefile: change version to 20160527Sven-Hendrik Haase1-1/+1
2016-05-27Use repos.archlinux.org everywhere instead of hostname based domains20160527Sven-Hendrik Haase5-6/+7
This makes it a lot easier to swap out the host that actually serves the repos in the future.
2016-05-07Set target vendor to pc for usge with gcc 6Pierre Schmitz1-1/+1
2016-02-07Update bundled pacman and makepkg configurationPierre Schmitz10-4/+14
2016-01-09makechrootpkg: set builduser's shell to /bin/bashEvangelos Foutras1-1/+1
Having it set to nologin breaks a couple of tests in Git and Python.
2016-01-09makechrootpkg: use /build as HOME for the builduserLevente Polyak1-1/+1
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.)
2015-11-29Bump version to 2015112920151129Evangelos Foutras1-1/+1