Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-04-05makechrootpkg: /chrootbuild: accept makepkg_args as arguments rather than ↵Luke Shumaker
embedding.
2017-04-05makechrootpkg: usage(): Display the actual default makepkg flags.Luke Shumaker
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 Shumaker
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 Shumaker
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 Shumaker
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 Shumaker
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 Shumaker
2017-04-05lib/common.sh: lock, slock: Create directories for locks if necessary.Luke Shumaker
2017-04-05lib/common.sh: lock, slock: Allow locks to be inherited.Luke Shumaker
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 Shumaker
`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)
2017-03-07archbuild/makechrootpkg: Delete subvolumes in rootsJan Alexander Steffens (heftig)
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)
2017-03-07lib/archroot.sh: Simplify check_rootJan Alexander Steffens (heftig)
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)
2017-03-07makechrootpkg: run makepkg as specified userAlad Wenter
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 Wenter
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)
2017-03-04makechrootpkg: fix potential non-writable directories of builduser in /buildLevente Polyak
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 Waa
2017-03-04lib: remove unused left, rightJelle van der Waa
2017-03-04makechrootpkg: Simplify symlink replacementJan Alexander Steffens (heftig)
2017-03-04makechrootpkg: Fix broken symlink because of temporary chroot PKGDEST /pkgdestNicoHood
2017-02-19Merge branch 'lukeshu/ng' into lukeshu/libretoolsLuke Shumaker
This is essentially merging the "archlinux" (upstream) branch. The "lukeshu/ng" branch is all of the changes on the "lukeshu/libretools" branch rebased on to "archlinux". I did this instead of a simple merge so that I wouldn't have to worry about the "big picture" when resolving conflicts; with rebasing I could look at each atomic change. Notable conflicts: - "makechrootpkg: _chrootprepare: Clean srcdest and startdir." I totally dropped this commit. The surrounding code was removed in upsteam commit ca819a235791 ("makechrootpkg: Simplify chroot preparation (v2)"). The change originated in libretools commit 564a4cfa06a8, but my commit message doesn't give any insight as to why I made that change. I've also scanned the issue tracker, and found no hints. So dropping this is a little scary; I don't know why I thought it was important in the first place. - "makechrootpkg, arch-nspawn: Force-enable local '/repo/' repository." I moved the code that force-updates `/var/lib/pacman/sync/repo.db from _chrootprepare() into prepare_chroot(). Other than that, conflicts were mostly just the context changing.
2017-02-19Merge branch 'lukeshu/libretools-to-upstream' into lukeshu/libretoolsLuke Shumaker
The 'lukeshu/libretools' branch is is all of the .patch files (and some edit scripts) from libretools.git being applied. The 'lukeshu/libretools-to-upstream' branch is all of these changes broken apart into atomic commits (i.e., suitable to be sent upstream). That is; they are two different patch-sets to get to the same tree.
2017-02-19lib/common.sh: Tidy formatting.Luke Shumaker
2017-02-19lib/common.sh: simplify include-guardLuke Shumaker
2017-02-19makechrootpkg: re-add "main" callLuke Shumaker
2017-02-19makechrootpkg: tidyLuke Shumaker
2017-02-19makechrootpkg: re-indentLuke Shumaker
2017-02-19mkarchroot: Use librelib rather than PATH to find arch-nspawn.Luke Shumaker
2017-02-19lib/common.sh: Discourage use in favor of libremessages.Luke Shumaker
2017-02-19checkpkg, find-libdeps, finddeps, lddd: Use libremessages to add help text.Luke Shumaker
2017-02-19lib/common.sh: Internationalize.Luke Shumaker
2017-02-19makechrootpkg: Avoid having code floating around outside of a function.Luke Shumaker
This means wrapping variable initialization in init_variables(), and the main program routine in main(). I did NOT put `shopt -s nullglob` in to a function.
2017-02-19makechrootpkg: Adjust to have the functions work with `set -u`.Luke Shumaker
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-02-19makechrootpkg, arch-nspawn: Force-enable local '/repo/' repository.Luke Shumaker
The change in arch-nspawn is subtle: This was the source of "infamous" "it fails every other time" bug that took me over a year to solve. <https://labs.parabola.nu/issues/435> By having a repository of local packages (rather than simply running `pacman -U`), we are inviting pacman to cache them in `/var/cache/pacman/pkg`. Besides being needless disk writes, this actually causes a real issue. If the package gets rebuilt, pacman will balk, as the file no longer matches the cached signature. So, how do we prevent pacman from caching these local packages? Simple: include the directory they are already in in the pacman.conf:CacheDir list. This will prevent pacman from copying the files to one of the other cache directories.
2017-02-19makechrootpkg: move_products: Mimic `makepkg` and symlink products into PWD.Luke Shumaker
2017-02-19makechrootpkg: _chrootbuild: Split into _chroot{prepare,build}.Luke Shumaker
2017-02-19makechrootpkg: Detect the chroottype in individual functions, not globally.Luke Shumaker
2017-02-19makechrootpkg: Have functions be more function-y.Luke Shumaker
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: - download_sources: Observation: if $SUDO_USER is set, then src_owner=$SUDO_USER. So (for clarity), rather than checking if $SUDO_USER is set, check if $src_owner is different than $USER. This reduces how much we have to worry about global state. - 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. - create_chroot->sync_chroot: 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.
2017-02-19makechrootpkg: Improve status messages.Luke Shumaker
2017-02-19makechrootpkg: Quote directory passed to `rm -rf`.Luke Shumaker
2017-02-19mkarchroot: Don't let the environment affect pacstrap (sans proxy settings).Luke Shumaker
A previous iteration of this change (libretools commit d7dcce53396d) simply inserted `env -i` to clear the environment. However, that lead to it ignoring proxy settings, which some users had problems with: https://labs.parabola.nu/issues/487: > To fix other bugs, the pacstrap environment is blank, which also > means that the proxy settings are blank. So (in libretools commit d17d1d82349f), I changed it to use `declare -x` to inspect the environment, and create a version of it only consisting of variables ending with "_proxy" (case-insensitive). I honestly don't remember what "other bugs" prompted me to clear the environment in the first place.
2017-02-19mkarchroot, arch-nspawn: Add an `-s` flag to inhibit `setarch`.Luke Shumaker
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-02-19mkarchroot, arch-nspawn: Add an `-f` flag to add files to copy.Luke Shumaker
This allows us to copy in files like `qemu-arm-static`, which is necessary for running an ARM chroot on an x86 box.
2017-02-19lib/common.sh: Make it safe to include multiple times.Luke Shumaker
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-02-19arch-nspawn: add a table of CARCH/setarch overrides (just armv7h->armv7lLuke Shumaker
for now)
2017-02-17mkarchroot: Set LANG=en_US.UTF-8Jan Alexander Steffens (heftig)
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-16Add a "License:" tag to all code files.Luke Shumaker