Commit Graph

157 Commits

Author SHA1 Message Date
Martchus d0e684d2e9
makechrootpkg: Prevent removing build dir when --noextract specified 2017-08-24 17:20:59 +02:00
Jan Alexander Steffens (heftig) 75fdff1811
makechrootpkg: Skip integrity checks inside the chroot
We've already done these during download_sources().
2017-07-13 19:43:52 +02:00
Jan Alexander Steffens (heftig) 0cbc179d21
makechrootpkg: Use long args for makepkg
Slightly more verbose, but also more understandable.
2017-07-13 19:42:01 +02:00
Jan Alexander Steffens (heftig) a8f512a665
makechrootpkg: Move makepkg-as-root check to main()
download_sources(), while the first invocation of makepkg, is a rather
odd place for this kind of guard.
2017-07-13 19:37:15 +02:00
Luke Shumaker 3efa4b7bf5
makechrootpkg: Fix broken symlinks because of chroot SRCPKGDEST /srcpkgdest
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-05 18:22:31 +02:00
Luke Shumaker a9dab95334
Add `# shellcheck` directives to quiet shellcheck, add PKGBUILD.proto
The added PKGBUILD.proto file is so that shellcheck can know know what
to expect that a PKGBUILD sets.
2017-07-05 18:21:56 +02:00
Luke Shumaker 78fabcfa06
Quote strings that shellcheck warns about.
These changes are all strictly "slap some double-quotes in there".
Anything more than that is not included in this commit.
2017-07-05 18:21:56 +02:00
Luke Shumaker 3f72579b28
Make purely stylistic changes to make shellcheck happier.
These are purely stylistic changes that make shellcheck complain less.

