summaryrefslogtreecommitdiffstats
path: root/makechrootpkg.in
AgeCommit message (Collapse)AuthorFilesLines
2017-04-09makechrootpkg: Delete chroot subvols recursively when using -TJan Alexander Steffens (heftig)1-1/+1
I overlooked this one. Fixes FS#53513.
2017-04-05makechrootpkg: Unindent as suggested in 2fd5931Jan Alexander Steffens (heftig)1-19/+17
2017-04-05makechrootpkg: Improve status messages.Luke Shumaker1-3/+4
In sync_chroot(), this makes the messages be a bit more precise with exactly which thing they are syncing where. This is based on my users expressing confusion at what is going on (especially when something is taking a long time, and they have to blame something for blocking). With these changes, I haven't gotten such confusion in a long time (but maybe my users just got used to it). In delete_chroot(), this changes "temporary copy" to "chroot copy", since in Parabola's version of the tools, the function can get called from other places, and it isn't necessarily operating on a temporary copy.
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-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 Shumaker1-3/+3
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 Shumaker1-0/+2
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-05lib/common.sh: add 'lock_close'; use it as appropriate.Luke Shumaker1-1/+1
`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-07archbuild/makechrootpkg: Delete subvolumes in rootsJan Alexander Steffens (heftig)1-4/+2
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)1-5/+2
2017-03-07lib/archroot.sh: Simplify check_rootJan Alexander Steffens (heftig)1-3/+2
Move the function and save the orig_argv right along it.
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-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-04makechrootpkg: Simplify symlink replacementJan Alexander Steffens (heftig)1-2/+1
2017-03-04makechrootpkg: Fix broken symlink because of temporary chroot PKGDEST /pkgdestNicoHood1-0/+6
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-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-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-06-06makechrootpkg: verify sources before preparing chrootEvangelos Foutras1-2/+2
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-05-14fix handling of public keyringChristian Hesse1-1/+2
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-02-28handle gnupg 2.1.x public keyringChristian Hesse1-4/+5
2015-02-15makechrootpkg: keep all function defs togetherDave Reisner1-54/+54
2014-10-21makechrootpkg: treat makepkg_args as arrayDave Reisner1-8/+11
2014-10-21makechrootpkg: don't run namcap if makepkg failsDave Reisner1-1/+1
Fixes a regression introduced by 285a4e94cd, which made namcap a "compile time" option.
2014-10-20makechroot: die if we encounter an unexpected optionDave Reisner1-1/+1
2014-10-19save and reuse original argv when auto-elevatingDave Reisner1-2/+4
Fixes FS#42277.
2014-10-01makechrootpkg: make running namcap a "compile time" choiceDave Reisner1-14/+14
We don't need to pass _chrootbuild this information at runtime -- we can just generate the build script to do exactly what we want.
2014-10-01makechrootpkg: build as same UID as invokerDave Reisner1-9/+15
Changing UID to that of 'nobody' is arbitrary at best, and an information leak at worst. Let's just drop back to the same UID of the invoker.
2014-09-22makechrootpkg: Use the btrfs mountpoint/subvolume check consistently.Luke Shumaker1-1/+1
Commit 59e348fc3c5dd086331d884a6dd76fb43a92b7eb added a btrfs subvolume check, but only used it in create_chroot(); it missed clean_temporary().
2014-09-22makechrootpkg: use a simpler/safer expression with evalDave Reisner1-1/+1
2014-05-10Switch to root when started as regular userSébastien Luttringer1-1/+1
In collaborative builder machine, these scripts are often allowed to become root via sudo. This patch avoid to prefix them by sudo each time or call su. Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2014-05-10Update mtime of chroot when buildingJan Alexander Steffens (heftig)1-0/+3
Makes the chroot mtime a useful indicator of last usage. Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2014-05-10Remove broken unknown arguments check and fix usageJoel Teichroeb1-3/+2
If getopts comes across an unknown argument, $arg it set to '?' and $OPTARG is unset. Therefore the getopts line detecting unknown arguments doesn't work. Arguments to pass to makepkg are already handled by passing all the aguments after the end-of-options marker (--), but this wasn't documented in the usage text. Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-07FS#37656 - [devtools] add SRCPKGDEST to makechrootpkgMarkus M. May1-5/+16
Signed-off-by: Markus M. May <mmay@javafreedom.org> Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-07makechrootpkg: Don't copy the logpipeJan Alexander Steffens (heftig)1-0/+1
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-01Add support for building bzr packagesMaxime Gauduin1-6/+8
Fixes FS#36654: https://bugs.archlinux.org/task/36654. Signed-off-by: Maxime Gauduin <alucryd@gmail.com> Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-01Add mountpoint check to btrfs subvol logicWorMzy Tykashi1-1/+1
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-01makechrootpkg: Look harder for -R argumentDave Reisner1-5/+7
We shouldn't be in the business of reparsing makepkg's arguments, but since we have to treat the case of repackaging separately, do a better job of trying to find signs of it happening. This change lets you pass the longopt, --repackage, or multiple shortopts such as -RA, and still get the intended effect. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-19makechrootpkg: add generic support for additional bind mountsDave Reisner1-3/+15
Piggyback on systemd-nspawn's --bind and --bind-ro flags to allow arbitrary mount points to be added to the build container. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-08avoid injecting code into the format stringDave Reisner1-7/+7
Now that die() properly forwards arguments to error(), we can expect that the first arg is a format string and not the entirety of the output. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-05-25makechrootpkg: Add hack for svn sources and makepkg 4.1.1Jan Alexander Steffens (heftig)1-0/+11