Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/makechrootpkg.in
AgeCommit message (Collapse)Author
2017-11-24makechrootpkg.in: add "pacman-key --populate" before calling "makepkg" to be ↵v20171124archlinux32/v20171124Erich Eckner
sure to have a current pacman keyring
2017-10-30Merge remote-tracking branch 'upstream/master'Erich Eckner
2017-10-30Merge remote-tracking branch 'upstream/master'Erich Eckner
2017-10-30makechrootpkg: Fix function usage commentsLuke Shumaker
A couple of the comments noting which globals are used by functions are outdated/wrong. - download_sources() : Remove USER from the list. It was always wrong. Originally, it should have been SUDO_USER (not USER), but I should have removed it entirely in 4f23609. - move_products() : Add SRCPKGDEST to the list. Though the commit adding the comment was only recently upstreamed (as 2fd5931), it originated in 2013 in a commit that has since been rebased many times. Anyway, in this rebasing, it missed move_products() starting to pay attention to SRCPKGDEST in fd1be1b (since nothing made git think there was a "conflict").
2017-10-30makechrootpkg: move init_variables() to be part of main()Luke Shumaker
The reason it wasn't moved before was just to keep the diffs (with --ignore-all-space) smaller, to make merging and rebasing work easier. Moving code around in a file tends to make that difficult. But, readability wise, it belongs in main().
2017-10-19makechrootpkg: bend to allow running solely namcap via "*-build -- -- ↵v20171019archlinux32/v20171019Erich Eckner
--verifysource"
2017-09-15Merge remote-tracking branch 'upstream/master'Erich Eckner
2017-09-15Merge remote-tracking branch 'upstream/master'Erich Eckner
2017-09-14makechrootpkg: Reopen console to assign the CTTYJan Alexander Steffens (heftig)
nspawn does not give us a controlling terminal, hence we ignore interrupts. Apparently this was lost in systemd at some point. Hack around this by reopening the console to make it the controlling terminal.
2017-09-14makechrootpkg: Prevent collecting coredumpsJan Alexander Steffens (heftig)
Coredumps from build chroots are not generally useful. Prevent them from being generated. Avoids a lot of annoyance from the GCC testsuite spawning lots of systemd-coredump processes. Just set the soft limit so the user can still raise it in the PKGBUILD if they insist.
2017-08-25makechrootpkg: Also look for -e as --noextractJan Alexander Steffens (heftig)
2017-08-25makechrootpkg: Prevent removing build dir when --noextract specifiedMartchus
2017-08-24makechrootpkg: Also look for -e as --noextractJan Alexander Steffens (heftig)
2017-08-24makechrootpkg: Prevent removing build dir when --noextract specifiedMartchus
2017-08-14makechrootpkg.in: set correct ownership of WORKDIRv20170814archlinux32/v20170814Erich Eckner
2017-07-31remove empty tree if "--verifysource" failedErich Eckner
2017-07-14makechrootpkg: Skip integrity checks inside the chrootv20170714archlinux32/v20170714Jan Alexander Steffens (heftig)
We've already done these during download_sources().
2017-07-14makechrootpkg: Use long args for makepkgJan Alexander Steffens (heftig)
Slightly more verbose, but also more understandable.
2017-07-14makechrootpkg: Move makepkg-as-root check to main()Jan Alexander Steffens (heftig)
download_sources(), while the first invocation of makepkg, is a rather odd place for this kind of guard.
2017-07-14makechrootpkg: Fix broken symlinks because of chroot SRCPKGDEST /srcpkgdestLuke Shumaker
Commit 58968cf fixed symlinks for package products in $startdir in light of the simplified chroot setup. However, a similar change needs to be made for source-package products. This was an easy omission to make because makechrootpkg does not produce source-pakcages by default.
2017-07-14Add `# shellcheck` directives to quiet shellcheck, add PKGBUILD.protoLuke Shumaker
The added PKGBUILD.proto file is so that shellcheck can know know what to expect that a PKGBUILD sets.
2017-07-14Quote strings that shellcheck warns about.Luke Shumaker
These changes are all strictly "slap some double-quotes in there". Anything more than that is not included in this commit.
2017-07-14Make purely stylistic changes to make shellcheck happier.Luke Shumaker
These are purely stylistic changes that make shellcheck complain less. This does NOT include things like quoting currently unquoted variables.
2017-07-14makechrootpkg: Add a comment warning about a bug in "sudo -i"Luke Shumaker
The bug isn't currently triggered, but I accidentally did trigger when I was trying to modify the command a bit. I figure a "caution" sign would be helpful to any future developers.
2017-07-14makechroot: download_sources: Accept makepkg_owner as an argumentLuke Shumaker
What this is really doing is fixing a conflict that I had incorrectly resolved when rebasing what became 2fd5931 onto cda9cf4. Of course, because of dynamic scoping, everything worked out, and everything worked as intended. Before cda9cf4, it was appropriate for download_sources to take src_owner as an argument, but after cda9cf4, it is now appropriate to take makepkg_user as an argument. However, it still takes src_owner as an argument, but pays 0 attention to it; instead looking at makepkg_user which it happily inherited because of dynamic scoping. So change it to take makepkg_user as the argument.
2017-07-14makechrootpkg: sync_chroot: Make more general.Luke Shumaker
This is inspired by the thought that went in to the delete_chroot is_subvolume commit. sync_chroot($chrootdir, $copydir) copies `$chrootdir/root` to `$copydir`. That seems a little silly; why do we care about "$chrootdir"? Have it just be sync_chroot(source, destination) like every other sync/copy command. Where this becomes tricky is check to decide if we are going to use btrfs subvolumes or not. We don't care if "$source/.." is on btrfs; the root could be a directly-mounted subvolume, but and the destination could be another subvolume of the same btrfs mounted somewhere else. The things we do care about are: - The source is a btrfs subvolume (so that we can snapshot it) - The source is on the same filesystem as the directory that the copy will be created in. - If the destination exists: * that it is not a mountpoint (so that we can delete and recreate it) * that it is a btrfs subvolume (so that we can quickly delete it) On the last point, it isn't necessary for creating the new snapshot, just for quick deletion. That can be a separate check, where we use regular `rm` for deleting the existing copy, but use subvolume snapshots for creating the new one.
2017-07-14makechrootpkg: sync_chroot: make usage easier to understand.Luke Shumaker
Also, shorten the "Synchronizing" message to only include the full path to the copy if it was specified. The capslocked variable names in the Usage comment were references to things in Parabola's tools, that didn't make much sense here out of context.
2017-07-14makechrootpkg: delete_chroot: Fix the is-btrfs-subvolume check.Luke Shumaker
First of all, it ran `is_btrfs "$chrootdir"` to decide if it was on btrfs, but $chrootdir wasn't defined locally; it just happens to work because $chrootdir was defined in main(). (I noticed this because in Parabola, it is called differently, so $chrootdir was empty). So I was tempted to just change it to `is_btrfs "$copydir"`, but if $copydir is just a regular directory on a btrfs filesystem, then it It would leave much of $copydir intact. What we really care about is if $copydir is a btrfs subvolume; which we can check by combining the is_btrfs check with inspecting the inum of the directory. I put this combined check in lib/archroot.sh:is_subvolume. https://lists.archlinux.org/pipermail/arch-projects/2013-September/003901.html
2017-07-13makechrootpkg: Skip integrity checks inside the chrootJan Alexander Steffens (heftig)
We've already done these during download_sources().
2017-07-13makechrootpkg: Use long args for makepkgJan Alexander Steffens (heftig)
Slightly more verbose, but also more understandable.
2017-07-13makechrootpkg: Move makepkg-as-root check to main()Jan Alexander Steffens (heftig)
download_sources(), while the first invocation of makepkg, is a rather odd place for this kind of guard.
2017-07-05makechrootpkg: Fix broken symlinks because of chroot SRCPKGDEST /srcpkgdestLuke Shumaker
Commit 58968cf fixed symlinks for package products in $startdir in light of the simplified chroot setup. However, a similar change needs to be made for source-package products. This was an easy omission to make because makechrootpkg does not produce source-pakcages by default.
2017-07-05Add `# shellcheck` directives to quiet shellcheck, add PKGBUILD.protoLuke Shumaker
The added PKGBUILD.proto file is so that shellcheck can know know what to expect that a PKGBUILD sets.
2017-07-05Quote strings that shellcheck warns about.Luke Shumaker
These changes are all strictly "slap some double-quotes in there". Anything more than that is not included in this commit.
2017-07-05Make purely stylistic changes to make shellcheck happier.Luke Shumaker
These are purely stylistic changes that make shellcheck complain less. This does NOT include things like quoting currently unquoted variables.
2017-07-05makechrootpkg: Add a comment warning about a bug in "sudo -i"Luke Shumaker
The bug isn't currently triggered, but I accidentally did trigger when I was trying to modify the command a bit. I figure a "caution" sign would be helpful to any future developers.
2017-07-05makechroot: download_sources: Accept makepkg_owner as an argumentLuke Shumaker
What this is really doing is fixing a conflict that I had incorrectly resolved when rebasing what became 2fd5931 onto cda9cf4. Of course, because of dynamic scoping, everything worked out, and everything worked as intended. Before cda9cf4, it was appropriate for download_sources to take src_owner as an argument, but after cda9cf4, it is now appropriate to take makepkg_user as an argument. However, it still takes src_owner as an argument, but pays 0 attention to it; instead looking at makepkg_user which it happily inherited because of dynamic scoping. So change it to take makepkg_user as the argument.
2017-07-05makechrootpkg: sync_chroot: Make more general.Luke Shumaker
This is inspired by the thought that went in to the delete_chroot is_subvolume commit. sync_chroot($chrootdir, $copydir) copies `$chrootdir/root` to `$copydir`. That seems a little silly; why do we care about "$chrootdir"? Have it just be sync_chroot(source, destination) like every other sync/copy command. Where this becomes tricky is check to decide if we are going to use btrfs subvolumes or not. We don't care if "$source/.." is on btrfs; the root could be a directly-mounted subvolume, but and the destination could be another subvolume of the same btrfs mounted somewhere else. The things we do care about are: - The source is a btrfs subvolume (so that we can snapshot it) - The source is on the same filesystem as the directory that the copy will be created in. - If the destination exists: * that it is not a mountpoint (so that we can delete and recreate it) * that it is a btrfs subvolume (so that we can quickly delete it) On the last point, it isn't necessary for creating the new snapshot, just for quick deletion. That can be a separate check, where we use regular `rm` for deleting the existing copy, but use subvolume snapshots for creating the new one.
2017-07-05makechrootpkg: sync_chroot: make usage easier to understand.Luke Shumaker
Also, shorten the "Synchronizing" message to only include the full path to the copy if it was specified. The capslocked variable names in the Usage comment were references to things in Parabola's tools, that didn't make much sense here out of context.
2017-07-05makechrootpkg: delete_chroot: Fix the is-btrfs-subvolume check.Luke Shumaker
First of all, it ran `is_btrfs "$chrootdir"` to decide if it was on btrfs, but $chrootdir wasn't defined locally; it just happens to work because $chrootdir was defined in main(). (I noticed this because in Parabola, it is called differently, so $chrootdir was empty). So I was tempted to just change it to `is_btrfs "$copydir"`, but if $copydir is just a regular directory on a btrfs filesystem, then it It would leave much of $copydir intact. What we really care about is if $copydir is a btrfs subvolume; which we can check by combining the is_btrfs check with inspecting the inum of the directory. I put this combined check in lib/archroot.sh:is_subvolume. https://lists.archlinux.org/pipermail/arch-projects/2013-September/003901.html
2017-06-27makechrootpkg: put "keyserver-options auto-key-retrieve" into gpg.conf, so ↵v20170627archlinux32/v20170627Erich Eckner
"git verify-tag" downloads missing key(s)
2017-04-17makechrootpkg: 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. It make make sense to move init_variables() down into the main() function, instead of having it as a separate function up top (if this done, then the `-g` flag passed to `declare` in init_variables() can be dropped). However, in interest of keeping the `diff -w` small, and merges/rebases simpler, this isn't done here.
2017-04-09makechrootpkg: Delete chroot subvols recursively when using -TJan Alexander Steffens (heftig)
I overlooked this one. Fixes FS#53513.
2017-04-05makechrootpkg: Unindent as suggested in 2fd5931Jan Alexander Steffens (heftig)
2017-04-05makechrootpkg: Improve status messages.Luke Shumaker
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 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-04-05makechrootpkg: 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: - 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 Shumaker
2017-04-05makechrootpkg: Quote directory passed to `rm -rf`.Luke Shumaker
2017-04-05makechrootpkg: /chrootbuild: accept makepkg_args as arguments rather than ↵Luke Shumaker
embedding.