This does NOT include things like quoting currently unquoted variables.
2017-07-05 18:21:55 +02:00
Luke Shumaker 56cace32b2
makechrootpkg: Add a comment warning about a bug in "sudo -i"
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-05 18:21:55 +02:00
Luke Shumaker 4f23609d4e
makechroot: download_sources: Accept makepkg_owner as an argument
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-05 18:21:55 +02:00
Luke Shumaker 6d1992909c
makechrootpkg: sync_chroot: Make more general.
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-05 18:21:55 +02:00
Luke Shumaker 928744cbc4
makechrootpkg: sync_chroot: make usage easier to understand.
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-05 18:21:54 +02:00
Luke Shumaker 2a9b30ed35
makechrootpkg: delete_chroot: Fix the is-btrfs-subvolume check.
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-05 18:21:54 +02:00
Luke Shumaker 49088b0860
makechrootpkg: Avoid having code floating around outside of a function.
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-17 03:11:34 +02:00
Jan Alexander Steffens (heftig) a1f8ac9c70
makechrootpkg: Delete chroot subvols recursively when using -T
I overlooked this one. Fixes FS#53513.
2017-04-09 02:37:24 +02:00
Jan Alexander Steffens (heftig) 2243a276e4
makechrootpkg: Unindent as suggested in 2fd5931 2017-04-05 22:20:01 +02:00
Luke Shumaker 4228d79b63
makechrootpkg: Improve status messages.
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-05 22:17:51 +02:00
Luke Shumaker 35da846dde
makechrootpkg: Adjust to have the functions work with `set -u`.
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-05 22:17:51 +02:00
Luke Shumaker 2fd5931a8c
makechrootpkg: Have functions be more function-y.
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-05 22:17:51 +02:00
Luke Shumaker fb40b58772
makechrootpkg: install_pkg was an unused variable 2017-04-05 22:14:20 +02:00
Luke Shumaker f9d9db474a
makechrootpkg: Quote directory passed to `rm -rf`. 2017-04-05 22:14:20 +02:00
Luke Shumaker 253bb4c8d4
makechrootpkg: /chrootbuild: accept makepkg_args as arguments rather than embedding. 2017-04-05 22:14:19 +02:00
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 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) 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
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
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
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) 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) 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
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 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
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
Christian Hesse 4a9ecdfe15 handle gnupg 2.1.x public keyring 2015-02-28 10:48:06 -05:00
Dave Reisner 33fda4e8ff makechrootpkg: keep all function defs together 2015-02-15 15:20:26 -05:00
Dave Reisner 273d5a7a43 makechrootpkg: treat makepkg_args as array 2014-10-20 20:00:46 -04:00
Dave Reisner e5fe74102d makechrootpkg: don't run namcap if makepkg fails
Fixes a regression introduced by 285a4e94cd, which made namcap a
"compile time" option.
2014-10-20 19:15:24 -04:00
Dave Reisner 28140068ce makechroot: die if we encounter an unexpected option 2014-10-19 19:36:31 -04:00
Dave Reisner bf7dc83bab save and reuse original argv when auto-elevating
Fixes FS#42277.
2014-10-19 16:48:03 -04:00
Dave Reisner 285a4e94cd makechrootpkg: make running namcap a "compile time" choice
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-09-30 19:28:47 -04:00
Dave Reisner a78bdb841d makechrootpkg: build as same UID as invoker
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-30 19:28:47 -04:00
Luke Shumaker 12a1300694 makechrootpkg: Use the btrfs mountpoint/subvolume check consistently.
Commit 59e348fc3c added a btrfs subvolume
check, but only used it in create_chroot(); it missed clean_temporary().
2014-09-22 08:25:43 -04:00
Dave Reisner be00fcd47b makechrootpkg: use a simpler/safer expression with eval 2014-09-22 08:25:43 -04:00
Sébastien Luttringer 03611dc63e Switch to root when started as regular user
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-10 08:05:08 +02:00
Jan Alexander Steffens (heftig) 0b2ae245f1 Update mtime of chroot when building
Makes the chroot mtime a useful indicator of last usage.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2014-05-10 08:01:41 +02:00
Joel Teichroeb fdd079f3d5 Remove broken unknown arguments check and fix usage
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>
2014-05-10 08:00:56 +02:00
Markus M. May fd1be1b27a FS#37656 - [devtools] add SRCPKGDEST to makechrootpkg
Signed-off-by: Markus M. May <mmay@javafreedom.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-07 14:56:11 +01:00
Jan Alexander Steffens (heftig) 8ce6e29add makechrootpkg: Don't copy the logpipe
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-07 14:54:53 +01:00
Maxime Gauduin 4b3a6c7803 Add support for building bzr packages
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-01 20:30:52 +01:00
WorMzy Tykashi 59e348fc3c Add mountpoint check to btrfs subvol logic
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-01 20:28:17 +01:00
Dave Reisner 9974309cee makechrootpkg: Look harder for -R argument
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-11-01 18:38:07 +01:00
Dave Reisner e77242c539 makechrootpkg: add generic support for additional bind mounts
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-19 22:11:27 +02:00
Dave Reisner be3c71fa81 avoid injecting code into the format string
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-08-08 21:28:10 +02:00
Jan Alexander Steffens (heftig) 7a3f524201 makechrootpkg: Add hack for svn sources and makepkg 4.1.1 2013-05-25 16:55:53 +02:00
Jan Alexander Steffens (heftig) fc71be3479 makechrootpkg: Update comments to point out the bad hacks 2013-05-11 12:26:21 +02:00
Jan Alexander Steffens (heftig) 4937422fcf makechrootpkg: Split out chrootbuild into a function
Now syntax highlighting works properly! :D
2013-05-11 12:26:16 +02:00
Jan Alexander Steffens (heftig) 4dcdbcaf1e makechrootpkg: Ensure we have a writable PKGBUILD
For pkgver updates.
2013-05-06 01:51:06 +02:00
Jan Alexander Steffens (heftig) 7ca4eb82dd makechrootpkg: Avoid parsing PKGBUILD and support VCS sources
- Ensure sources are available before entering chroot
 - Bind STARTDIR and SRCDEST into the chroot read-only
 - Refactor makechrootpkg and introduce meaningful functions

Avoids copying stuff from/to the chroot as much as possible. With
VCS sources these copies can get quite expensive.
2013-05-03 08:48:14 +02:00
Jan Alexander Steffens (heftig) abba9f07a6 makechrootpkg: Remove add_to_db feature
I don't think this is much use in our common workflow. Our pacman
configs don't even make a reference to /repo.
2013-05-03 04:34:29 +02:00
Jan Alexander Steffens (heftig) a7a05deb37 lib/common.sh: Introduce locking helper functions
Reduces code duplication.

With makechrootpkg not calling mkarchroot anymore,
the lock handover protocol is unneeded.

arch-nspawn does not do any locking, so add protection to archbuild.
2013-05-03 04:34:29 +02:00
Jan Alexander Steffens (heftig) 453558c4bb mkarchroot: Refactor chroot running into a new script
Separates the two features of mkarchroot. Provides users of the new
arch-nspawn with the full feature set of systemd-nspawn.

For example, this can be used to bind custom directories into the chroot.
2013-05-02 10:33:24 +02:00
Sébastien Luttringer 93d735981b makechrootpkg: Add option to build in temp chroot
Add option -T to build in a temporary chroot. This apply to any kind of
filesytem and allow to easily parrallelize builds.

This patch also simplify how $default_copy and $copy are defined.

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-04-08 14:30:45 +02:00
Sébastien Luttringer 35dc7485fb makechrootpkg: Stat chrootdir type after existancy
Move detection of chrootdir type after have check if the directory exists.

This avoid the following messages when -r is not given
stat: cannot read file system information for '': No such file or directory

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-03-17 11:24:04 +01:00
Sébastien Luttringer 89bda9217d archbuild: only use base-devel to new chroot
Since TODO [1] which state:
It would be good for base-devel to install everything needed for a build chroot
we can remove base and sudo

[1] https://www.archlinux.org/todo/add-more-to-base-devel/

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-03-17 11:23:24 +01:00
Sébastien Luttringer 0dc2550af3 makechrootpkg: use var instead of file in $copydir
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-03-10 10:33:58 +01:00
Sébastien Luttringer 0c62649b64 makechrootpkg: Properly detect filesystem type
Enable btrfs features only if the underlying filesystem is btrfs and not rely
on the presence of the btrfs tools.

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-03-10 10:33:58 +01:00
Sébastien Luttringer b807c51102 makechrootpkg: Display uniform $copy in messages
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-03-10 10:33:58 +01:00
Sébastien Luttringer 280d5501b0 makechrootpkg: -I to handle multiple packages
Since commit cb3a6ce, running makechroot 2 times to insert a package in a build
directory require to find a directory without PKGBUILD

cd /var/empty
makechrootpkg -cu -I virtualbox-host-dkms-*-i686.pkg.tar.xz -r <dir>
makechrootpkg -I virtualbox-host-dkms-*-i686.pkg.tar.xz -r <dir>
cd -
makechrootpkg -n -r <dir>

This patch allow makechrootpkg to handle more than one package to be installed
before the build is run and simplify the previous case in

makechrootpkg -ncu -I virtualbox-host-dkms-*-i686.pkg.tar.xz -I virtualbox-guest-dkms-*-i686.pkg.tar.xz -r <dir>

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-03-10 10:33:58 +01:00
Sébastien Luttringer cb3a6ce1e8 -I ends early if there is nothing to build
This allow to build in one shot a package depending of a missing package

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-01-20 10:21:39 +01:00
Eric Bélanger 890baf6891 Make sure the usage functions are consistent
The usage messages now begins with a "Usage:", i.e. capitalized and with a colon. Fixes FS#26956.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-11-15 15:25:07 +01:00
Jan Alexander Steffens (heftig) fbb2bd2b8e Fix return code handling
Stop trap_exit from forcing a 0 exit code. This fixes makechrootpkg,
which used to always return success, even if the build failed.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-10-27 20:27:39 +02:00
Pierre Schmitz a26416dca3 makechrootpkg: do not run namcap as root 2012-10-03 12:32:55 +02:00
Florian Pritz dbef0b91bf Fix ownership when copying files from chroot to system
Previously files were always owned by nobody which means trying to write
to them directly would fail because only the owner has +w.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-09-14 16:01:01 +02:00
Pierre Schmitz c7cda47342 Enable signature checking within build environment
* bind /sys and /dev/pts from host
* drop support for devtmpfs as it is no longer needed
* add /run and /dev/rtc0
* clone own ipc, uts and mount namespaces for chroot
* set localtime, timezone and locale within chroot environment
* copy /etc/pacman.d/gnupg from host
2012-06-11 16:44:23 +02:00
Pierre Schmitz 181646d03b makechrootpkg: Install the built packages before running namcap to reduce false positives and check inter split package dependencies. 2012-03-05 16:28:09 +01:00
Allan McRae a8b64995ee makechrootpkg: fix error message
Passing a directory that does not exist to makechrootpkg results in
an error message:

==> ERROR: No chroot dir defined, or invalid path ''

The path is not being printed as the readlink command blanks it if
the directory does not exist. Fix this.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:52 +01:00
Jan Alexander Steffens (heftig) 2c9855fe6b Fix up usage help, the Default line belongs to -l
Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:52 +01:00
Allan McRae 58d0ccc4f8 makearchroot: source /etc/profile before building
This ensures the PATH used when building is the default path and
not the value set by the user calling makechrootpkg.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-12-04 18:04:47 +01:00
Ionut Biru a628c1a006 makechrootpkg: fix repack
repack is defined as a boolean. set it true when -R is passed

/usr/sbin/makechrootpkg: line 295: 1: command not found

Signed-off-by: Ionut Biru <ibiru@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-09 20:32:29 +01:00
Pierre Schmitz bf96c9f949 makechrootpkg: Create separate namcap log for every single file 2011-11-06 10:31:37 +01:00
Eric Bélanger 42d821ef7b Capitalize output messages
Some of the output/error messages were capitalized, some were
not. This patch capitalize everything for consistency sake. Other
minor changes were done to the messages like removing the superfluous
"error:" from die messages and adding a final period to messages that
were complete sentences as appropriate.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:33:29 +01:00
Pierre Schmitz aaa68e49e8 Move common functions to a shared file
* common.sh is included on build time
* most functions are copied from makepkg
2011-11-01 15:33:08 +01:00
Pierre Schmitz a06ac2451a makechrootpkg: Handle install and changelog file the same way as in commitpkg 2011-10-31 12:43:16 +01:00
Pierre Schmitz fbdcf6e309 makechrootpkg: Do not export LANG
This is done by /etc/profile.d/locale.sh. By this we also ensure compatibility with systemd.
2011-10-31 12:02:46 +01:00
Pierre Schmitz 86045b965e makechrootpkg: Make host pubring.gpg available to check signed sources 2011-10-29 20:37:28 +02:00
Pierre Schmitz 521c4ceec3 makechrootpkg: Set the C locale system wide
makepkg sources /etc/profile before calling build(). This will change the
locale from C to en_US.UTF8.
2011-10-29 13:05:09 +02:00
Pierre Schmitz 5c6c2d532e makechrootpkg: Avoid running namcap on non-package file like signatures
We only use .xz or .gz compression for pacakges so we can be more specific and avoid a match of e.g. *.pkg.tar.xz.sig etc.
2011-10-14 09:35:39 +02:00
Allan McRae a991c9a71f Always log builds in makechrootpkg
It is very helpful to always log the build output in makechrootpkg
so pass "-L" as a standard option to makepkg.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:04 +02:00
Jan Alexander Steffens (heftig) a790c39c7d makechrootpkg: If chroot is missing, exit instead of usage
I'm not sure why this was handled differently than the other
error conditions.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:04 +02:00
Jan Alexander Steffens (heftig) e66a1f3cd8 makechrootpkg: Add option to explicitly run namcap
Installs namcap if needed, *after* building the package,
contrary to the former way of having to have namcap installed,
e.g. via makedepends.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:03 +02:00