Compare commits

...

674 Commits

Author SHA1 Message Date
Bartłomiej Piotrowski
2a308821b3 Version 20171108 2017-11-08 14:23:26 +01:00
Bartłomiej Piotrowski
7259e7def0 Remove i686 support 2017-11-08 14:22:56 +01:00
Luke Shumaker
94160d62b8 use makepkg library instead of local function copies
This mirrors dbscripts commit
625fa02 by Pierre Schmitz <pierre@archlinux.de> at 2017-04-18 14:20:49
2017-10-30 16:03:15 +01:00
Luke Shumaker
095e5305e4 makechrootpkg: Fix function usage comments
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-30 15:59:38 +01:00
Luke Shumaker
e4db687d10 makechrootpkg: move init_variables() to be part of main()
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-30 15:59:05 +01:00
Jan Alexander Steffens (heftig)
ddd508efc0 makechrootpkg: Reopen console to assign the CTTY
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-14 23:33:47 +02:00
Jan Alexander Steffens (heftig)
0f3778c3d3 makechrootpkg: Prevent collecting coredumps
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-09-14 23:31:36 +02:00
Jan Alexander Steffens (heftig)
6b55282bd7 Revert "arch-nspawn: Hack to give the inner process a controlling terminal"
Whoops, this will of course mess with nspawn arguments passed to
arch-nspawn.
2017-09-13 00:25:06 +02:00
Jan Alexander Steffens (heftig)
6a7dcdeff9 arch-nspawn: Hack to give the inner process a controlling terminal
This was lost at some point.
2017-09-13 00:17:49 +02:00
Jan Alexander Steffens (heftig)
cd500d161f arch-nspawn: Pass --as-pid2
As not all commands we run are capable of reaping processes correctly.
For example, pacman is not.
2017-09-12 23:27:07 +02:00
Sébastien Luttringer
5ebb9c16c0 Version 20170911 2017-09-11 21:26:07 +02:00
Sébastien Luttringer
fecf107c37 arch-nspawn: Force PATH to be the Arch default
systemd-nspawn use a default environ PATH value of:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Since filesystem 2017.08, this is no more overrided by /etc/profile
to the Arch default:
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin
2017-09-11 21:21:51 +02:00
Jan Alexander Steffens (heftig)
bd826752c9 makechrootpkg: Also look for -e as --noextract 2017-08-24 17:20:59 +02:00
Martchus
d0e684d2e9 makechrootpkg: Prevent removing build dir when --noextract specified 2017-08-24 17:20:59 +02:00
Jan Alexander Steffens (heftig)
000ea6c7bb arch-nspawn: Add --keep-unit to prevent scope conflicts 2017-08-24 17:03:32 +02:00
Jan Alexander Steffens (heftig)
5715134884 Version 20170813 2017-08-13 01:24:11 +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
Jan Alexander Steffens (heftig)
086ff8b9e7 archrelease: Whitespace adjustment 2017-07-05 18:35:16 +02:00
Laurent Carlier via arch-projects
041afb5f07 archrelease: sync the repos directory before commiting changes 2017-07-05 18:23:38 +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
a396a69081 Make slightly more involved changes to make shellcheck happy.
- Use `read -r` instead of other forms of read or looping
 - Use arrays instead of strings with whitespaces.
 - In one instance, use ${var%%.*} instead of $(echo $var|cut -f. -d1)
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
430e1265fb Makefile: Add a simple 'check' target that runs shellcheck 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
2fdd1654b5 Makefile: m4_changequote([[[, ]]]) to avoid accidental quoting.
The default m4 quote characters: `QUOTE' are troublesome, because ` is
fairly likely to pop up in a shell script (if not for a subshell, because
it is a useful character in comments and user-facing messages).

So, this changes it to [[[QUOTE]]], as it is unlikely to see three braces
together like that, let alone in unbalanced sets.
2017-07-05 18:21:55 +02:00
Luke Shumaker
007d6fc15f Makefile: add .DELETE_ON_ERROR:
The absence of it was allowing an (m4-produced) syntax error in
in a change I had made to be masked.
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
31a800fd88 lib/archroot.sh: subvolume_delete_recursive: support arbitrary recursion
The `-xdev` flag to `find` makes it not recurse over subvolumes; so it only
supports recursion with depth=1.  Fix this by having the function
recursively call itself.
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
Bartłomiej Piotrowski
c9b1fc08b5 Sync makepkg.conf files with pacman 5.0.2-2 2017-07-04 12:04:51 +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
578a62f1e0 mkarchroot: Don't let the environment affect pacstrap (sans proxy settings).
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-04-05 22:17:51 +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
5b9c06d275 mkarchroot, arch-nspawn: Add an -s flag to inhibit setarch.
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-05 22:17:51 +02:00
Luke Shumaker
82e6bfcd7a mkarchroot, arch-nspawn: Add an -f flag to add files to copy.
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-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
lukeshu@parabola.nu
6098253f6f Handle makepkg.conf more consistently 2017-04-05 22:17:51 +02:00
Luke Shumaker
c1a056c9a8 lib/common.sh: Make it safe to include multiple times.
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-05 22:14:20 +02:00
Luke Shumaker
747e8ffc8d lib/common.sh: Adjust to work properly with set -u. 2017-04-05 22:14:20 +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
ae82f88e51 commitpkg: Adjust fancy quoting/escaping to not confuse Emacs.
It was confusing Emacs and screwing up the syntax highlighting and
auto-indentation for the rest of the file.
2017-04-05 22:10:03 +02:00
Luke Shumaker
f55786b7a8 Add '#!/hint/bash' headers to non-executable bash files.
This provides a cross-editor hint that the syntax of the file is Bash.
2017-04-05 22:10:03 +02:00
Luke Shumaker
8ff247de13 lib/common.sh: Make setup_workdir()/cleanup() safe for programs to not use 2017-04-05 22:03:00 +02:00
Luke Shumaker
d4f09b2c7b lib/common.sh: lock, slock: Create directories for locks if necessary. 2017-04-05 22:03:00 +02:00
Luke Shumaker
d333440810 lib/common.sh: lock, slock: Allow locks to be inherited.
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-05 22:03:00 +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)
f73c1f172f Version 20170320 2017-03-20 19:23:50 +01: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
Jan Alexander Steffens (heftig)
66553e7e07 lib/archroot.sh: Move CHROOT_VERSION to a common file 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
Jan Alexander Steffens (heftig)
e10ce7fc70 Version 20170304 2017-03-04 15:10:11 +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
Jelle van der Waa
15f16162fb lib: remove unused version, pkgparts 2017-03-04 15:03:37 +01:00
Jelle van der Waa
fea14fa286 lib: remove unused left, right 2017-03-04 15:03:05 +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)
c8147a3512 mkarchroot: Set LANG=en_US.UTF-8
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-17 19:51:56 +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)
70d3c63b5c Version 20160528 2016-05-28 17:52:56 +02:00
Jan Alexander Steffens (heftig)
eb6b0e3f11 arch-nspawn: Work around pacman master returning file-URLs from the cache 2016-05-28 12:33:00 +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
Pierre Schmitz
eb88a303b7 Merge branch 'master' of git.archlinux.org:/srv/git/devtools 2016-05-28 10:09:45 +02:00
Sven-Hendrik Haase
8f94d8118f This is 20160527.1 2016-05-27 22:17:02 +02:00
Sven-Hendrik Haase
882f5d0451 mkarchroot: Manually generate machine-id because nspawn expects it 2016-05-27 22:16:09 +02:00
Sven-Hendrik Haase
f36c45e0c6 Makefile: change version to 20160527 2016-05-27 21:11:46 +02:00
Sven-Hendrik Haase
7fc22b9aba Use repos.archlinux.org everywhere instead of hostname based domains
This makes it a lot easier to swap out the host that actually serves the repos in the future.
2016-05-27 21:02:46 +02:00
Pierre Schmitz
7fe0f68856 Set target vendor to pc for usge with gcc 6 2016-05-07 10:53:48 +02:00
Pierre Schmitz
f85fc32d78 Update bundled pacman and makepkg configuration 2016-02-07 10:12:56 +01: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
38957783a2 Bump version to 20151129 2015-11-29 12:06:58 +02:00
Evangelos Foutras
5a7890f076 arch-nspawn: preserve systemd-nspawn's stderr
It is passed down to the container when stdin/stdout is not a tty; this
is the case when archbuild's output is redirected to a pipe or file.
2015-11-29 12:01:34 +02:00
Evangelos Foutras
ba45e06d3e Bump version to 20151002 2015-10-02 15:02:45 +03:00
Evangelos Foutras
393b9757cf Sync makepkg.conf files with pacman 4.2.1-4 2015-10-02 14:59:52 +03:00
Jan Alexander Steffens (heftig)
3231cf8c36 Layer gnome-unstable above staging, not testing 2015-09-25 14:37:20 +03:00
Evangelos Foutras
f5ef88ec59 Bump version to 20150606 2015-06-06 15:27:00 +03: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
Johannes Löthberg
763d8ffb53 commitpkg: Force unarmored signatures
Pacman cannot handle armored signatures, so force a generation of a
binary one using the --no-armor flag.
2015-06-06 15:22:33 +03:00
Pierre Schmitz
a1594ae1f6 Prepare release 2015-05-14 10:38:49 +02: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
Dave Reisner
85705363cd prepare 20150228 release 2015-02-28 10:53:37 -05: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
db135e9013 prepare 20141224 release
It's an xmas miracle!
2014-12-24 10:56:41 -05:00
Dave Reisner
443aedca9a makepkg-*.conf: add VCSCLIENTS definition
Needed for makepkg 4.2
2014-12-23 17:52:45 -05:00
Dave Reisner
b58fb33482 checkpkg: mask errors from lib-provides
bsdtar doesn't consider it an error when your --include doesn't match
anything in the archive, so we're forced to dump stderr to /dev/null
here.

Fixes: https://bugs.archlinux.org/task/42551
2014-10-25 11:36:28 -04:00
Dave Reisner
f743f58682 find-libdeps: cleanup some quoting/array concerns 2014-10-25 11:36:21 -04:00
Dave Reisner
98166e3454 prepare release 20141024 2014-10-24 09:19:17 -04: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
Doug Newgard
cae954ddb5 checkpkg: improve soname checking
This makes soname checking much more robust and is explicit when a
soname change is found.
2014-10-01 20:25:59 -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
Luke Shumaker
625e6bd412 mkarchroot: Correct "Usage:" text.
The "app" hasn't been an option since arch-nspawn was created.
2014-09-22 08:25:43 -04:00
Luke Shumaker
6dce935b99 archbuild: Fix a variable name mistake. ($copydir -> $copy)
It tried to lock `$copydir.lock`, which was the ONLY mention of $copydir in
the entire file.  Surely it meant `$copy.lock`; the line was probably
originally copy/pasted from makechrootpkg or similar, where $copydir is
used.
2014-09-22 08:25:43 -04:00
Dave Reisner
98841eb694 common: remove unreachable statement
We run from a non-interactive shell, so the exec which is inevitably
called will replace the current process and 'die' will never run under
any circumstances.

This also fixes a bug with the su fallback which would cause multiple
arguments to be concatenated without any whitespace between them.
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
Luke Shumaker
651f8f834f arch-nspawn: Fix a grammar mistake (a/an) in an error message. 2014-09-22 08:25:43 -04:00
Dave Reisner
d83805bc54 nspawn: skip machine registration
No need to do this since we don't run an init system in the build root.
2014-09-22 08:25:43 -04:00
Dave Reisner
af6c0a0f6a common.sh: propagate error through trap_exit
Fixes a breakage introduced in 6db31cc16a which leads to errors
being masked from makechrootpkg.
2014-09-22 08:25:42 -04:00
Pierre Schmitz
905198295d Prepare release 2014-05-10 08:09:49 +02: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
BlackEagle
7aac293d76 get_full_version :: remove duplicated epoch check
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2014-05-10 08:04:51 +02:00
BlackEagle
6db31cc16a when cleanup is called without code exit with 0
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2014-05-10 08:04:24 +02:00
BlackEagle
4ee45fe6d4 abort and die are serious errors so throw 255 out
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2014-05-10 08:03:58 +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
Allan McRae
9f7ba3d407 Use -fstack-protector-strong
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2014-05-04 07:39:54 +02:00
Pierre Schmitz
40ea1b3ca5 Prepare release 2013-11-07 14:57:03 +01: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
Dave Reisner
1e043445d2 find_cached_package: avoid adding duplicates
If PKGDEST is set when makepkg was run, the package will be present in
find_cached_package's search path by default, causing an error.

This also fixes a display bug which causes no output to be shown when
multiple packages are found.

Fixes FS#37626.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-04 10:02:20 +01:00
Pierre Schmitz
3029c8e4bc checkpkg: Fix usage of local mirrors 2013-11-01 21:13:43 +01:00
Pierre Schmitz
b8dd44083a Prepare release 2013-11-01 20:35:52 +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
27441f201c common: implement find_cached_package
This function (currently) searches through $PWD and $PKGDEST looking
for a tarball matching the requested package name, architecture, and
pkgver. If found, it writes the full path to the located package to
stdout and returns 0, else 1. If more than 1 match is found, it's
treated as an error and the user will need to figure out what to do.

Use this in checkpkg and commitpkg, which previously implemented their
own less complete logic, to locate the build artifacts they rely on.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-01 18:52:03 +01:00
Dave Reisner
c4f72f781b commitpkg: check all files at once for version control
Instead of dying at the first sight of an unversioned file, this lets
commitpkg dump all known unversioned files at once.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-01 18:40:15 +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
Eric Bélanger
e3cf64ad2f checkpkg: Only match .so at end of filenames for soname check
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-01 18:35:54 +01:00
Eric Bélanger
7524bec6d9 checkpkg: Fix soname check
The bsdtar options were in the incorrect order and objdump couldn't find the files.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-10-27 15:57:16 +01:00
Eric Bélanger
70309118ab checkpkg: Create symlinks to old packages in $TEMPDIR instead of $PWD
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-10-27 15:54:41 +01:00
Pierre Schmitz
164f5b758d prepare release 2013-10-20 13:32:16 +02:00
Pierre Schmitz
1ae58aed5b Remove libtool files by default 2013-10-20 13:31:02 +02:00
Allan McRae
0d16a91350 Make !staticlibs the default in makepkg.conf
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-10-19 16:26:54 +02: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
9c85d116f0 checkpkg: avoid using PKGEXT to guess tarball name
We can't rely on PKGEXT since it's not sourced from a controlled
location. Case in point, if a user sets PKGEXT=.pkg.tar.gz, checkpkg
fails and offers no easy workaround.

Instead, use glob expansion to resolve the name of the tarball, bailing
if it can't be found definitively. This involves some refactoring to
avoid modifying PWD (which is advisable regardless).

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-18 18:19:12 +02:00
Dave Reisner
914ebe3a74 ensure that PKGBUILDs aren't sourced via PATH
Fixes FS#36378.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-18 18:17:31 +02:00
Dave Reisner
7267664ed8 arch-nspawn: allow oddly named directories
This fixes various errors one might encounter when trying to use a
build root or cachedir with whitespace in it.

Note that the cachedir fix is not a complete one, as pacman's output is
unreliable (and not meant for parsing here).

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-18 18:17:05 +02:00
Dave Reisner
e0f7c21a68 arch-nspawn: avoid escaping mount_args
eval is no longer involved in the execution of systemd-nspawn, so we no
longer need a layer of escaping on the arguments.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-18 18:16:59 +02:00
Pierre Schmitz
8dbb02de4f Prepare release 2013-08-08 22:51:14 +02:00
Pierre Schmitz
b12d5eaf85 Update makepkg.conf from pacman 4.1.2 2013-08-08 22:50:19 +02:00
Dave Reisner
0fa2536957 Makefile: validate generated files as part of build
For example...

$ make
GEN checkpkg
GEN commitpkg
GEN archco
archco: line 179: unexpected EOF while looking for matching `"'
archco: line 181: syntax error: unexpected end of file
make: *** [archco] Error 2

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-08 21:28:19 +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
Dave Reisner
fb30cabe61 common: Properly forward arguments from die to error
Also allow this function to be called without arguments, in which case,
don't call error at all. Some uses of this function wrongly assumed
that this was already allowed.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-08 21:28:00 +02:00
Florian Pritz
29e62278a7 arch-nspawn: remove leading - from the machine name/hostname
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-08 21:24:55 +02:00
Pierre Schmitz
8c4553f68c prepare new release 2013-05-25 22:39:46 +02:00
Pierre Schmitz
6006783cbc Move all scripts from sbin to bin directories 2013-05-25 22:39:11 +02:00
Jan Alexander Steffens (heftig)
e26fddb608 Update .gitignore 2013-05-25 22:17:30 +02:00
Jan Alexander Steffens (heftig)
c3bb10046b crossrepomove: copy packages locally
Nymeria's HTTP mirror is now password-protected and crossrepomove broke.
2013-05-25 16:55:53 +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)
38692e8d74 archbuild: Correct makechrootpkg argument order
The user-passed makechrootpkg_args may contain a "--" to pass
arguments to makepkg. In this case, the order is wrong.
2013-05-11 12:26:21 +02:00
Jan Alexander Steffens (heftig)
a5bc6acf32 arch-nspawn: Quiet systemd-nspawn again
systemd-nspawn always outputs some debug messages over stderr.
Both stdout and stderr from inside the chroot are sent through
a pty to stdout.
2013-05-11 12:26:20 +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)
1489f75419 arch-nspawn: setarch to CARCH
Allows calling makechrootpkg without worrying about the architecture
2013-05-06 01:50:05 +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)
0e98bd8c48 arch-nspawn: Set machine name
Recent changes to systemd-nspawn have it take the machine name from
the chroot dir name, which isn't unique enough for our setup.
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
Pierre Schmitz
6e086f0e70 Prepare release 2013-04-08 18:09:19 +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
Pierre Schmitz
97a2d2414a mkarchroot: Fix creation of btrfs snapshot and remove force option 2013-04-07 16:05:21 +02:00
Pierre Schmitz
eebfd9a30f Prepare release 2013-04-06 20:06:23 +02:00
Pierre Schmitz
5085cfcdf9 Bump the chroot version as we changed the default package set 2013-04-06 19:55:58 +02:00
Pierre Schmitz
6caad191c1 Only try to use btrfs snapshots if chroots are on a btrfs partition 2013-04-06 19:50:17 +02:00
Pierre Schmitz
092fe2ffde Sync pacman.conf and makepkg.conf with pacman 4.1 2013-04-06 18:59:16 +02:00
Pierre Schmitz
71b15aafb6 Simplify update call as pacman does no longer support SyncFirst 2013-04-06 18:43:01 +02:00
Pierre Schmitz
4bcafd9768 mkarchroot: code cleanup 2013-04-06 18:38:10 +02:00
Pierre Schmitz
1f0374d8a6 mkarchroot: Create working directory if needed 2013-04-06 18:32:10 +02:00
Dave Reisner
f03086a0e1 use nspawn to bind mount needed directories
systemd-nspawn is capable of doing this as of systemd-198. Doing this
means we can remove all of our home grown chroot mount/umount logic, as
it's all performed by pacstrap or systemd-nspawn.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-04-06 18:15:14 +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
Pierre Schmitz
dee4d05b1e Fix crossrepomove for use on nymeria 2013-01-27 17:04:26 +01:00
Pierre Schmitz
10eba28151 archbuild: fix default build flags 2013-01-22 20:12:36 +01:00
Pierre Schmitz
9cef7e0a9e Use nymeria instead of gerolde 2013-01-20 18:24:04 +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
Sébastien Luttringer
fb71ad1e7f Allow makechroot options in archbuild
This will allow, by example, to easily build a package with a custom pkg.

staging-x86_64-build -- -cI /var/cache/pacman/pkg/ldoc-1.2.0-1-any.pkg.tar.xz
staging-x86_64-build -- -n

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-01-20 10:21:31 +01:00
Pierre Schmitz
828143751b Drop initscripts support 2013-01-20 10:08:24 +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
Pierre Schmitz
2020fb406a prepare release 2012-11-15 14:38:03 +01:00
Eric Bélanger
4427b80aba crossrepomove: Fix dbscripts path for [community] move to nymeria
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-11-15 14:32:34 +01:00
Eric Bélanger
41b54bdde5 mkarchroot: Remove unnecessary parameter for usage function
Fixes FS#28973

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-11-15 14:28:50 +01:00
Eric Bélanger
54bad4c91d checkpkg: replace wget usage by curl
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-11-15 14:27:20 +01:00
Pierre Schmitz
fc95a57556 prepare release 2012-11-12 18:44:26 +01:00
Pierre Schmitz
21458bd07b For now only packages and svn from sigurd will be moved to nymeria 2012-11-11 21:07:34 +01:00
Pierre Schmitz
a05969b29d prepare release 2012-11-03 18:26:45 +01:00
Pierre Schmitz
fdeaed894a Use nymeria.archlinux.org as shared host for developers and trusted users 2012-11-03 17:32:33 +01:00
Pierre Schmitz
3699321904 Prepare release 2012-10-27 20:31:05 +02:00
Pierre Schmitz
d8ec9c9066 Use sigurd.archlinux.org instead of the now moved aur.archlinux.org hostname 2012-10-27 20:30:24 +02: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
d5c6bc7656 prepare release 2012-10-13 21:06:31 +02:00
Dan McGee
f7615fe7d7 Fix releasing files with '@' in name
SVN treats '@' as a revision specifier, so with the addition of systemd
spawning service files, we need to ensure it doesn't screw things up.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-10-13 20:40:09 +02:00
Pierre Schmitz
1703b92e1a mkarchroot: do not try to bind /etc/timezone from host
/etc/timezone is no longer used. We only need /etc/localtime.

This fixes FS#31929
2012-10-13 20:33:53 +02:00
Pierre Schmitz
cfd81ab563 prepare release 2012-10-04 21:19:31 +02:00
Pierre Schmitz
ac1ee41e4d mkarchroot: use a helper function to simplify bind mounts 2012-10-04 19:57:19 +02:00
Pierre Schmitz
ecae65e7fd prepare release 2012-10-03 12:46:07 +02:00
Pierre Schmitz
c617c67ff8 mkarchroot: Use systemd's nspawn if available
* If we are running systemd use nspawn instead of our own chroot setup
* Use pacstrap to setup our chroot environment
* Make sure the common trap is still called
* Bind resolve.conf, timezone and lcoaltime from the host if nspawn is not used
* Run ldconfig within the chroot
2012-10-03 12:38:33 +02:00
Pierre Schmitz
7228cc00e8 Use dedicated trap functions to avoid unsetting the trap when e.g. cleanup is called 2012-10-03 12:35:40 +02:00
Pierre Schmitz
a26416dca3 makechrootpkg: do not run namcap as root 2012-10-03 12:32:55 +02:00
Pierre Schmitz
37bb1d33a7 archbuild: abort if update or creation of the chroot fails 2012-10-03 12:32:03 +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
499f20071a prepare release 2012-07-20 23:29:43 +02:00
Eric Bélanger
0d3d63e3aa Fix bash completions
With bash-completion 2.0, the completion must have the same name as the binary.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-25 00:01:32 +02:00
Pierre Schmitz
d2ec5ab67d prepare release 2012-06-16 17:06:15 +02:00
Pierre Schmitz
a23d93ce7f commitpkg: check if there are any packages to process before doing so 2012-06-16 16:56:42 +02:00
Pierre Schmitz
246b8ead60 mkarchroot: reset trap so it wont be called twice 2012-06-16 16:21:55 +02:00
Pierre Schmitz
b14a1b1bcc archbuild: do not cross filesystems when removing the chroot copies 2012-06-16 15:28:52 +02:00
Pierre Schmitz
0cd9e1ae7e archbuild: use flock -n as we do elsewhere 2012-06-16 15:24:16 +02:00
Allan McRae
3734c80bf7 Fix /run permissions in chroot
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-15 09:27:27 +02:00
Pierre Schmitz
7b696f6f8d prepare release 2012-06-12 18:22:37 +02:00
Pierre Schmitz
ed9d5a16e3 Support multiple package cache directories
* We use the host package cache configuration
* As only the first cache will be written to, we mount the others readonly
2012-06-12 08:17:58 +02:00
Pierre Schmitz
e44c49aebb archbuild: Store chroots in /var/lib instead of /var/tmp
/var/tmp is cleaned up by tmpfiels by default which we cannot handle gracefully.
2012-06-12 06:53:11 +02:00
Pierre Schmitz
c5cd72c085 Remove no longer used option 2012-06-11 23:44:30 +02:00
Pierre Schmitz
8bedb89fd6 Add a version number to each chroot so we can tell the user when a rebuild is needed 2012-06-11 17:04:17 +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
41b39c3e78 prepare release 2012-06-11 11:39:42 +02:00
Pierre Schmitz
6743c97383 update makepkg.conf and pacman.conf 2012-06-11 11:32:05 +02:00
Gerardo Exequiel Pozzi
231496c82a mkarchroot: use bind mount instead of symlink for /dev/ptmx
We need /dev/ptmx -> /dev/pts/ptmx (for devpts -o newinstance)
Other way to do this thing is via bind mount (as said kernel doc[devpts.txt]).

This should be done in this way at least for /dev as devtmpfs in the chroot.
Since we can not touch /dev (devtmpfs), because devtmpfs is "singleton",
just use bind method and avoid interference.

Do it the same for both modes of /dev (tmpfs) and (devtmpfs) to keep it simple.

Currently devpts in chroot is not working without this when using /dev as devtmpfs,
this fixes this issue (opening /dev/ptmx, creates devices nodes on outside /dev/pts)

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-10 12:57:14 +02:00
Lukas Fleischer
fda394f1a0 Gracefully handle files containing an "@"
The "@" sign in file names in SVN marks the beginning of a pegged
version number -- from the Subversion book:

    Peg revisions are specified to the Subversion command-line client
    using at syntax, so called because the syntax involves appending an
    “at sign” (@) and the peg revision to the end of the path with which
    the revision is associated.

The trivial workaround is to always append an at sign to the end of the
path in the version control checks.

Before:

    $ community-stagingpkg 'Add systemd units.'
    ==> ERROR: exim-submission@.service is not under version control
    $ svn status -v | grep 'exim-submission@.service'
    A                -       ?   ?           exim-submission@.service

After:

    $ community-stagingpkg 'Add systemd units.'
    ==> Committing changes to trunk...done
    ==> Signing package exim-4.80-2-x86_64.pkg.tar.xz...
    [...]

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-10 12:47:40 +02:00
Allan McRae
addea828fe Prevent packages being uploaded with "Unknown Packager"
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-10 12:46:32 +02:00
Pierre Schmitz
acbbe8cb90 Move bash_completion to /usr/share/bash-completion/completions/ 2012-03-21 07:32:44 +01:00
Pierre Schmitz
9840730880 Prepare release 2012-03-05 18:02:22 +01:00
Pierre Schmitz
502813a107 commitpkg: Pass through the -f parameter to archrelease so unofficial repos can be used 2012-03-05 16:48:19 +01: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
Gerardo Exequiel Pozzi
2d9a99ee15 Add -d param to optionally support devtmpfs
The main intention of this patch is to take advantage of
/dev/loop-control and loop devices.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-03-05 14:30:26 +01:00
Pierre Schmitz
cecd257786 Add script to move packages between [extra] and [community] 2012-03-05 01:48:27 +01:00
Pierre Schmitz
82dcc19ff9 commitpkg: Add ability to override the server
This might be useful for unofficial repos
2012-03-04 22:38:07 +01:00
Florian Pritz
c5893672a6 find-libdeps: fix extraction of soname
libperl.so results in soname="libperl.so.so" which is wrong.

This returns the correct string: "libperl.so"

Fix-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-03-04 22:25:22 +01:00
Pierre Schmitz
73d61f43c7 prepare release 2012-02-15 11:33:12 +01:00
Allan McRae
afc93f3430 Always sign unsigned packages
We do not allow packages to be uploaded without signatures so force
all unsigned packages to be signed.  This has the bonus of not
breaking makepkg signing support by requiring you use an internal
makepkg variable.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-02-15 11:25:49 +01:00
Lukas Fleischer
9ab0d94578 archrelease: Validate tags before releasing
Compare every single tag with a list of valid tags. This prevents broken
releases which occurred whenever someone made a typo on the command
line:

    $ ./archrelease community i686
    ==> ERROR: archrelease: Invalid tag: "community" (use -f to force release)

Since the list is used in the ZSH completion as well, break it out to a
separate file and move it to "lib/". Also, add a command line parameter
to allow for releasing to an unknown repository when necessary.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-02-12 12:35:14 +01:00
Lukas Fleischer
5e8cb67603 zsh_completion: Remove multilib*-{i686, any}
These tags make no sense. Remove them from our valid tag array that is
used for tab completion.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-02-08 12:53:13 +01:00
Pierre Schmitz
65365f1853 prepare release 2012-02-06 21:17:44 +01:00
Florian Pritz
06a681ca3d commitpkg: use absolute paths when uploading files
This fixes a problem where rsync won't work if the pkgver contains a
colon (epoch). In this case rsync assumes that the colon is a
remote:path separator and having src and dest both being remote
arguments is not supported.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-02-06 21:15:57 +01:00
Pierre Schmitz
b763788b16 Fix typo: It's PKGDEST and not DESTDIR 2012-01-19 18:45:01 +01:00
Pierre Schmitz
c2d9a0e7b1 Set correct pacman.conf
Commit ee4edefa2f reverted too much and left pacman.conf unset
2012-01-18 16:56:41 +01:00
Pierre Schmitz
ee4edefa2f Remove any pacman 4 related workarounds 2012-01-18 11:24:07 +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
Florian Pritz
4d4ffb5d8f find-libdeps: fix syntax error
The problem has been introduced in commit
56d4dec19f

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:52 +01:00
Dave Reisner
2d79191c97 commitpkg: behavior more sanely in searching for built pkgs
In the case of a .pkg.tar.xz and a .pkg.tar.gz existing in the same
directory, all commitpkg would say is:

  ==> WARNING: Could not find . Skipping x86_64

Upon digging into the logic, we did a few things poorly, mostly in
getpkgfile:

- getpkgfile tried to die in a subshell (within the command substituion
  assignment to 'pkgfile'). This will never work.
- We assumed that proper glob expansion happened when we received
  exactly 1 arg. This isn't necessarily true without nullglob in effect.
- We dumped the real error (spewed by getpkgfile) to /dev/null.
- We checked for the package twice in both $PWD and $DESTDIR/.
- We checked for file existance multiple times.

Address this by:

- not hiding errors. revamp the wording a little bit to make it more
  obvious why we failed, particularly in the case of a glob expanding to
  more than 1 file. Logic here is simplified to pointing out the failure
  cases of 0 and >1.
- setting nullglob so the number of arguments passed into getpkgfile is
  meaningful from a 'did it decisively resolve' point of view.
- not trying to exit the entire script from a subshell. Just return a
  value (and use it).
- avoiding the package file existance check afterwards. this is a
  freebie from getpkgfile when the glob passed fails to expand.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:51 +01:00
Pierre Schmitz
5b3ca82ae5 prepare release 2012-01-14 20:25:43 +01:00
Pierre Schmitz
90a5e441cd Add support for multilib-staging 2012-01-14 20:22:26 +01:00
Pierre Schmitz
3c7dbe0ea2 prepare release 2011-12-20 23:12:49 +01:00
Tom Gundersen
130227546a mkarchroot: do not create /etc/mtab
As of filesystem-2011.12 this is not needed anylonger, and indeed blocks the
chroot from being upgraded. As a workaround, recreating the chroot fixes the
problem.

Fixes FS#27640.

Reported-by: Andrea Scarpino <andrea@archlinux.org>
Signed-off-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-12-20 23:05:44 +01:00
Timothy Redaelli
594f972666 Use #!/bin/bash instead of #!/bin/sh
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-12-20 23:05:38 +01:00
Dave Reisner
0e32334cca archbuild: exec makechrootpkg to preserve exit value
This fixes a compound command such as the one below from continuing even
if the first fails.

  extra-x86_64-build && extra-i686-build

The problem is that 'cleanup 0' is triggered in archbuild even after an
unsucessful call to makechrootpkg. Since both archbuild and
makechrootpkg share the exact same cleanup function (from lib/common),
we simply force the shell to exit with the true return value by exec'ing
the call to makechrootpkg.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-12-04 18:13:13 +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
Lukas Fleischer
bfd2862bc4 Makefile: Remove output files before replacing them
This one fixes all the "Permission denied" errors we got when invoking
make(1) after modifying a source file and removes the need to delete the
generated scripts manually.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-12-04 18:01:51 +01:00
Lukas Fleischer
56d4dec19f Use double brackets everywhere
We already fixed a couple of these in previous patches - this one should
replace all remaining uses of single brackets ("[") by double brackets.
Also, use arithmetic evaluation instead of conditional expressions where
appropriate and make use of "-z" and "-n" instead of comparing variables
to empty strings.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-12-04 18:00:57 +01:00
Pierre Schmitz
f62f307c84 Add support for kde-unstable and gnome-unstable 2011-12-04 17:48:46 +01:00
Pierre Schmitz
8efe61b4e2 Skip archrelease for missing architectures 2011-11-21 10:24:29 +01:00
Pierre Schmitz
8ffc2e44ee prepare release 2011-11-11 22:06:17 +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
8ba91b0574 prepare release 2011-11-06 10:38:39 +01:00
Pierre Schmitz
671643053d archbuild: Always use recent makepkg.conf and pacman.conf; Run namcap by default 2011-11-06 10:32:55 +01:00
Pierre Schmitz
bf96c9f949 makechrootpkg: Create separate namcap log for every single file 2011-11-06 10:31:37 +01:00
Pierre Schmitz
a030cdc532 mkarchroot: Respect makepkg.conf and pacman.conf when running a command 2011-11-06 10:27:55 +01:00
Lukas Fleischer
b7a3c74c50 commitpkg: Fix commit message
Move the message template before the if block. We moved this to the else
branch in commit aaa68e49e8 which lead to
"msgtemplate" being unset if one specifies a commit message on the
command line, thus stripping the "upgpkg:" part.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:38:11 +01:00
Eric Bélanger
a33ee6e78d commitpkg: Make svn quieter
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:34:50 +01:00
Lukas Fleischer
1f24380a31 Makefile: Add common library to build dependencies
Add "lib/common.sh" to the build dependencies of our scripts to ensure
everything gets rebuilt when we modify a common function. Also, add
"Makefile" itself to enforce a rebuild if the edit command changes.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:34:13 +01:00
Lukas Fleischer
fbbcc30e3d lib/common.sh: Revise setup_workdir()
* Honor TMPDIR variable (just like we did in commit a0c6bf45).
* Quote path properly.
* Avoid unnecessary use of basename(1).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:34:00 +01:00
Lukas Fleischer
c1752bd716 lib/common.sh: Use double brackets
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:33:51 +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
aea075d817 Change version to date 2011-11-01 21:36:33 +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
Florian Pritz
7c78599a61 add libdepends script
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-10-31 22:57:12 +01:00
Pierre Schmitz
89950ccd70 Create signature for devtools source package 2011-10-31 14:04:35 +01:00
Pierre Schmitz
c238cfafa0 commitpkg: Require signatures for packages 2011-10-31 13:53:43 +01:00
Pierre Schmitz
0e58198f36 commitpkg: Check signature if available 2011-10-31 13:14:16 +01:00
Pierre Schmitz
e07d318c54 commitpkg: Skip signing if signature already exists 2011-10-31 12:53:50 +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
01f5cdf33d prepare release 2011-10-29 21:53:36 +02:00
Pierre Schmitz
e333a4da81 temporary workaround until pacman 4.0 moves to [core]
Pacman 3 refuses to work with the pacman 4 SigLevel config entry

Also related: https://bugs.archlinux.org/task/26555
2011-10-29 21:46:19 +02:00
Pierre Schmitz
86045b965e makechrootpkg: Make host pubring.gpg available to check signed sources 2011-10-29 20:37:28 +02:00
Lukas Fleischer
bea69043fb commitpkg: Sync changelog/install check with makepkg(8)
makepkg(8) currently uses a smarter method to extract all changelog and
install files from a PKGBUILD. Sync commitpkg to use the same code (with
small modifications). This also adds support for changelog/install files
that contain a whitespace.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-10-29 13:19:10 +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
3a684f667b prepare release 2011-10-14 10:18:56 +02:00
Pierre Schmitz
ae7b13646e Disable pacman's CheckSpace option as it fails within a chroot 2011-10-14 10:16:55 +02:00
Pierre Schmitz
6cf9332896 prepare release 2011-10-14 10:06:33 +02:00
Pierre Schmitz
f10d88e029 Call locale-gen with full path in chroot environment
Thanks to Peter Schuller for this hint
2011-10-14 09:55:28 +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
Pierre Schmitz
b06b9f6010 Merge remote-tracking branch 'cryptocrack/for-pierre' 2011-10-14 09:33:07 +02:00
Pierre Schmitz
9715ddbe9d Apply pacman 4.0 changes to our copies of makepkg.conf and pacman.conf
Note: Signature checks are disabled for now until we provide a keyring package.
2011-10-14 09:09:46 +02:00
Lukas Fleischer
a0c6bf4556 Honor TMPDIR environment variable
Replace all mktemp(1) invocations that hardcode "/tmp" with `mktemp
--tmpdir` and change templates accordingly.

Note that "--tmpdir" is GNU-ish which is okay given that we currently
support Arch Linux only anyway.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-13 11:10:09 +02:00
Lukas Fleischer
dcb80e7b5c finddeps: Unset optdepends
The optdepends array should be unset before sourcing the PKGBUILD to avoid
dangling optional depends.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-13 08:23:36 +02:00
Lukas Fleischer
84b789f760 finddeps: Use read builtin to iterate over packages
Using parameter substitution might result in unpredictable behaviour
when directories contain whitespaces here. The read shell builtin is the
proper way to read single lines.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-13 08:23:35 +02:00
Lukas Fleischer
8edb443c12 finddeps: Remove redundant cd(1)
Source the PKGBUILD using the correct path (relative to our base
directory) instead of using cd(1) to switch to the ABS base directory
first and to the package directory afterwards.

This is very useful when trying to track errors, also:

    $ ~/src/devtools/finddeps libdaq
    ./community/snort (depends)
    PKGBUILD: line 17: ruby: command not found
    PKGBUILD: line 19: [: =: unary operator expected

Versus:

    $ ~/src/devtools/finddeps libdaq
    ./community/snort (depends)
    ./community/ruby-pkgconfig/PKGBUILD: line 17: ruby: command not found
    ./community/lmms/PKGBUILD: line 19: [: =: unary operator expected

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-13 08:23:34 +02:00
Lukas Fleischer
4800be25c2 finddeps: Proper quoting, use double brackets
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-13 08:23:33 +02:00
Lukas Fleischer
fe2040cd14 archrelease: Fix SVN error when repository is empty
If trash is empty, `svn rm -q "${trash[@]}"` fails with:

    svn: Try 'svn help' for more info and then
    svn: Not enough arguments provided

This doesn't result in any further malfunction but is kind of confusing
and unexpected. Skipping `svn rm` on an empty trash fixes this.

Reported-by: Alexander Rødseth <rodseth@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-12 16:53:08 +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
Dan McGee
022cd3d523 archrelease: call 'svn copy' once for all files
We don't need to invoke svn copy on each file; it accepts multiple
arguments. This cut Allan's time releasing one patch-friendly package
from 5 minutes to 2 minutes.

Signed-off-by: Dan McGee <dan@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
Jan Alexander Steffens (heftig)
7a9f808a0f makechrootpkg: Source PKGBUILD only once
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:03 +02:00
Jan Alexander Steffens (heftig)
b9070bf0b8 makechrootpkg: Use nullglob
Use nullglob instead of checking for existence. If the glob doesn't
match any files, it will be removed instead of staying unexpanded.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:03 +02:00
Jan Alexander Steffens (heftig)
1df6799747 makechrootpkg: Always set PKGDEST and SRCDEST
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:03 +02:00
Jan Alexander Steffens (heftig)
e41deee5e5 makechrootpkg: Replace $workdir with . ($PWD)
$workdir is never used when we change directory, so it's superfluous.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:03 +02:00
Jan Alexander Steffens (heftig)
004ced2a33 makechrootpkg: Eliminate appname, only used once
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:03 +02:00
Jan Alexander Steffens (heftig)
733668f4cc makechrootpkg: Bashify syntax
No functional change. Eliminates unused variables RUN and FORCE.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:03 +02:00
Lukas Fleischer
21daec135a Makefile: Add a cleanup target
Allows for using `make clean` to remove any output files generated by
make(1).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:02 +02:00
Lukas Fleischer
46c4def073 Support non-standard install locations
This build system overhaul allows for adding (define-style) macros to
our scripts. All source files are now suffixed with ".in" to clarify
that they might contain unprocessed defines. The Makefile provides a new
rule to preprocess source files and generate proper output scripts.

Also, add a "@pkgdatadir@" define (as used in GNU Autotools) and use it
instead of hardcoded paths to "/usr/share/devtools" everywhere. We
missed this when adding PREFIX support to the build system in commit
35fc83ce7d.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:02 +02:00
Lukas Fleischer
142b032212 zsh_completion: Fix package completion
Make use of _devtools_completions_all_packages() instead of using
_devtools_completions_installed_packages(). The latter was removed
during an earlier review of the patch adding ZSH completion (now
6350ec04 in master) but we forgot to change two references.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-29 13:59:55 +02:00
Lukas Fleischer
5f8458f197 commitpkg: Avoid unnecessary use of basename(1)
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-29 13:58:50 +02:00
Lukas Fleischer
50c311c261 archbuild: Avoid unnecessary use of basename(1)
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-29 13:58:49 +02:00
Lukas Fleischer
ef10f6c799 archbuild: Proper quoting, use double brackets
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-29 13:58:49 +02:00
Lukas Fleischer
d70918d18a archbuild: Use array for base packages
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-29 13:58:49 +02:00
Pierre Schmitz
6da47a8f6a prepare release 2011-08-25 21:39:49 +02:00
Lukas Fleischer
6350ec0461 Add ZSH completion
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 19:26:12 +02:00
Lukas Fleischer
3da3a5486f checkpkg: Use a pipe to sort package lists
No need to do this after we already wrote the package list to a file.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:22:13 +02:00
Lukas Fleischer
7020d2351b checkpkg: Use read builtin to get new ".so" files
The read shell builtin is the proper way to read single lines. Also,
simplify grep(1) and awk(1) invocations and use a single awk(1)
expression, that supports extracting file names with spaces, instead.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:21:24 +02:00
Lukas Fleischer
7952d6fbfc checkpkg: Avoid unnecessary use of grep(1)/basename(1)
Use parameter expansion instead of invoking external binaries here.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:20:41 +02:00
Lukas Fleischer
3c175e98bd checkpkg: Avoid unnecessary use of sed(1) and cut(1)
We already use `pacman -Sddp` here which should always only return a
single package URL for regular packages. No need to extract the first
field of the last line. Also, specify "--print-format '%l'" explicitly
to make this consistent even if pacman(8)'s default value changes some
day.

Use bash parameter expansion instead of sed(1) to extract the file name
from the URL.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:20:08 +02:00
Lukas Fleischer
ddb08cb9a1 checkpkg: Proper quoting, use double brackets
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:18:36 +02:00
Lukas Fleischer
88a929cfc0 archrelease: Fix behaviour with non-standard trunk name
Do not hardcode the name of the package trunk directory and accept
varying directory names, such as "gnome-unstable". Regression introduced
in 8384ad849d.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:17:19 +02:00
Lukas Fleischer
c24209028a archrelease: Copy new files from trunk
Currently, files that have just been added to trunk are not copied to
the repositories when invoking archrelease, as `svn ls` does not list
them if we don't `svn update` explicitly before. Use `svn ls -r HEAD` to
include everything from current HEAD. Fixes FS#25680.

Reported-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:16:26 +02:00
Lukas Fleischer
61010062ff commitpkg: Release to all repositories at once
Make use of archrelease's multi-tag capability invoke it once instead of
re-launching it for for each individual tag.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:14:33 +02:00
Lukas Fleischer
6ef4d5f30b archrelease: Accept multiple tags
This allows for releasing to multiple repositories with a single commit:

----
$ archrelease community-{i686,x86_64}
copying trunk to community-i686...done
copying trunk to community-x86_64...done
releasing package...done
----

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:13:45 +02:00
Lukas Fleischer
40ddf4d44f archrelease: Check for subdirectories early
Ensure we do not mess with version control if there are any
subdirectories in the package trunk.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:10:30 +02:00
Lukas Fleischer
b445920d55 archrelease: Remove redundant directory check
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 11:09:01 +02:00
Lukas Fleischer
7887d9bb47 archco: Fix usage message
Point out that we allow passing more than two packages here.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-25 10:59:00 +02:00
Dave Reisner
35573fe147 archrelease: declare known_files as an array
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-18 10:11:27 +02:00
Dave Reisner
5688152f41 archrelease: use bashier syntax
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-18 10:11:27 +02:00
Dave Reisner
e1312ec493 archrelease: call svn rm only once
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-18 10:11:27 +02:00
Dave Reisner
e652dc8085 commitpkg: use getopts to parse options
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-18 10:11:27 +02:00
Dave Reisner
ba4f28cc43 commitpkg: declare rsyncopts as an array
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-18 10:11:27 +02:00
Lukas Fleischer
dc7b96e917 commitpkg: Fix leading whitespace in commit messages
Commit c51cc8d365 erroneously introduced a
tab character that is prepended to the body of each commit message. Fix
this by using C-style newline escape sequences which will avoid further
whitespace issues caused by re-indentation of code at this point.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-15 17:01:31 +02:00
Pierre Schmitz
cb25d50913 prepare release 2011-08-14 23:31:35 +02:00
Pierre Schmitz
c51cc8d365 Only commit if needed 2011-08-14 21:30:08 +02:00
Pierre Schmitz
e64c1d33eb prepare release 2011-08-14 14:12:54 +02:00
Pierre Schmitz
19f3a868f4 update makepkg.conf from pacman 3.5.4-4 2011-08-14 14:12:34 +02:00
Pierre Schmitz
f1ee5208ed supress svn verbose output 2011-08-13 23:02:45 +02:00
Pierre Schmitz
b97b245d52 prepare release 2011-08-13 22:58:08 +02:00
Lukas Fleischer
ee970f0bde commitpkg: Provide a commit message template
Generate a message template when omitting the commit message (includes
the same subject line that is used if a commit message is specified).

Also, use two newlines to separate the subject line from the message
body as it looks much clearer that way.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-13 20:33:44 +02:00
Lukas Fleischer
35fc83ce7d Makefile: Add PREFIX support
Default to "/usr/local" which should be used if you want to build
devtools from sources and install without using a package manager.

Use `make PREFIX=/usr install` to install to "/usr" instead.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-13 20:31:22 +02:00
Lukas Fleischer
51b5d69cfc archrelease: Fix removal of repository content
Fix the `svn rm` invocation when releasing to a repository that already
contains some files. `svn ls` only returns basenames, so we need to
prepend the path here.

Regression introduced in 8384ad849d.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-13 20:20:21 +02:00
Lukas Fleischer
30bcca88d3 commitpkg: Use positive patterns in SVN checks
In addition to what we had before, this will also detect:

* Non-existent files.
* Files that are missing or scheduled for deletion.
* Ignored files.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-13 20:18:35 +02:00
Lukas Fleischer
25aae4ecfe commitpkg: Avoid unnecessary use of grep(1)
Use bash patterns instead of using grep(1) to check if a source file
contains the string "://".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-13 20:18:11 +02:00
Lukas Fleischer
c8ba49c6a1 commitpkg: Proper quoting in version control checks
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-13 20:15:19 +02:00
Pierre Schmitz
e63c5f26a2 Remove communityco on uninstall 2011-08-13 20:11:34 +02:00
Florian Pritz
c9c4e8043c merge archco and communityco
Signed-off-by: Florian Pritz <bluewind@xinu.at>

 delete mode 100755 communityco
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-13 20:10:15 +02:00
Eric Bélanger
2582637376 checkpkg: Use symlinks in work directory instead of copying the packages
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-08-13 20:06:43 +02:00
Florian Pritz
74df2a90d8 makechrootpkg: support absolute paths for chroot copy
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-07-25 20:37:48 +02:00
Dan McGee
8384ad849d archrelease: remove extra SVN commit
This relies on the fact that trunk/ never has any subdirectories, so we
can simply copy all the files in it to the relevant repos/xxx/ directory
after removing all existing files in that directory.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-07-25 20:36:21 +02:00
Gerardo Exequiel Pozzi
1febb47b2c Edit /etc/locale.gen instead of overwrite.
I need this for archiso, instead of maintaining a private copy.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-07-25 18:28:17 +02:00
Andrea Scarpino
c57284e053 Install a package in the chroot without confirm
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-07-25 18:03:35 +02:00
Eric Bélanger
d177c87080 lddd: Add /usr/local/lib to library directories
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-07-25 18:02:10 +02:00
Eric Bélanger
4b24337a51 lddd: Replace hardcoded list of library directories by those listed in /etc/ld.so.conf.d
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-07-25 18:01:18 +02:00
Eric Bélanger
9a29f624f1 checkpkg: Clean up soname check output
A missing quote in a grep command was giving out false matches.

By moving the objdump command in the same echo statement as the
filename, we ensure that every library name are displayed on a line of
their own in case they don't have a SONAME defined in their
headers. That is the case for some plugin libraries.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-07-25 17:53:08 +02:00
Eric Bélanger
3040951ca0 Replace backticks by $() and add missing quotes
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-07-25 17:53:02 +02:00
Dan McGee
5d39ffb341 archrelease: add repos/ directory if it doesn't exist
Very easy thing to forget when creating a new package, but easy enough
to check for and add automatically.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-07-25 17:50:22 +02:00
user
7e5ae10b43 Include epoch in updpkg default message
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-05-30 00:03:06 +02:00
Pierre Schmitz
ab5eb2e4de prepare release 2011-05-18 18:28:33 +02:00
Florian Pritz
a1a6a8eaca commitpkg: add -a option to upload only one arch
-a i686 uploads only i686 packages and ignore everything else

Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-05-18 18:28:05 +02:00
Jakob Gruber
6d4367de35 Change pacman calls with -Sd flags to -Sdd
The old pacman -d flag is now -dd since commit 111e07d0be44b7.

Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-05-16 18:19:19 +02:00
Pierre Schmitz
5df1f9bd6d Revert "Use en_US.UTF-8 locale instead of C to support unicode filenames"
This reverts commit 9b33a29ea5.

This was a bad idea as bsdtar cannot read pacakges create with this locale.
2011-05-03 20:34:39 +02:00
Pierre Schmitz
9b33a29ea5 Use en_US.UTF-8 locale instead of C to support unicode filenames 2011-05-03 20:07:24 +02:00
Pierre Schmitz
3985129c3d prepare release 2011-04-29 21:32:57 +02:00
Allan McRae
e197f6d34c checkpkg: remove checking for old style package names
All the packages in the Arch repo have been rebuilt to include the
architecture in their package names so this workaround is no longer
needed.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-29 21:20:11 +02:00
Eric Bélanger
c45e5bbf22 checkpkg: Added epoch support
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-29 21:20:04 +02:00
Eric Bélanger
e380f396cf Added bash_completion file
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-29 21:18:21 +02:00
Allan McRae
d187cdbc38 Use GPGKEY to select signing key
Use the default key from the gpg keyring to sign packages unless
GPGKEY is specified (either in makepkg.conf or as an environmental
variable).

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-17 22:18:56 +02:00
Allan McRae
fee49075f0 Copy check() log from chroot
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-17 22:16:45 +02:00
Eric Bélanger
39ae6e23d6 commitpkg: clean up svn after changing arch from any to i686/x86_64
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-17 11:56:09 +02:00
Pierre Schmitz
61cc1f3504 prepare release 2011-04-11 18:27:44 +02:00
Pierre Schmitz
7037948b65 Add simple function to sign packages
Set SIGNPKG to y in makepkg.conf to enable signing.
2011-04-11 18:26:11 +02:00
Pierre Schmitz
0e6780f2c8 prepare release 2011-04-09 23:04:59 +02:00
Pierre Schmitz
45c8269441 archrelease: be more verbose 2011-04-09 13:41:14 +02:00
Pierre Schmitz
7e3013b2ae Fix rsync call; quotes wont work here 2011-04-08 12:24:25 +02:00
Dan McGee
c16e7c25c9 commitpkg: upload signatures if available
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-02 00:26:33 +02:00
Dan McGee
c955ecf35d commitpkg: upload all files at the same time
Batch them up using a bash array and then pass them all to a single
invocation of rsync.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-02 00:26:33 +02:00
Dan McGee
160e936bba commitpkg: add '-y' to rsyncopts
This allows uploads to possibly be smaller if a similar file exists
nearby without the same name. Unlikely in most cases, but we might as
well take advantage if they do exist:

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-02 00:26:33 +02:00
Dan McGee
69f9e64aa3 commitpkg: move all rsync opts to rsyncopts var
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-02 00:26:33 +02:00
Dan McGee
71efb148df commitpkg: make repo/server selection more modular
This gets rid of the ever-expanding conditional we had before and
replaces it with two case statements.

The first handles the command name. If it ends with 'pkg', we treat the
entire first part of the reponame, unless of course 'commitpkg' was
called directly. This allows one to add new symlinks such as
'gnome-unstablepkg'.

The second handles the server. Well-known repositories are listed and
passed to the appropriate server. All unusual repos are assumed to live
on gerolde and sent that direction.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-02 00:26:33 +02:00
Dan McGee
48ccc1c7fb Unify comment style
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-04-02 00:26:33 +02:00
Pierre Schmitz
563ffa7be8 prepare release 2011-03-28 14:59:00 +02:00
Rémy Oudompheng
f01097f22c Don't prefix package name with './' if package is in $PKGDEST
Commit ad593b8b61 introduces
a problem when $PKGDEST is set and the package to transfer
has an absolute pathname. In this case there is no need
to add anything to have rsync work properly.

Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-03-28 14:57:22 +02:00
Pierre Schmitz
ad593b8b61 prepare release 2011-03-26 14:34:07 +01:00
Allan McRae
e23c94675e Be less generic with package extension
Arch only uses .gz and .xz packages so look for .pkg.tar.?z.  This
prevents matching potential detached signature files.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-03-26 13:03:32 +01:00
Pierre Schmitz
96a11523e5 Update default makepkg.conf and pacman.conf to match the ones from pacman 3.5 2011-03-26 12:42:21 +01:00
Pierre Schmitz
bdde6e5a35 Merge branch 'master', remote-tracking branch 'heftig/master' 2011-03-26 09:58:28 +01:00
Ray Rashif
38f85d654a support optdepends
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-03-26 09:39:37 +01:00
Lukas Fleischer
2ed8ef1185 makechrootpkg: Copy package logs with split packages (fixes FS#23239).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-03-26 09:38:28 +01:00
Lukas Fleischer
aa06caf31c Abort properly if source files are not under version control (FS#23122).
Remove superfluous subshell code from version control checks in
commitpkg, making it exit properly if source files are not under version
control. Also, improve correctness of sed(1) commands and use fgrep(1)
instead of grep(1) where appropriate.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-03-26 09:37:03 +01:00
Dave Reisner
08a68bb4a0 commitpkg: prefix package filenames with ./
This is a hint to rsync that the file is a path and not a remote module
in the case of a package with an epoch in the version.

Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-03-23 20:46:00 +01:00
Florian Pritz
3bc5f6b5c9 add epoch support
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-03-23 19:03:10 +01:00
Jan Steffens
2fa8fdec47 Make default copydir user-dependent
Eases usage when chroots are shared between multiple users.
2011-03-22 19:47:48 +01:00
Jan Steffens
0af05a48ab Use Btrfs snapshots for chroot copies, when available
This is much faster than using Rsync to clone.

Rsync stays available when the chroots are not on a Btrfs.
2011-03-22 19:47:48 +01:00
Jan Steffens
174ff59dba Add flock-based locking to chroots
This prevents accidents when chroots are shared between multiple users.
2011-03-22 19:47:32 +01:00
Jan Steffens
5434d3991c Remove sudo from archbuild
Archbuild should be called via sudo.
2011-03-18 12:04:26 +01:00
Jan Steffens
36dc5d8792 Stop the PACKAGER= and MAKEFLAGS= from piling on
Repeatedly reusing the same chroot kept adding lines to makepkg.conf.
2011-03-18 12:04:26 +01:00
Jan Steffens
96f22cfede Use the multilib-devel group 2011-03-18 12:04:26 +01:00
Lukas Fleischer
8b9733661d Use variables in Makefile instead of hardcoding stuff in every target.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-18 12:04:23 +01:00
Lukas Fleischer
dbdb237519 Add ".PHONY" target to Makefile.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-18 12:03:38 +01:00
Lukas Fleischer
2ff5c45d14 makechrootpkg: Copy package logs with split packages (fixes FS#23239).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-18 11:28:45 +01:00
Lukas Fleischer
80168e7e1c Abort properly if source files are not under version control (FS#23122).
Remove superfluous subshell code from version control checks in
commitpkg, making it exit properly if source files are not under version
control. Also, improve correctness of sed(1) commands and use fgrep(1)
instead of grep(1) where appropriate.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-18 11:28:45 +01:00
Jan Steffens
f72297a639 Use readlink -e to canonicalize chrootdir 2011-03-14 02:31:26 +01:00
Jan Steffens
ba7cc139c4 Fix spelling 2011-03-14 02:31:26 +01:00
Jan Steffens
3491ea5d79 Syntax cleanup
No functional change.
2011-03-14 02:31:20 +01:00
Pierre Schmitz
d1304a3f1d prepare release 2011-01-08 17:31:53 +01:00
Pierre Schmitz
bcf8cd7eb1 mkarchroot: return 0 if there was no package to update in SyncFirst 2011-01-08 17:29:56 +01:00
Pierre Schmitz
95afa2e495 checkpkg: use sdiff -s to show differences in the file lists
This makes it much better readable especially for very large file lists.
2011-01-08 17:06:27 +01:00
Allan McRae
1094111559 checkpkg: get back to working directory after soname check
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-01-08 17:04:27 +01:00
Allan McRae
62860de113 checkpkg: Do not download oldpkg if in starting directory
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-01-08 17:04:18 +01:00
Pierre Schmitz
14ba11dcdf mkarchroot: pass inline shell script to chroot 2011-01-06 10:28:10 +01:00
Pierre Schmitz
be5505a54a prepare release 2011-01-06 09:25:55 +01:00
Pierre Schmitz
d09d34d77a mkarchroot: Ensure all packages have been updated
In reference to FS#22304 run pacman -Su again if there are still updates available.
This is the case for packages listed in SyncFirst.
2011-01-06 09:22:57 +01:00
Pierre Schmitz
5815d639f3 Accept any dir except a repos subdir as trunk 2010-12-14 15:13:06 +01:00
Pierre Schmitz
f804be7bbb prepare release 2010-12-12 23:34:13 +01:00
Pierre Schmitz
397f4cb04b makechrootpkg: The user nobody is only needed to run pacman 2010-12-09 12:51:47 +01:00
Allan McRae
f98eaebd1b Do not clean build directory on successful build
It is often useful to go back through build logs after building a
package and it is removed at the start of the next run anyway.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-12-09 10:35:13 +01:00
Pierre Schmitz
7a369b3c35 mkarchroot: add missing devices nodes
/dev/tty, /dev/tty0 and /dev/full
2010-12-04 15:03:15 +01:00
Pierre Schmitz
a17eaf3be8 prepare release 2010-12-02 16:53:11 +01:00
Pierre Schmitz
962d84c708 checkpkg: don't exclude libs ending with .so
See https://bugs.archlinux.org/task/21315
2010-12-02 16:50:23 +01:00
Pierre Schmitz
e06a4a7243 archbuild: update the root install instead of the working copy
This avoids updating the chroot on every call. See https://bugs.archlinux.org/task/21930
2010-12-02 13:37:13 +01:00
Pierre Schmitz
d6792db31c mkarchroot: create a minimal /dev instead of using the one of the host 2010-12-02 13:09:34 +01:00
Pierre Schmitz
372fb4e7d1 bugfix release 2010-11-22 19:14:47 +01:00
Andrea Scarpino
25133fcd17 Fetch the right architecture when a repo contains dash
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-11-22 16:07:14 +01:00
Pierre Schmitz
e3d2f1a020 prepare release 2010-11-18 00:28:25 +01:00
Pierre Schmitz
8440133032 archbuild: simplify multilib call 2010-11-17 22:10:21 +01:00
Pierre Schmitz
0adf83fadf Don't try to guess users architecture 2010-11-16 13:43:13 +01:00
Pierre Schmitz
ecc3fcf86d Explicitly install libtool-multilib when building multilib packages
This bypasses a strange pacman behaviour with the --noconfirm parameter.
2010-11-16 13:31:54 +01:00
Pierre Schmitz
394d9c8b54 Create pacman sync dir on chroot creation
See https://bugs.archlinux.org/task/21125
2010-11-16 13:27:33 +01:00
Pierre Schmitz
7a3550c903 commitpkg: pkgfile might be an absolute path when using PKGDEST 2010-10-19 07:44:35 +02:00
Pierre Schmitz
c290215aa6 prepare release 2010-10-17 14:33:40 +02:00
Andrea Scarpino
32b55d1587 install option (-I) does not require a directory containing a PKGBUILD
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-10-17 12:57:57 +02:00
Pierre Schmitz
6201853f52 install gcc-multilib for multilib-build by default 2010-10-17 12:57:48 +02:00
Florian Pritz
fbc3929ec0 commitpkg: error out if ~/staging/$repo doesn't exist
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-09-16 06:15:40 +02:00
Pierre Schmitz
8cb3bcc17b checkpkg: make diff output more readable 2010-09-11 20:17:41 +02:00
Pierre Schmitz
db7a90ccd2 Use pacman to determine the host's mirror 2010-09-11 19:25:54 +02:00
Pierre Schmitz
a9bfd8d2c9 ad support for multilib-testing 2010-09-11 19:09:05 +02:00
Pierre Schmitz
0d0e1a9079 repare release 2010-09-06 20:53:26 +02:00
Ionut Biru
b9ea05789d checkpkg: fix extracting soname bumps
extracting the tarball was done from the wrong directory

Signed-off-by: Ionut Biru <ibiru@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-09-06 20:28:14 +02:00
Pierre Schmitz
79ac757e7f add support for community-staging repository 2010-09-01 20:00:11 +02:00
Pierre Schmitz
a4eabcceaa add makepkg.conf for [multilib] 2010-08-22 21:54:17 +02:00
Pierre Schmitz
b591e69541 add initial [multilib] support 2010-08-22 21:52:23 +02:00
Pierre Schmitz
2f18ca1836 Use findmnt to generate a mtab
Instead of just copying the hosts mtab use findmnt. This way only reachable mount points are shown.
2010-08-22 20:26:33 +02:00
Pierre Schmitz
0ebc0b4b4b prepare release 2010-08-20 12:44:16 +02:00
Pierre Schmitz
9b001033ae Add archbuild helper script to create and build in chroots
This will create chroots on demand if needed.
2010-08-20 12:41:39 +02:00
Pierre Schmitz
ae5083fc11 source PKGBUILD before evaluating install and changelog files
This makes it possible to use e.g. install=$pkgname.install
2010-08-20 11:55:33 +02:00
Pierre Schmitz
6f4e865ff9 makechrootpkg: read packager and makeflags from makepkg.conf
also set some sane default options
2010-08-18 21:43:27 +02:00
Ionut Biru
000d68f7c6 copy packages into TEMPDIR
TEMPDIR is used before packages are copied into it and made it fail
because cannot find any.

Signed-off-by: Ionut Biru <ibiru@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-08-18 17:30:49 +02:00
Pierre Schmitz
fc6efdc38a reduce pacman's verbosity 2010-08-17 19:30:54 +02:00
Pierre Schmitz
87f5eb6300 Use host mirror in chroot environment
* Set first enabled mirror found mirrorlist as mirror within the chroot.
* If the mirror is local bind its directory read-only into the chroot.
* Fallback is the kernel.org mirror.
2010-08-17 19:23:16 +02:00
Pierre Schmitz
1a419e7974 add default config files for makepkg and pacman 2010-08-17 18:44:11 +02:00
Pierre Schmitz
1418bfbf42 Use default locale instead of copying from host
Use en_US.UTF-8 and de_DE.UTF-8 by default (the latter is needed for some packages like gcc)
2010-08-17 18:38:47 +02:00
Pierre Schmitz
f1c05d870b tagging 0.9.8 2010-08-17 08:33:23 +02:00
Pierre Schmitz
2e6d542220 add [staging] repository 2010-08-17 08:12:03 +02:00
Pierre Schmitz
cfddde22be Fix typo 2010-08-16 21:30:44 +02:00
Pierre Schmitz
f7b67c25ff Provide /dev/{shm,pts} within chroot
implements FS#20246
2010-08-12 18:26:07 +02:00
Pierre Schmitz
65d654a9d7 lddd: correct mktemp usage 2010-07-13 15:10:47 +02:00
Pierre Schmitz
cfdfbd99f8 checkpkg: Improve output message 2010-07-11 13:46:40 +02:00
Pierre Schmitz
a01ed3869c checkpkg: Use temporary working directory 2010-07-11 13:45:51 +02:00
Pierre Schmitz
e656ec7052 Check if ~/.makepkg.conf exists
Fixes FS#20041
2010-07-01 16:51:43 +02:00
Pierre Schmitz
dcc7b6728d prepare 0.9.7 release 2010-06-28 10:32:47 +02:00
Pierre Schmitz
88764c0298 local can only be used within functions 2010-06-28 10:26:38 +02:00
Pierre Schmitz
f2959b8dd5 check if changelog and install files are commited to svn 2010-06-28 09:54:50 +02:00
Pierre Schmitz
0564514df4 remove useless sourcing of PKGBUILD 2010-06-28 09:50:08 +02:00
Pierre Schmitz
edb24eb1a0 Simplify detection of changelog and install files
Thise code was copied from makepkg
2010-06-28 09:48:21 +02:00
Andrea Scarpino
a2132bc899 read {SRC, PKG}DEST from user makepkg.conf
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-06-28 09:35:20 +02:00
Eric Bélanger
964c0d1640 Fixed changelog support to work with makepkg 3.4
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-06-28 08:07:41 +02:00
Pierre Schmitz
76f3e25949 keep partially transferred files 2010-06-25 21:40:45 +02:00
Pierre Schmitz
85251a1d7b removed mode lines; was not a good idea after all 2010-06-24 10:01:20 +02:00
Eric Bélanger
27df94f51b commitpkg: add newline to make output look more orderly
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-06-22 17:09:49 +02:00
Pierre Schmitz
12eec95ff8 set version in Makefile 2010-05-02 15:46:51 +02:00
Pierre Schmitz
d4f00819ac copy namcap.log to working dir 2010-05-02 15:42:29 +02:00
Pierre Schmitz
4a4455c086 Set target CARCH before sourcing the PKGBUILD
CARCH might be used within the PKGBUILD to select correct sources
2010-05-02 15:23:54 +02:00
Pierre Schmitz
52e140f2fe exit 1 on build failure 2010-05-02 15:16:53 +02:00
Pierre Schmitz
48dead1af7 Force correct remote file permissions 2010-03-31 23:58:59 +02:00
Pierre Schmitz
17e875f6b3 makechrootpkg: Keep source files even if build fails
implementes FS#18437
2010-03-03 21:49:22 +01:00
Pierre Schmitz
a7c5010d24 Upload any pkg.tar.* file as long as it is canonical 2010-03-03 21:41:53 +01:00
Pierre Schmitz
f72775feac PKGEXT was not defined in the context 2010-03-03 21:38:59 +01:00
Pierre Schmitz
371f57b043 Don't check if package was released already
The checks aren't reliable enough and fail if the local repo is broken due to
network failures. So for now we just allways commit.
2010-02-22 19:11:17 +01:00
Pierre Schmitz
2fe5dbf904 be more fail safe 2010-02-22 08:13:43 +01:00
Eric Bélanger
5036f1250e mkarchroot: Added default pacman cache in usage help
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-02-21 19:34:11 +01:00
Pierre Schmitz
f00c8f66bd escape line breaks in find command 2010-02-17 23:55:05 +01:00
Pierre Schmitz
df4310025b Use svnversion insead of svn info 2010-02-17 18:27:09 +01:00
Pierre Schmitz
53a864a5aa Use local information to determine if a commit is needed 2010-02-17 18:05:16 +01:00
Pierre Schmitz
849e6c6de5 Check if package was already released 2010-02-17 15:24:54 +01:00
Dan McGee
62e4272ca2 commitpkg: dereference symlinks on package upload
This is a regression introduced after switching to rsync in place of scp;
scp dereferenced symlinks automatically without need for a command-line
option.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-02-17 06:11:48 +01:00
Pierre Schmitz
dd488b3c90 add dist target to Makefile 2010-02-13 20:57:34 +01:00
Pierre Schmitz
de38f347a7 add common gitignore file 2010-02-13 20:41:46 +01:00
Pierre Schmitz
362a99b995 apply common coding style 2010-02-13 19:47:16 +01:00
Allan McRae
7a8130fec8 Further fixes to cache_dir handling
1) Typo cachedir -> cache_dir
2) Use $cache_dir when calling pacman

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-02-13 15:55:23 +01:00
Allan McRae
a6e1f8cfd3 Read cachedir from pacman.conf in working dir
This allows setting a different cachedir for (e.g.) i686 and x86_64
chroots.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2010-02-13 09:57:49 +01:00
Pierre Schmitz
70d7baee68 set umask to 0022
this fixes commit 7ce9cd6965
2010-02-13 07:22:54 +01:00
Pierre Schmitz
59b7a739e8 inform the user of activities that might take a longer time 2010-02-13 04:03:10 +01:00
Pierre Schmitz
9e14e8691d Fall back to default if CacheDir is not set 2010-02-12 10:14:04 +01:00
Pierre Schmitz
c22a6014d7 supress confusing output of pushd and popd 2010-02-12 01:11:59 +01:00
Pierre Schmitz
d440e5998d copy files seperately to avoid escaping problems 2010-02-12 01:07:45 +01:00
Pierre Schmitz
611314a740 check install files, too 2010-02-11 23:48:06 +01:00
Pierre Schmitz
c39e59892d make sure pacman cache dir exists 2010-02-11 23:28:02 +01:00
Pierre Schmitz
f76261f073 don't cross filesystems. usefull if you bind a local mirror into your working copy 2010-02-11 23:27:30 +01:00
Pierre Schmitz
a37c07a8cb update comment 2010-02-11 15:27:24 +01:00
Pierre Schmitz
72a2b4789a abort if not all local source files are under version control
This looks a little hacky. The || true is needed because grep will return 1
if in fact everything is fine.

implements FS#18048
2010-02-11 15:19:13 +01:00
Pierre Schmitz
30cfcdc501 Add missing -n option to getopt list for mkarchroot
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-11 14:41:45 +01:00
Pierre Schmitz
f09baea392 Replace expensive merge with delete and copy 2010-02-11 14:25:20 +01:00
Pierre Schmitz
d68e7cb031 avoid useless output in commitpkg 2010-02-11 14:01:45 +01:00
Pierre Schmitz
106a0cddfe simplify and optimize upload process
Use rsync instead of scp to be able to continue uploads and get upload
verification for free.

We also try to commit to svn trunk first to avoid useless uploads (FS#18088).
2010-02-11 13:53:30 +01:00
Pierre Schmitz
0e43db65b2 Revert "add support for community svn"
This reverts commit 0346db0ff7.

This commit changed the expected behaviour of archco and truned it into a
more complex alias of "svn up <package>".
2010-02-11 12:50:01 +01:00
Pierre Schmitz
3e3b32641d Reduce verbosity to a sane minimum 2010-02-11 12:49:28 +01:00
Pierre Schmitz
16dd1fe6e0 Read pacman cache dir from pacman.conf or cli 2010-02-11 11:23:41 +01:00
Pierre Schmitz
f8ab1fb7a7 Create a working copy instead of using an union layer
Use rsync to create a (clean) working copy of the root dir instead of using aufs.
2010-02-11 10:26:45 +01:00
Pierre Schmitz
4ea489ad85 Move build and package logs to WORKDIR, otherwise it is lost 2010-02-11 09:14:56 +01:00
Ionut Biru
0346db0ff7 add support for community svn
Signed-off-by: Ionut Biru <ionut@archlinux.ro>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2010-01-11 13:41:04 -08:00
Nezmer
a1ede4dd4b devtools: make sure all files are owned by nobody before building
In makechrootpkg, build dirs are chowned to nobody before we move files
to "$uniondir/build". This could lead to failure If the files are
supposed to be dynamically upgraded when we run makepkg.

A common use-case is when we upgrade $pkgver in git,svn PKGBUILDS.

Signed-off-by: Nezmer <Nezmer@allurelinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2010-01-11 13:38:50 -08:00
Byron Clark
7ce9cd6965 Reset umask before touching the chroot.
This prevents problems when running with a umask that masks permissions
for others.

Signed-off-by: Byron Clark <byron@theclarkfamily.name>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2010-01-11 10:25:43 -08:00
Aaron Griffin
a7d88845a8 Remove sourcing of makepkg.conf files
This is replaced by commit marked "Use the host's SRCDEST and PKGDEST if
defined"

Noticed-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-12-18 09:01:44 -08:00
Eric Bélanger
ea4b0d0a67 makechrootpkg: Replaced DB_COMPRESSION with 'gz'
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
2009-12-16 12:49:25 -08:00
Aaron Griffin
0c17e0d9fc Use the host's SRCDEST and PKGDEST if defined
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Original-by: Eric Bélanger <snowmaniscool@gmail.com>
2009-12-16 10:54:59 -08:00
Ronald van Haren
6922cc39f0 Move the determination of unique .install files
Move this inside the split packages loop

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-28 11:59:48 -07:00
Eric Bélanger
61e8cd97fb checkpkg: Check package cache for old packages
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:20:58 -07:00
Eric Bélanger
23aa9719a8 checkpkg: Made wget quiet
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:20:51 -07:00
Eric Bélanger
40791b305f checkpkg: Added split package support
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:20:38 -07:00
Francois Charette
db962d9b7c Change loop var CARCH to _arch
This is just better practice, as CARCH means something else in
makepkg.conf

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:18:27 -07:00
Francois Charette
4fb916c824 Change "uploading to" message to be less ambiguous
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26 13:18:02 -07:00
Evangelos Foutras
169c33195f commitpkg: tidy quotes and remove unneeded braces
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:25:09 -07:00
Evangelos Foutras
86416b25b3 Move package verification into a separate function
Also switch to openssl and sha1 checksums.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:25:00 -07:00
Andrea Scarpino
fd82cb3eb7 makechrootpkg: Ensure SRC/PKGDEST are directories
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:22:49 -07:00
François Charette
54ae50500b commitpkg: tagged msg is now in archrelease
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:20:59 -07:00
François Charette
bb1ab73c74 archrelease: exit if working copy is not committed
Check with svn diff if the PKGBUILD etc has been committed,
and exit with an error message if not.

Also moved message from commitpkg to here.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:20:03 -07:00
François Charette
219ec9f196 checkpkg: Set CARCH=any when arch=any
Fixes FS#16419

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-06 09:18:02 -07:00
Daniel J Griffiths
14947cf645 commitpkg: Fix pushd for any packages
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:31:19 -07:00
Evangelos Foutras
381f91c336 commitpkg: introduce abort function for errors
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:06:25 -07:00
Evangelos Foutras
fa47bd1a17 commitpkg: correct svn commit message spacing
[Aaron: Remove trailing whitespace]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:02:26 -07:00
Evangelos Foutras
8130fd3846 commitpkg: upload all available architectures
Now commitpkg will go through each architecture defined in the PKGBUILD
and if all packages are present, it will upload them and run archrelease
for that architecture.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:01:11 -07:00
Evangelos Foutras
3d9c9c1b46 Move initialization code out of the upload loop
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:00:45 -07:00
Evangelos Foutras
70e48eff7a commitpkg: get rid of tabs and indent comments
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-23 12:00:00 -07:00
Francois Charette
e82825dd6d minor syntax fix
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-21 13:08:59 -07:00
Francois Charette
80061e2051 fix indentation
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-21 13:08:43 -07:00
Eric Bélanger
eebe3a49b7 makechrootpkg: Fixed add_to_db option check
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 15:02:41 -07:00
Aaron Griffin
06b02906b8 makechrootpkg: fixed copying of split packages
This patch fixed copying of packages with splitting (FS#16181)
It also adds missing quotes around chrootdir variable.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 14:54:50 -07:00
Aaron Griffin
71a6d2c895 Attempted fix for SRCDEST/PKGDEST parsing
- Do *not* overwrite the makepkg.conf in the chroot
- Source global makepkg configs for SRCDEST and PKGDEST

Original commit 4bc819a20e
by Evangelos Foutras <foutrelis@gmail.com>

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 14:04:02 -07:00
Aaron Griffin
3b383b50fc Remove some extra cleanup umounts
Leftovers from when we used to bind-mount PKGDEST and SRCDEST

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 13:30:36 -07:00
Francois Charette
29b19aaa8b Remove refs to commitpkg2any in Makefile
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 13:13:43 -07:00
Francois Charette
e1b0d23027 remove commitpkg2any
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 13:13:08 -07:00
Francois Charette
a5651376b4 Automate rm of repo-*86* when commiting "any" pkg
This commit integrates part of the functionality of commitpkg2any
in the standard commitpkg script. If the package is for arch=any
and there exists ../repos/$repo-{i686,x86_64}, then these are
removed.

NB: I believe commitpkg2any should be removed, as it encourages
converting a pkg to arch=any with the same $pkgver. It is better
practice to wait for a new version before releasing the pkg
with arch=any. It also saves bandwidth!

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 13:12:44 -07:00
Eric Blanger
9561089142 Fixed Makefile to install/uninstall new cmds
communityco, commitpkg2any and rebuildpkgs

Signed-off-by: Eric Blanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 11:59:48 -07:00
Aaron Griffin
92a83232e3 Revert "Don't copy makepkg.conf into the chroot"
This reverts commit 4bc819a20e.

Temporary revert until we get this sorted out

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 11:56:48 -07:00
Francois Charette
40251235a8 Fix indentation
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 11:55:34 -07:00
Daniel J Griffiths
c9d1b3457c Add support for community-testing repo
[Aaron: Added Makefile entries]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18 11:53:18 -07:00
Dan McGee
0a35566e2b Make commitpkg not lock up without a message 2009-09-14 21:00:30 -05:00
Eric Blanger
760c1c6c5f commitpkg: Added split package support
All packages created by the PKGBUILD are uploaded to the staging directory.
The output and svn commit messages uses pkgbase instead of pkgname.

Signed-off-by: Eric Blanger <snowmaniscool@gmail.com>
[Allan: minor fix for existing issue]
Signed-off-by: Allan McRae <allan@archlinux.org>
2009-09-02 16:10:31 +10:00
Allan McRae
f9aa28f895 makechrootpkg: fixed copying of .install files to chroot for split packages
Patch-by: Eric Bélanger <eric@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2009-09-01 22:27:19 +10:00
Allan McRae
30aab9b936 devtools: clean-up of commitpkg
- replaces backticks by $()
- removes support for package names without the arch in them (all our
repos now uses the arch in the package name)
- removes support for the obsolete and dead [unstable] repo

Patch-by: Eric Bélanger <eric@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2009-09-01 22:23:25 +10:00
Allan McRae
d8d0c87614 Changes required for new server layout
Signed-off-by: Allan McRae <allan@archlinux.org>
2009-09-01 11:13:38 +10:00
Evangelos Foutras
4bc819a20e Don't copy makepkg.conf into the chroot
Replacing the chroot's makepkg.conf with our own prevents us
from building i686 packages in a i686 chroot on a x86_64 host.

[Aaron: Plus additional whitespace edits]

Signed-off-by: Evangelos Foutras <foutrelis@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-18 16:25:00 -07:00
Aaron Griffin
d837403780 Add communityco like archco
Original-idea-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-18 15:52:54 -07:00
Aaron Griffin
568e21f1ac archco: Switch svn.archlinux.org -> archlinux.org
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-18 15:52:27 -07:00
Eric Bélanger
b7c19c56b8 makechrootpkg: Remove some extra packages
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-18 15:48:51 -07:00
Aaron Griffin
7fa8af659c Replace '>/dev/null 2>&1' with '&>/dev/null'
Original-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-12 13:51:12 -07:00
Eric Bélanger
032febfac4 Fix namcap errors and add PKGBUILD
[Aaron: swapped 2>&1 >/dev/null to >/dev/null 2>&1 to fix this better]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-12 13:48:34 -07:00
Eric Bélanger
b5955a0d59 makechrootpkg: Support for split packages
Move all built packages in the PKGDEST or WORKDIR (pkgname is now
an array).

Additional fixes for * inside quotes

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-12 13:45:58 -07:00
Daniel J Griffiths
47e7a3706b commitpkg: Add support for 'any' architecture
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-12 13:39:25 -07:00
Aaron Griffin
a3f1558b28 Change mode of commitpkg2any
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-06 14:57:21 -07:00
Biru Ionut
7c97db47cb fix copy the install files on split packages.
Signed-off-by: Biru Ionut <ionut@archlinux.ro>
[Aaron: Changed backtick syntax and added some quoting]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-06 14:56:44 -07:00
Aaron Griffin
2ba39720a0 Adjust commitpkg community server
Change community.archlinux.org to aur.archlinux.org to
coincide better with the location recommended for SVN checkouts

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-03 09:36:57 -07:00
Biru Ionut
04e79e71fd makechrootpkg: namcap path fix
Run namcap on the full path including /pkgdest/

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-30 11:38:38 -07:00
Aaron Griffin
360fcd2f0e svn: remove the default -m commit arg
This should force people to add a valid commit message
when updating PKGBUILDs and the like. Passing it on the
command line still works fine

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-12 08:54:36 -07:00
Aaron Griffin
e03dfc4665 Cause chroot buildscript to exit with error
If a build fails, exit the script with an error.
This also prevents namcap from being called if there
is no build package

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-12 07:53:32 -07:00
Pierre Schmitz
5dbb964d66 Use $PKGEXT defined in makepkg.conf
Also replace some uses of tar with bsdtar

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-05-13 09:41:44 -07:00
François Charette
1401d57115 commitpkg2any: New script
Added a script to convert an i686/x86_64 package to
an 'any' architecutre package in the SVN repos

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-05-06 12:38:40 -07:00
Aaron Griffin
2269e5c9c8 Replace unionfs with aufs
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-05-06 12:36:08 -07:00
Aaron Griffin
fef3f4af90 Cleanup some of the DB addition code
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-05-06 12:36:08 -07:00
Aaron Griffin
49947d8fb3 rebuildpkgs: misc bug fixes and changes
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-05-06 12:36:08 -07:00
Dan McGee
ea73c2b08b Add a few TODO notes for community compatibility
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-04-05 21:23:30 -05:00
Dan McGee
8deaebf69f commitpkg: rework for new community layout
Remove the community-specific code that calls tupkg. Make the server
variable a bit more dependent on what repo we are uploading to in order to
get community working, and finally create the correct symlinks for
communitypkg in the Makefile.

Note that this change will require the Arch devtools package to get a
replace entry for aurtools.

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-04-04 00:00:36 -05:00
Dan McGee
bcb0e39a0b Makefile cleanups
Don't link commitpkg to itself, and remove the unstablepkg symlinks.

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-04-03 23:55:12 -05:00
Aaron Griffin
70794e8dec makechrootpkg: remove 'local' keyword
Whoops. Not valid outside a function

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-03-09 12:27:55 -07:00
Aaron Griffin
f7c44611fe makechrootpkg: remove (pkg|src)dest mount check
This is no longer needed as we don't mount-bind PKGDEST or SRCDEST

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-03-09 12:27:09 -07:00
Aaron Griffin
b3b1cfba42 makechrootpkg: Don't fail if no chroot namcap
The call to namcap was causing the script to fail
if namcap didn't exist or returned 1. Fix that by
always returning 0...

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-03-09 12:24:43 -07:00
Aaron Griffin
486375ba0a makechrootpkg: Don't mount-bind srcdest/pkgdest
Do actual copying to and from PKGDEST and SRCDEST rather than
mounting via --bind, as the chown and other operations can cause
issues here

Original-work-by: Phil Dillon-Thiselton <dibblethewrecker@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-03-09 12:22:50 -07:00
Aaron Griffin
3a78a87739 Add rebuildpkgs script
This script should aid in mass-rebuilding packages under a chroot

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-03-03 10:00:39 -08:00
Aaron Griffin
d4dbb527dc Rename extrapkg to commitpkg
Also allow for uploads to any user-specified repo name

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-03-03 09:00:56 -08:00
Aaron Griffin
bf48e3ad8f makechrootpkg: Check for files before copying
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-02-26 15:33:02 -08:00
Aaron Griffin
9ec1e72e65 makechrootpkg: Allow setting rw layer dir name
Make the name of the rw layer (default <chrootdir>/rw) configurable
with a command line switch.

Useful for maintaining multipl chroots on top of a clean base.

i.e.
<chrootdir>/root  #clean chroot
<chrootdir>/rw    #default RW layer
<chrootdir>/gnome #a RW layer with all of gnome installed
<chrootdir>/kde   #a RW layer with all of KDE installed

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-02-26 10:51:35 -08:00
Aaron Griffin
97f7e2f2c3 Check mkarchroot's return code
We weren't doing this before, and after build steps were
being run even if the build failed or if the user cancelled
the build

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-02-25 10:11:39 -08:00
Aaron Griffin
f6f7a52f4b makechrootpkg: Use --noconfirm when updating
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-02-24 11:41:41 -08:00
Aaron Griffin
ca99683972 makechrootpkg: Add -d to add to local repo
When a package build is complete, it is automatically
added to a local db in <chrootdir>/rw/repo/

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-02-24 11:41:21 -08:00
Aaron Griffin
1d1eef1959 makechrootpkg: Remove $CHROOT_SHELL env var
This was kinda useless and complicated. We'll just force
-r usage

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-02-24 10:01:20 -08:00
Aaron Griffin
623acfaa9e Change makechrootpkg -i arg to -I
This way we don't conflict with makepkg's -i, which
could be useful to us

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-02-23 15:04:24 -08:00
Aaron Griffin
dd45bbcaf3 Add 'update first' flag and fix help
Add -u to update the chroot before building. This should update the
unionfs rw layer only, leaving the chroot clean. Useful for rebuilds
and a local repo.

Also fix the docs and document the -i flag

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-02-23 14:30:28 -08:00
Allan McRae
c67729af98 makechrootpkg - understand makepkg source syntax
The source line in a PKGBUILD can have a structure like
source=(´filename::url´).

Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-31 20:28:32 +10:00
Aaron Griffin
9dd60741bd Add a param to NOT copy config files to the chroot
This is primarilly needed for archiso creation, but
could be useful elsewhere.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-01-24 16:52:54 -06:00
Allan McRae
1b178621a5 Specify upload server in variable
This means people with different usernames on their local machine
only need to change a single line.

Original-patch-by: Vesa Kaihlavirta <vesa@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-10 00:11:59 +10:00
Aaron Griffin
aa39a8a11f Remove the 'add' dir from staging
This extra dir is largely useless. db-remove makes the del/
dir unnecessary, so lets kill the add/ dir too

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-11-21 13:38:21 -08:00
Eric Bélanger
d40455cabd Switch archco svn path: home -> srv
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-11-21 13:36:07 -08:00
Aaron Griffin
a80fe69f4b Only run locale-gen if the target root has /etc/locale.gen
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-10-20 01:09:43 -05:00
Thomas Bächler
80d0aa8912 Aaron broke it 2008-08-24 07:13:40 +02:00
Jason Chu
0dec86c4c3 Fix a typo in extrapkg 2008-05-10 11:05:20 -07:00
Aaron Griffin
182c12ec4a Remove suffix usage from extrapkg
The new dbscripts do not need this. All info can
be gathered from the $CARCH variable in the filename.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-05-06 18:31:19 -04:00
Aaron Griffin
4c56be5601 Allow makechrootpkg to install package files in the chroot
This is a very very hackish way to deal with rebuilds for
right now.

The intent is the following:
    First build foobar-1.2
    makechrootpkg -i foobar-1.2-1-i686.pkg.tar.gz
    Now build packages that depend on foobar-1.2

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-21 23:13:47 -05:00
Aaron Griffin
17ecb862f2 makechrootpkg: Always attempt to move pkg/src
Sometimes makepkg fails, but a package is built - for
instance, when makepkg cannot remove deps. In this case we
will attempt to move the pkg/src files regardless.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-21 22:56:58 -05:00
Aaron Griffin
6805bc54f4 Ensure archrelease is always run from a proper directory
It should only be run from a trunk dir containing a PKGBUILD

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-21 21:31:51 -05:00
Aaron Griffin
b54ddd2cf4 Create the 'repos' dir if it doesn't exist
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-21 21:25:41 -05:00
Jason Chu
0b36e8ecb3 Add a message that explains what to do when a merge conflict is detected and needs to be dealt with. 2008-04-20 13:30:00 -07:00
Travis Willard
f71a0fabb7 Copy ChangeLog into chroot too.
Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-14 11:19:33 -05:00
Aaron Griffin
718a6d802d Temporary workaround for unionfs issues
The latest incarnations of unionfs have issues appending
text via shell redirection, so to work around it, we can
touch the file before-hand to move it to the RW portion
of the union.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-14 11:18:09 -05:00
Jason Chu
bd6a5df0ab Start tracking svnmerge info when we create a branch
I thought it was tracked by default
2008-04-09 12:23:11 -07:00
Aaron Griffin
ba6e6648e9 Copy only the HEAD revision when releasing
This prevents the copying of local files and only
copies versioned files

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-08 01:53:18 -05:00
Aaron Griffin
d01f3d53e8 Add '64' suffix back to extrapkg
This was accidentally scrubbed, breaking 64bit uploads

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-08 01:48:43 -05:00
Aaron Griffin
fd04791f5b archrelease modifications to auto-commit handling
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-08 01:46:29 -05:00
Jason Chu
38dc2efcd5 Accept multiple package names to checkout with archco 2008-04-05 18:50:50 -07:00
Jason Chu
a78c8f2cb9 Fix a typo in archco -- now it has the proper url 2008-04-05 18:35:56 -07:00
Jason Chu
7c3bb0642a Update extrapkg to use svn & archrelease instead of cvs 2008-04-05 18:12:16 -07:00
Jason Chu
8842f31551 Add arch{co,release,rm} to devtools and make them install properly 2008-04-05 18:11:32 -07:00
Aaron Griffin
e76a1b2def Set $HOME before dropping permissions
Because we need a root user to chroot, when we drop
permissions to 'nobody', we're still using HOME=/root

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-03-17 12:55:24 -05:00
Simo Leone
e8490b3f14 Correcting an error in e0f139ad0e
If only you could have seen the facepalming going on...

Signed-off-by: Simo Leone <simo@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-07 23:42:32 -06:00
Dan McGee
ff1fc799c3 Add architecture-specific logic into extrapkg
This change will remove 4 needless sed lines from the PKGBUILD we use on
Arch for building this package and do the logic locally where it probably
makes more sense anyway. $CARCH should always be present as we fail if we
cannot find a correct makepkg.conf file in /etc/.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-06 22:15:34 -06:00
Simo Leone
0b0a7b3140 Change unionfs module loading
Checking /proc/filesystems for unionfs is
friendlier for kernels with unionfs builtin.
Also, a total lack of unionfs now causes
makechrootpkg to bail out.

Signed-off-by: Simo Leone <simo@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-06 10:10:14 -06:00
Simo Leone
e0f139ad0e Separate mounting from config copying
Copying the configs before installing stuff
caused conflicts. Running the host's pacman
uses the host's configuration anyway, so
there is no need to copy them in this case.

Signed-off-by: Simo Leone <simo@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-06 10:09:07 -06:00
Aaron Griffin
0410fb0a2f Add -r to the default makepkg args
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-29 11:41:21 -06:00
Aaron Griffin
3078cb535c Minor pathing cleanups
Reported-by: Jaroslaw Swierczynski <swiergot@juvepoland.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:38 -06:00
Aaron Griffin
484d36e931 Check for existing files when copying to chroot
Use basename when checking for files in the source array

This allows us to actually check for pre-downloaded
remote files and copy them to the build root as well.

Original-work-by: Jaroslaw Swierczynski <swiergot@juvepoland.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:38 -06:00
Aaron Griffin
a0ccba5622 Remove "use sudo" from default makechrootpkg makepkg args
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:38 -06:00
Aaron Griffin
a8a3c856bf Remove DBPath from mkarchroot
No longer needed in pacman 3.1

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:38 -06:00
Aaron Griffin
2c06da35d6 Don't clear build dir upon completion
Clear when creating the dir, and additionally DO not clear it if the user is
attempting to repack the package.

Original-work-by: Jaroslaw Swierczynski <swiergot@juvepoland.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:38 -06:00
Travis Willard
eb7646ca18 Ensure scp'ing the package file works when PKGDEST is defined.
Make the call to scp use $(basename $pkgfile) so that we don't get oddness.

Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:38 -06:00
Travis Willard
97d4a8bbd0 Ensure pkgurl is always fully-qualified pathname in checkpkg.
This keeps the pkgurl variable consistently fully-qualified, so that whenever we
use that variable we know it points straight at the package file.

Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:38 -06:00
Travis Willard
6748570413 Improve makepkg config loading for checkpkg and extrapkg.
Now, checkpkg and extrapkg will fail if /etc/makepkg.conf doesn't exist, and will also try to load in personal user's settings in ~/.makepkg.conf

Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:38 -06:00
Travis Willard
d853dee3ed Fix getopts bug and be more specific when moving package file.
My recent commit adding the -c option and renaming the old -c to -r accidentally left out the new '-r' option from the getopts call.  Additionally, add ${pkgrel} to the mv line after building to be more specific about that file to move.

Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:37 -06:00
Travis Willard
9e627e219e Copy makepkg.conf and ~/.makepkg.conf into chroot.
This change allows all packager-defined settings (such as PACKAGER or OPTIONS) to propogate into the chroot when building packages.

Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:37 -06:00
Damir Perisa
113f51fbc0 Output full path to package in finddeps
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:37 -06:00
Travis Willard
fc7f570aad Added support for makepkg's PKGDEST and SRCDEST params.
This ensures that sources and packages built inside makechrootpkg go where
the user expects them to, as defined in their /etc/makepkg.conf and
~/.makepkg.conf files.

Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:37 -06:00
Travis Willard
5eb176f471 Renamed -c option to -r (for "root") and added -c option (for clean).
The old -c option, which specified a 'chroot', has been renamed to -r, since
most other scripts use -r for a different root.  A new -c option is
introduced, which cleans all files from ${chrootdir}/rw before beginning,
thus ensuring a clean chroot.

Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:37 -06:00
Aaron Griffin
59d373a62b Use full filename for scp upload
Fix an issue where a missing add directory causes the package to be uploaded as
a file named "add"

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-01-23 16:11:37 -06:00
Aaron Griffin
bc8a791ad6 Copy resolv.conf each time just like mtab
Resolv.conf changes, like mtab, so we can't just trust it to copy on build only

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-28 22:18:26 -06:00
Aaron Griffin
4a829ff1f7 Force symlink creation in the install target
Allows us to run 'make install' even if the symlinks exist (helpful for testing
locally)

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-28 21:44:11 -06:00
Aaron Griffin
5472d5ab5a Fixed a typo (mkarchchroot -> mkarchroot)
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-28 21:28:29 -06:00
Dan McGee
f05495dfc8 Whitespace fixes/cleanup to all of the scripts
Add the same vim modeline to all the files, as well as cleanup the newly
added scripts a bit. If you look at this diff with the -w option, you'll see
it really isn't all that significant.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-28 21:20:24 -06:00
Aaron Griffin
c229a696a2 Add finddeps script from cvs-arch
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-28 21:00:07 -06:00
Aaron Griffin
e77986fc08 Add lddd script from cvs-arch
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-28 21:00:07 -06:00
Dan McGee
f7ab112f9a Use user's locale.gen instead of sed-magic
The sed-magic was wrong in many cases, including my default locale:
LANG=en_US.utf8
locale.gen line: en_US.UTF-8

If we copy the user's locale.gen file, we will generate all of their locales
instead of just the current one.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-28 14:44:59 -06:00
Dan McGee
0986936143 Allow user to see invalid chrootpath in error message
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-28 13:06:51 -06:00
Dan McGee
e23b176f3e Fix some bashisms (but change #! to /bin/bash)
We need to use bash due to the usage of arrays, but we might as well fix
some bashisms that were used in the scripts anyways.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-28 09:10:41 -06:00
Armin Luntzer
f92e01ed28 makechrootpkg: clarify usage message
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-27 16:45:28 -08:00
Armin Luntzer
ceb84394f9 makechrootpkg: Check if build was successful. Copy package to cwd and cleanup $chrootdir/rw/build on success, keep directory contents on failure.
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-27 16:45:28 -08:00
Armin Luntzer
e71c9784b5 mkarchroot: create $working_dir/etc (fixes error msg when trying to copy /etc/mtab during chroot creation)
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-27 16:45:28 -08:00
Armin Luntzer
e16136b8e8 mkarchroot: copy /etc/resolv.conf to chroot
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-27 16:45:28 -08:00
Armin Luntzer
9e660ee86e mkarchroot: add -M switch for a custom makepkg.conf
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-27 16:45:28 -08:00
Dan McGee
06a0d18bdc Add an uninstall target
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-27 18:15:00 -06:00
Dan McGee
84f29cd824 Clarify message when PKGBUILD does not exist and always have help available
makechrootpkg should check for a PKGBUILD and user credentials after the
option to print usage is granted.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-27 18:14:42 -06:00
Jason Chu
e32a2bb70c Make sure that build is owned by nobody, so that it can write to the directory 2007-11-04 15:44:53 -08:00
Jason Chu
974d8d11a6 Pass $MAKEPKG_ARGS as separate parameters to makepkg instead of one big string 2007-11-04 15:05:07 -08:00
Jason Chu
64ff97a171 Call mkarchroot not ./mkarchroot so that we can use makechrootpkg from any directory 2007-11-04 15:04:36 -08:00
Jason Chu
39aad4fe59 Escape the uniondir directory reference when creating $uniondir/etc/sudoers and set it to the proper permissions (440) 2007-11-04 15:02:55 -08:00
Jason Chu
411c07f2fb Copy the install file into the build directory because we need that too 2007-11-04 15:02:03 -08:00
Jason Chu
1e1e1e481e Accept options to makepkg after a -- so that we can accept longopts for makepkg and even options that are used by makechrootpkg 2007-11-04 15:01:22 -08:00
Jason Chu
bced48cecd Allow optional params to makechrootpkg (to actually accept extra makepkg args) 2007-11-04 14:56:43 -08:00
Jason Chu
e782cbd00b Copy mtab over to chroot so that pacman can detect disk space 2007-11-04 14:55:42 -08:00
Jason Chu
3ce2983ad6 Pass $RUN to chroot so that all the params are expanded properly 2007-11-04 14:55:02 -08:00
Jason Chu
b528eba028 Install the custom pacman.conf in the chroot so that it can be used for later updates 2007-11-03 09:57:26 -07:00
Daniel Isenmann
7bb2c48c8f add -C option to mkarchroot
Signed-off-by: Jason Chu <jchu@xentac.net>
2007-11-03 09:40:18 -07:00
35 changed files with 3093 additions and 460 deletions

18
.gitignore vendored Normal file
View File

@@ -0,0 +1,18 @@
*~
devtools-*.tar.gz*
archbuild
archco
archrelease
archrm
bash_completion
checkpkg
commitpkg
finddeps
lddd
makechrootpkg
mkarchroot
rebuildpkgs
zsh_completion
find-libdeps
crossrepomove
arch-nspawn

125
Makefile
View File

@@ -1,14 +1,115 @@
all:
V=20171108
PREFIX = /usr/local
BINPROGS = \
checkpkg \
commitpkg \
archco \
archrelease \
archrm \
archbuild \
lddd \
finddeps \
rebuildpkgs \
find-libdeps \
crossrepomove\
arch-nspawn \
mkarchroot \
makechrootpkg
CONFIGFILES = \
makepkg-x86_64.conf \
pacman-extra.conf \
pacman-testing.conf \
pacman-staging.conf \
pacman-multilib.conf \
pacman-multilib-testing.conf \
pacman-multilib-staging.conf \
pacman-kde-unstable.conf \
pacman-gnome-unstable.conf
COMMITPKG_LINKS = \
extrapkg \
corepkg \
testingpkg \
stagingpkg \
communitypkg \
community-testingpkg \
community-stagingpkg \
multilibpkg \
multilib-testingpkg \
multilib-stagingpkg \
kde-unstablepkg \
gnome-unstablepkg
ARCHBUILD_LINKS = \
extra-x86_64-build \
testing-x86_64-build \
staging-x86_64-build \
multilib-build \
multilib-testing-build \
multilib-staging-build \
kde-unstable-x86_64-build \
gnome-unstable-x86_64-build
CROSSREPOMOVE_LINKS = \
extra2community \
community2extra
BASHCOMPLETION_LINKS = \
archco \
communityco
all: $(BINPROGS) bash_completion zsh_completion
edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g"
%: %.in Makefile lib/common.sh
@echo "GEN $@"
@$(RM) "$@"
@{ echo -n 'm4_changequote([[[,]]])'; cat $@.in; } | m4 -P | $(edit) >$@
@chmod a-w "$@"
@chmod +x "$@"
@bash -O extglob -n "$@"
clean:
rm -f $(BINPROGS) bash_completion zsh_completion
install:
# extrapkg/checkpkg and friends
mkdir -p $(DESTDIR)/usr/bin
install -m 755 checkpkg $(DESTDIR)/usr/bin
install -m 755 extrapkg $(DESTDIR)/usr/bin
ln -s extrapkg $(DESTDIR)/usr/bin/corepkg
ln -s extrapkg $(DESTDIR)/usr/bin/testingpkg
ln -s extrapkg $(DESTDIR)/usr/bin/unstablepkg
# new chroot tools, only usable by root
mkdir -p $(DESTDIR)/usr/sbin
install -m 755 mkarchroot $(DESTDIR)/usr/sbin
install -m 755 makechrootpkg $(DESTDIR)/usr/sbin
install -dm0755 $(DESTDIR)$(PREFIX)/bin
install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools
install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin
install -m0644 ${CONFIGFILES} $(DESTDIR)$(PREFIX)/share/devtools
for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done
for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done
for l in ${CROSSREPOMOVE_LINKS}; do ln -sf crossrepomove $(DESTDIR)$(PREFIX)/bin/$$l; done
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
install -Dm0644 bash_completion $(DESTDIR)/usr/share/bash-completion/completions/devtools
for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools $(DESTDIR)/usr/share/bash-completion/completions/$$l; done
install -Dm0644 zsh_completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
uninstall:
for f in ${BINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${CONFIGFILES}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/$$f; done
for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
for l in ${CROSSREPOMOVE_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
rm $(DESTDIR)/usr/share/bash-completion/completions/devtools
rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
rm -f $(DESTDIR)$(PREFIX)/bin/communityco
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
dist:
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip -9 > devtools-$(V).tar.gz
gpg --detach-sign --use-agent devtools-$(V).tar.gz
upload:
scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/
check: $(BINPROGS) bash_completion makepkg-x86_64.conf PKGBUILD.proto
shellcheck $^
.PHONY: all clean install uninstall dist upload check
.DELETE_ON_ERROR:

48
PKGBUILD.proto Normal file
View File

@@ -0,0 +1,48 @@
#!/hint/bash
# shellcheck disable=2034
# This is an example PKGBUILD file, so that shellcheck can know what
# variables to expect be set after including a PKGBUILD.
# Maintainer: Your Name <youremail@domain.com>
pkgname=NAME
pkgver=VERSION
pkgrel=1
epoch=
pkgdesc=""
arch=()
url=""
license=('GPL')
groups=()
depends=()
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("$pkgname-$pkgver.tar.gz"
"$pkgname-$pkgver.patch")
noextract=()
md5sums=()
validpgpkeys=()
prepare() {
:
}
build() {
:
}
check() {
:
}
package() {
:
}

119
arch-nspawn.in Normal file
View File

@@ -0,0 +1,119 @@
#!/bin/bash
# License: GNU GPLv2
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
m4_include(lib/common.sh)
m4_include(lib/archroot.sh)
working_dir=''
files=()
usage() {
echo "Usage: ${0##*/} [options] working-dir [systemd-nspawn arguments]"
echo "A wrapper around systemd-nspawn. Provides support for pacman."
echo
echo ' options:'
echo ' -C <file> Location of a pacman config file'
echo ' -M <file> Location of a makepkg config file'
echo ' -c <dir> Set pacman cache'
echo ' -f <file> Copy file from the host to the chroot'
echo ' -s Do not run setarch'
echo ' -h This message'
exit 1
}
while getopts 'hC:M:c:f:s' arg; do
case "$arg" in
C) pac_conf="$OPTARG" ;;
M) makepkg_conf="$OPTARG" ;;
c) cache_dir="$OPTARG" ;;
f) files+=("$OPTARG") ;;
s) nosetarch=1 ;;
h|?) usage ;;
*) error "invalid argument '%s'" "$arg"; usage ;;
esac
done
shift $((OPTIND - 1))
(( $# < 1 )) && die 'You must specify a directory.'
check_root
working_dir=$(readlink -f "$1")
shift 1
[[ -z $working_dir ]] && die 'Please specify a working directory.'
if [[ -z $cache_dir ]]; then
cache_dirs=($(pacman -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g'))
else
cache_dirs=("$cache_dir")
fi
# shellcheck disable=2016
host_mirror=$(pacman --cachedir /doesnt/exist -Sddp extra/devtools 2>/dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#')
# shellcheck disable=2016
[[ $host_mirror == *file://* ]] && host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g')
# {{{ functions
build_mount_args() {
declare -g mount_args=()
if [[ -n $host_mirror_path ]]; then
mount_args+=("--bind-ro=$host_mirror_path")
fi
mount_args+=("--bind=${cache_dirs[0]}")
for cache_dir in "${cache_dirs[@]:1}"; do
mount_args+=("--bind-ro=$cache_dir")
done
}
copy_hostconf () {
cp -a /etc/pacman.d/gnupg "$working_dir/etc/pacman.d"
echo "Server = $host_mirror" >"$working_dir/etc/pacman.d/mirrorlist"
[[ -n $pac_conf ]] && cp "$pac_conf" "$working_dir/etc/pacman.conf"
[[ -n $makepkg_conf ]] && cp "$makepkg_conf" "$working_dir/etc/makepkg.conf"
local file
for file in "${files[@]}"; do
mkdir -p "$(dirname "$working_dir$file")"
cp -T "$file" "$working_dir$file"
done
sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n "${cache_dirs[@]}")|g" -i "$working_dir/etc/pacman.conf"
}
# }}}
umask 0022
# Sanity check
if [[ ! -f "$working_dir/.arch-chroot" ]]; then
die "'%s' does not appear to be an Arch chroot." "$working_dir"
elif [[ $(cat "$working_dir/.arch-chroot") != "$CHROOT_VERSION" ]]; then
die "chroot '%s' is not at version %s. Please rebuild." "$working_dir" "$CHROOT_VERSION"
fi
build_mount_args
copy_hostconf
eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")"
[[ -z $nosetarch ]] || unset CARCH
exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \
-D "$working_dir" \
-E "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin" \
--register=no --keep-unit --as-pid2 \
"${mount_args[@]}" \
"$@"

78
archbuild.in Normal file
View File

@@ -0,0 +1,78 @@
#!/bin/bash
# License: Unspecified
m4_include(lib/common.sh)
m4_include(lib/archroot.sh)
base_packages=(base-devel)
makechrootpkg_args=(-c -n)
cmd="${0##*/}"
if [[ "${cmd%%-*}" == 'multilib' ]]; then
repo="${cmd%-build}"
arch='x86_64'
base_packages+=(multilib-devel)
else
tag="${cmd%-build}"
repo=${tag%-*}
arch=${tag##*-}
fi
chroots='/var/lib/archbuild'
clean_first=false
usage() {
echo "Usage: $cmd [options] -- [makechrootpkg args]"
echo ' -h This help'
echo ' -c Recreate the chroot before building'
echo ' -r <dir> Create chroots in this directory'
echo ''
echo "Default makechrootpkg args: ${makechrootpkg_args[*]}"
echo ''
exit 1
}
while getopts 'hcr:' arg; do
case "${arg}" in
c) clean_first=true ;;
r) chroots="$OPTARG" ;;
*) usage ;;
esac
done
check_root
# Pass all arguments after -- right to makepkg
makechrootpkg_args+=("${@:$OPTIND}")
if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
msg "Creating chroot for [%s] (%s)..." "${repo}" "${arch}"
for copy in "${chroots}/${repo}-${arch}"/*; do
[[ -d $copy ]] || continue
msg2 "Deleting chroot copy '%s'..." "$(basename "${copy}")"
lock 9 "$copy.lock" "Locking chroot copy '%s'" "$copy"
subvolume_delete_recursive "${copy}"
rm -rf --one-file-system "${copy}"
done
lock_close 9
rm -rf --one-file-system "${chroots}/${repo}-${arch}"
mkdir -p "${chroots}/${repo}-${arch}"
setarch "${arch}" mkarchroot \
-C "@pkgdatadir@/pacman-${repo}.conf" \
-M "@pkgdatadir@/makepkg-${arch}.conf" \
"${chroots}/${repo}-${arch}/root" \
"${base_packages[@]}" || abort
else
lock 9 "${chroots}/${repo}-${arch}/root.lock" "Locking clean chroot"
arch-nspawn \
-C "@pkgdatadir@/pacman-${repo}.conf" \
-M "@pkgdatadir@/makepkg-${arch}.conf" \
"${chroots}/${repo}-${arch}/root" \
pacman -Syu --noconfirm || abort
fi
msg "Building in chroot for [%s] (%s)..." "${repo}" "${arch}"
exec makechrootpkg -r "${chroots}/${repo}-${arch}" "${makechrootpkg_args[@]}"

25
archco.in Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
# License: Unspecified
m4_include(lib/common.sh)
scriptname=${0##*/}
if [[ -z $1 ]]; then
printf 'Usage: %s <package name>...\n' "$scriptname"
exit 1
fi
case $scriptname in
archco)
SVNURL="svn+ssh://svn-packages@repos.archlinux.org/srv/repos/svn-packages/svn";;
communityco)
SVNURL="svn+ssh://svn-community@repos.archlinux.org/srv/repos/svn-community/svn";;
*)
die "Couldn't find svn url for %s" "$scriptname"
;;
esac
for i in "$@"; do
svn co "$SVNURL/$i"
done

90
archrelease.in Normal file
View File

@@ -0,0 +1,90 @@
#!/bin/bash
# License: Unspecified
m4_include(lib/common.sh)
m4_include(lib/valid-tags.sh)
# parse command line options
FORCE=
while getopts ':f' flag; do
case $flag in
f) FORCE=1 ;;
:) die "Option requires an argument -- '%s'" "$OPTARG" ;;
\?) die "Invalid option -- '%s'" "$OPTARG" ;;
esac
done
shift $(( OPTIND - 1 ))
if ! (( $# )); then
echo 'Usage: archrelease [-f] <repo>...'
exit 1
fi
# validate repo is really repo-arch
if [[ -z $FORCE ]]; then
for tag in "$@"; do
if ! in_array "$tag" "${_tags[@]}"; then
die "archrelease: Invalid tag: '%s' (use -f to force release)" "$tag"
fi
done
fi
if [[ ! -f PKGBUILD ]]; then
die 'archrelease: PKGBUILD not found'
fi
trunk=${PWD##*/}
# Normally this should be trunk, but it may be something
# such as 'gnome-unstable'
IFS='/' read -r -d '' -a parts <<< "$PWD"
if [[ "${parts[*]:(-2):1}" == "repos" ]]; then
die 'archrelease: Should not be in repos dir (try from trunk/)'
fi
unset parts
if [[ $(svn status -q) ]]; then
die 'archrelease: You have not committed your changes yet!'
fi
pushd .. >/dev/null
IFS=$'\n' read -r -d '' -a known_files < <(svn ls -r HEAD "$trunk")
for file in "${known_files[@]}"; do
if [[ ${file:(-1)} = '/' ]]; then
die "archrelease: subdirectories are not supported in package directories!"
fi
done
# gracefully handle files containing an "@" character
known_files=("${known_files[@]/%/@}")
# update repo directory first to avoid a commit failure
svn up repos
for tag in "$@"; do
stat_busy "Copying %s to %s" "${trunk}" "${tag}"
if [[ -d repos/$tag ]]; then
declare -a trash
trash=()
while read -r file; do
trash+=("repos/$tag/$file")
done < <(svn ls "repos/$tag")
[[ ${#trash[@]} == 0 ]] || svn rm -q "${trash[@]/%/@}"
else
mkdir -p "repos/$tag"
svn add --parents -q "repos/$tag"
fi
# copy all files at once from trunk to the subdirectory in repos/
svn copy -q -r HEAD "${known_files[@]/#/$trunk/}" "repos/$tag/"
stat_done
done
stat_busy "Releasing package"
printf -v tag_list ", %s" "$@"; tag_list="${tag_list#, }"
svn commit -q -m "archrelease: copy ${trunk} to $tag_list" || abort
stat_done
popd >/dev/null

16
archrm.in Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
# License: Unspecified
m4_include(lib/common.sh)
if [[ -z $1 ]]; then
echo 'Usage: archrm <path to checkout>'
exit 1
fi
# FIXME: Check if there are uncommited changes
#pushd $1
#
#popd
rm -rf "$1"

89
bash_completion.in Normal file
View File

@@ -0,0 +1,89 @@
#!/hint/bash
# License: Unspecified
_devtools_compgen() {
local i r
COMPREPLY=($(compgen -W '$*' -- "$cur"))
for ((i=1; i < ${#COMP_WORDS[@]}-1; i++)); do
for r in "${!COMPREPLY[@]}"; do
if [[ ${COMP_WORDS[i]} = "${COMPREPLY[r]}" ]]; then
unset 'COMPREPLY[r]'; break
fi
done
done
}
_archco_pkg() {
_devtools_compgen "$(
command pacman "-$1"
)"
}
_archco() {
local cur prev
COMPREPLY=()
cur=$(_get_cword)
prev=${COMP_WORDS[COMP_CWORD-1]}
_archco_pkg Slq
true
} &&
complete -F _archco archco communityco
_makechrootpkg() {
local cur
COMPREPLY=()
_get_comp_words_by_ref cur
case $cur in
-*)
COMPREPLY=( $( compgen -W '-I -c -h -l -r -u' -- "$cur" ) )
;;
*)
_filedir
return 0
;;
esac
true
} &&
complete -F _makechrootpkg makechrootpkg
_mkarchroot() {
local cur
COMPREPLY=()
_get_comp_words_by_ref cur
case $cur in
-*)
COMPREPLY=( $( compgen -W '-C -M -c -h' -- "$cur" ) )
;;
*)
_filedir
return 0
;;
esac
true
} &&
complete -F _mkarchroot mkarchroot
_arch-nspawn() {
local cur
COMPREPLY=()
_get_comp_words_by_ref cur
case $cur in
-*)
COMPREPLY=( $( compgen -W '-C -M -c -h' -- "$cur" ) )
;;
*)
_filedir
return 0
;;
esac
true
} &&
complete -F _arch-nspawn arch-nspawn
# ex:et ts=2 sw=2 ft=sh

View File

@@ -1,75 +0,0 @@
#!/bin/bash
source /etc/makepkg.conf
strip_url() {
echo $1 | sed 's|^.*://.*/||g'
}
if [ ! -f PKGBUILD ]; then
echo "This must be run in the directory of a built package."
exit 1
fi
source PKGBUILD
pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}.pkg.tar.gz
oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
if [ ! -f $pkgfile ]; then
if [ -f $PKGDEST/$pkgfile ]; then
pkgfile=$PKGDEST/$pkgfile
oldstylepkgfile=$PKGDEST/$oldstylepkgfile
elif [ -f $oldstylepkgfile ]; then
pkgfile=$oldstylepkgfile
elif [ -f $PKGDEST/$oldstylepkgfile ]; then
pkgfile=$PKGDEST/$oldstylepkgfile
else
echo "File $pkgfile doesn't exist"
exit 1
fi
fi
tmp=`pacman -Spd --noconfirm $pkgname`
if [ $? -ne 0 ]; then
echo "Couldn't download previous package."
exit 1
fi
pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev`
oldpkg=`strip_url $pkgurl`
if [ "$oldpkg" = "$pkgfile" ]; then
echo "The built package is the one in the repo right now!"
exit 1
fi
if [ ! -f $oldpkg ]; then
if echo $pkgurl | grep "^file:///" > /dev/null 2>&1; then
cp `echo $pkgurl | sed 's#^file://##'` .
else
wget $pkgurl
fi
fi
tar tzf $oldpkg > filelist-old
tar tzf $pkgfile > filelist
sort -o filelist filelist
sort -o filelist-old filelist-old
diff filelist-old filelist
if diff filelist-old filelist | grep '\.so\.' > /dev/null 2>&1; then
mkdir -p pkg
cd pkg
tar xzf ../$pkgfile > /dev/null
for i in `diff ../filelist-old ../filelist | grep \> | grep \.so\. | awk '{print $2}'`; do
echo -n "${i}: "
objdump -p $i | grep SONAME
done
else
echo "No filename differences"
fi

80
checkpkg.in Normal file
View File

@@ -0,0 +1,80 @@
#!/bin/bash
# License: Unspecified
shopt -s extglob
m4_include(lib/common.sh)
# Source makepkg.conf; fail if it is not found
if [[ -r '/etc/makepkg.conf' ]]; then
# shellcheck source=makepkg-x86_64.conf
source '/etc/makepkg.conf'
else
die '/etc/makepkg.conf not found!'
fi
# Source user-specific makepkg.conf overrides
if [[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" ]]; then
# shellcheck source=/dev/null
source "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf"
elif [[ -r "$HOME/.makepkg.conf" ]]; then
# shellcheck source=/dev/null
source "$HOME/.makepkg.conf"
fi
if [[ ! -f PKGBUILD ]]; then
die 'This must be run in the directory of a built package.'
fi
# shellcheck source=PKGBUILD.proto
. ./PKGBUILD
if [[ ${arch[0]} == 'any' ]]; then
CARCH='any'
fi
STARTDIR=$(pwd)
TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
for _pkgname in "${pkgname[@]}"; do
target_pkgver=$(get_full_version "$_pkgname")
if ! pkgfile=$(find_cached_package "$_pkgname" "$target_pkgver" "$CARCH"); then
die 'tarball not found for package: %s' "${_pkgname}-$target_pkgver"
fi
ln -s "$pkgfile" "$TEMPDIR"
pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname") ||
die "Couldn't download previous package for %s." "$_pkgname"
oldpkg=${pkgurl##*://*/}
if [[ ${oldpkg##*/} = "${pkgfile##*/}" ]]; then
die "The built package (%s) is the one in the repo right now!" "$_pkgname"
fi
if [[ $pkgurl = file://* ]]; then
ln -s "${pkgurl#file://}" "$TEMPDIR/$oldpkg"
elif [[ -f "$PKGDEST/$oldpkg" ]]; then
ln -s "$PKGDEST/$oldpkg" "$TEMPDIR/$oldpkg"
elif [[ -f "$STARTDIR/$oldpkg" ]]; then
ln -s "$STARTDIR/$oldpkg" "$TEMPDIR/$oldpkg"
else
curl -fsLC - --retry 3 --retry-delay 3 -o "$TEMPDIR/$oldpkg" "$pkgurl"
fi
bsdtar tf "$TEMPDIR/$oldpkg" | sort > "$TEMPDIR/filelist-$_pkgname-old"
bsdtar tf "$pkgfile" | sort > "$TEMPDIR/filelist-$_pkgname"
sdiff -s "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname"
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"
if ! diff_output="$(sdiff -s "$TEMPDIR/libraries-$_pkgname-old" "$TEMPDIR/libraries-$_pkgname")"; then
msg "Sonames differ in $_pkgname!"
echo "$diff_output"
else
msg "No soname differences for %s." "$_pkgname"
fi
done
msg "Files saved to %s" "$TEMPDIR"

209
commitpkg.in Normal file
View File

@@ -0,0 +1,209 @@
#!/bin/bash
# License: Unspecified
m4_include(lib/common.sh)
# Source makepkg.conf; fail if it is not found
if [[ -r '/etc/makepkg.conf' ]]; then
# shellcheck source=makepkg-x86_64.conf
source '/etc/makepkg.conf'
else
die '/etc/makepkg.conf not found!'
fi
# Source user-specific makepkg.conf overrides
if [[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" ]]; then
# shellcheck source=/dev/null
source "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf"
elif [[ -r "$HOME/.makepkg.conf" ]]; then
# shellcheck source=/dev/null
source "$HOME/.makepkg.conf"
fi
cmd=${0##*/}
if [[ ! -f PKGBUILD ]]; then
die 'No PKGBUILD file'
fi
source=()
# shellcheck source=PKGBUILD.proto
. ./PKGBUILD
pkgbase=${pkgbase:-$pkgname}
case "$cmd" in
commitpkg)
if (( $# == 0 )); then
die 'Usage: commitpkg <reponame> [-f] [-s server] [-l limit] [-a arch] [commit message]'
fi
repo="$1"
shift
;;
*pkg)
repo="${cmd%pkg}"
;;
*)
die 'Usage: commitpkg <reponame> [-f] [-s server] [-l limit] [-a arch] [commit message]'
;;
esac
# find files which should be under source control
needsversioning=()
for s in "${source[@]}"; do
[[ $s != *://* ]] && needsversioning+=("$s")
done
for i in 'changelog' 'install'; do
while read -r file; do
# evaluate any bash variables used
eval "file=\"$(sed "s/^\(['\"]\)\(.*\)\1\$/\2/" <<< "$file")\""
needsversioning+=("$file")
done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)
done
# assert that they really are controlled by SVN
if (( ${#needsversioning[*]} )); then
# svn status's output is only two columns when the status is unknown
while read -r status filename; do
[[ $status = '?' ]] && unversioned+=("$filename")
done < <(svn status -v "${needsversioning[@]}")
(( ${#unversioned[*]} )) && die "%s is not under version control" "${unversioned[@]}"
fi
rsyncopts=(-e ssh -p '--chmod=ug=rw,o=r' -c -h -L --progress --partial -y)
archreleaseopts=()
while getopts ':l:a:s:f' flag; do
case $flag in
f) archreleaseopts+=('-f') ;;
s) server=$OPTARG ;;
l) rsyncopts+=("--bwlimit=$OPTARG") ;;
a) commit_arch=$OPTARG ;;
:) die "Option requires an argument -- '%s'" "$OPTARG" ;;
\?) die "Invalid option -- '%s'" "$OPTARG" ;;
esac
done
shift $(( OPTIND - 1 ))
# check packages have the packager field set
for _arch in "${arch[@]}"; do
if [[ -n $commit_arch && ${_arch} != "$commit_arch" ]]; then
continue
fi
for _pkgname in "${pkgname[@]}"; do
fullver=$(get_full_version "$_pkgname")
if pkgfile=$(find_cached_package "$_pkgname" "$_arch" "$fullver"); then
if grep -q "packager = Unknown Packager" <(bsdtar -xOqf "$pkgfile" .PKGINFO); then
die "PACKAGER was not set when building package"
fi
fi
done
done
if [[ -z $server ]]; then
server='repos.archlinux.org'
fi
if [[ -n $(svn status -q) ]]; then
msgtemplate="upgpkg: $pkgbase $(get_full_version)"$'\n\n'
if [[ -n $1 ]]; then
stat_busy 'Committing changes to trunk'
svn commit -q -m "${msgtemplate}${1}" || die
stat_done
else
msgfile="$(mktemp)"
echo "$msgtemplate" > "$msgfile"
if [[ -n $SVN_EDITOR ]]; then
$SVN_EDITOR "$msgfile"
elif [[ -n $VISUAL ]]; then
$VISUAL "$msgfile"
elif [[ -n $EDITOR ]]; then
$EDITOR "$msgfile"
else
vi "$msgfile"
fi
[[ -s $msgfile ]] || die
stat_busy 'Committing changes to trunk'
svn commit -q -F "$msgfile" || die
unlink "$msgfile"
stat_done
fi
fi
declare -a uploads
declare -a commit_arches
declare -a skip_arches
for _arch in "${arch[@]}"; do
if [[ -n $commit_arch && ${_arch} != "$commit_arch" ]]; then
skip_arches+=("$_arch")
continue
fi
for _pkgname in "${pkgname[@]}"; do
fullver=$(get_full_version "$_pkgname")
if ! pkgfile=$(find_cached_package "$_pkgname" "$fullver" "${_arch}"); then
warning "Skipping %s: failed to locate package file" "$_pkgname-$fullver-$_arch"
skip_arches+=("$_arch")
continue 2
fi
uploads+=("$pkgfile")
sigfile="${pkgfile}.sig"
if [[ ! -f $sigfile ]]; then
msg "Signing package %s..." "${pkgfile}"
if [[ -n $GPGKEY ]]; then
SIGNWITHKEY=(-u "${GPGKEY}")
fi
gpg --detach-sign --use-agent --no-armor "${SIGNWITHKEY[@]}" "${pkgfile}" || die
fi
if ! gpg --verify "$sigfile" >/dev/null 2>&1; then
die "Signature %s.sig is incorrect!" "$pkgfile"
fi
uploads+=("$sigfile")
done
done
for _arch in "${arch[@]}"; do
if ! in_array "$_arch" "${skip_arches[@]}"; then
commit_arches+=("$_arch")
fi
done
if [[ ${#commit_arches[*]} -gt 0 ]]; then
archrelease "${archreleaseopts[@]}" "${commit_arches[@]/#/$repo-}" || die
fi
if [[ ${#uploads[*]} -gt 0 ]]; then
new_uploads=()
# convert to absolute paths so rsync can work with colons (epoch)
while read -r -d '' upload; do
new_uploads+=("$upload")
done < <(realpath -z "${uploads[@]}")
uploads=("${new_uploads[@]}")
unset new_uploads
msg 'Uploading all package and signature files'
rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die
fi
if [[ "${arch[*]}" == 'any' ]]; then
if [[ -d ../repos/$repo-x86_64 ]]; then
pushd ../repos/ >/dev/null
stat_busy "Removing %s" "$repo-x86_64"
svn rm -q "$repo-x86_64"
svn commit -q -m "Removed $repo-x86_64 for $pkgname"
stat_done
popd >/dev/null
fi
else
if [[ -d ../repos/$repo-any ]]; then
pushd ../repos/ >/dev/null
stat_busy "Removing %s" "$repo-any"
svn rm -q "$repo-any"
svn commit -q -m "Removed $repo-any for $pkgname"
stat_done
popd >/dev/null
fi
fi

86
crossrepomove.in Normal file
View File

@@ -0,0 +1,86 @@
#!/bin/bash
# License: Unspecified
m4_include(lib/common.sh)
scriptname=${0##*/}
if [[ -z $1 ]]; then
printf 'Usage: %s [pkgbase]\n' "$scriptname"
exit 1
fi
pkgbase="${1}"
case $scriptname in
extra2community)
source_name='packages'
target_name='community'
source_repo='extra'
target_repo='community'
;;
community2extra)
source_name='community'
target_name='packages'
source_repo='community'
target_repo='extra'
;;
*)
die "Couldn't find configuration for %s" "$scriptname"
;;
esac
server='repos.archlinux.org'
source_svn="svn+ssh://svn-${source_name}@${server}/srv/repos/svn-${source_name}/svn"
target_svn="svn+ssh://svn-${target_name}@${server}/srv/repos/svn-${target_name}/svn"
source_dbscripts="/srv/repos/svn-${source_name}/dbscripts"
target_dbscripts="/srv/repos/svn-${target_name}/dbscripts"
setup_workdir
pushd "$WORKDIR" >/dev/null
msg "Downloading sources for %s" "${pkgbase}"
svn -q checkout -N "${target_svn}" target_checkout
mkdir -p "target_checkout/${pkgbase}/repos"
svn -q export "${source_svn}/${pkgbase}/trunk" "target_checkout/${pkgbase}/trunk" || die
# shellcheck source=PKGBUILD.proto
. "target_checkout/${pkgbase}/trunk/PKGBUILD"
msg "Downloading packages for %s" "${pkgbase}"
for _arch in "${arch[@]}"; do
if [[ "${_arch[*]}" == 'any' ]]; then
repo_arch='x86_64'
else
repo_arch=${_arch}
fi
for _pkgname in "${pkgname[@]}"; do
fullver=$(get_full_version "$_pkgname")
pkgpath="/srv/ftp/$source_repo/os/$repo_arch/$_pkgname-$fullver-${_arch}.pkg.tar.*"
# shellcheck disable=2029
ssh "$server" "cp $pkgpath staging/$target_repo" || die
done
done
msg "Adding %s to %s" "${pkgbase}" "${target_repo}"
svn -q add "target_checkout/${pkgbase}"
svn -q propset svn:keywords 'Id' "target_checkout/${pkgbase}/trunk/PKGBUILD"
svn -q commit -m"${scriptname}: Moving ${pkgbase} from ${source_repo} to ${target_repo}" target_checkout
pushd "target_checkout/${pkgbase}/trunk" >/dev/null
archrelease "${arch[@]/#/$target_repo-}" || die
popd >/dev/null
# shellcheck disable=2029
ssh "${server}" "${target_dbscripts}/db-update" || die
msg "Removing %s from %s" "${pkgbase}" "${source_repo}"
for _arch in "${arch[@]}"; do
# shellcheck disable=2029
ssh "${server}" "${source_dbscripts}/db-remove ${source_repo} ${_arch} ${pkgbase}"
done
svn -q checkout -N "${source_svn}" source_checkout
svn -q up "source_checkout/${pkgbase}"
svn -q rm "source_checkout/${pkgbase}"
svn -q commit -m"${scriptname}: Moving ${pkgbase} from ${source_repo} to ${target_repo}" source_checkout
popd >/dev/null

103
extrapkg
View File

@@ -1,103 +0,0 @@
#!/bin/bash
source /etc/makepkg.conf
cmd=`basename $0`
if [ ! -f PKGBUILD ]; then
echo "No PKGBUILD file"
exit 1
fi
source PKGBUILD
pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}.pkg.tar.gz
oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
if [ ! -f $pkgfile ]; then
if [ -f $PKGDEST/$pkgfile ]; then
pkgfile=$PKGDEST/$pkgfile
oldstylepkgfile=$PKGDEST/$oldstylepkgfile
elif [ -f $oldstylepkgfile ]; then
pkgfile=$oldstylepkgfile
elif [ -f $PKGDEST/$oldstylepkgfile ]; then
pkgfile=$PKGDEST/$oldstylepkgfile
else
echo "File $pkgfile doesn't exist"
exit 1
fi
fi
if [ "$cmd" == "extrapkg" ]; then
repo="extra"
tag="CURRENT"
elif [ "$cmd" == "corepkg" ]; then
repo="core"
tag="CURRENT"
elif [ "$cmd" == "testingpkg" ]; then
repo="testing"
tag="TESTING"
elif [ "$cmd" == "unstablepkg" ]; then
repo="unstable"
tag="CURRENT"
elif [ "$cmd" == "communitypkg" ]; then
repo="community"
tag="CURRENT"
fi
# see if any limit options were passed, we'll send them to SCP
unset scpopts
if [ "$1" = "-l" ]; then
scpopts="$1 $2"
shift 2
fi
if [ "$repo" != "community" ]; then
scp ${scpopts} ${pkgfile} archlinux.org:staging/$repo/add
if [ "$(md5sum ${pkgfile} | cut -d' ' -f1)" != "$(ssh archlinux.org md5sum staging/${repo}/add/$(basename ${pkgfile}) | cut -d' ' -f1)" ]; then
echo "File got corrupted during upload, cancelled."
exit 1
else
echo "File integrity okay."
fi
else
if [ ! -f ~/.tupkg ]; then
echo "Must configure tupkg via ~/.tupkg, cancelled"
exit 1
fi
if [ "$(basename $pkgfile)" != "$(basename $oldstylepkgfile)" ]; then
echo "Renaming makepkg3 package for compatability"
mv $pkgfile $oldstylepkgfile
pkgfile=$oldstylepkgfile
fi
tupkg $pkgfile
fi
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Uploaded $pkgfile"
if [ "$1" != "" ]; then
cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel
$1" > /dev/null
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel
$1\" message"
else
cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel" > /dev/null
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel\" message"
fi
cvs tag -c -F -R $tag > /dev/null
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Tagged as $tag"

88
find-libdeps.in Normal file
View File

@@ -0,0 +1,88 @@
#!/bin/bash
# License: Unspecified
m4_include(lib/common.sh)
set -e
shopt -s extglob
IGNORE_INTERNAL=0
if [[ $1 = "--ignore-internal" ]]; then
IGNORE_INTERNAL=1
shift
fi
script_mode=${0##*/find-lib}
case $script_mode in
deps|provides) true;;
*) die "Unknown mode %s" "$script_mode" ;;
esac
if [[ -z $1 ]]; then
echo "${0##*/} [options] <package file|extracted package dir>"
echo "Options:"
echo " --ignore-internal ignore internal libraries"
exit 1
fi
if [[ -d $1 ]]; then
pushd "$1" >/dev/null
else
setup_workdir
case ${script_mode} in
deps) bsdtar -C "$WORKDIR" -xf "$1";;
provides) bsdtar -C "$WORKDIR" -xf "$1" --include="*.so*";;
esac
pushd "$WORKDIR" >/dev/null
fi
process_sofile() {
# extract the library name: libfoo.so
soname="${sofile%.so?(+(.+([0-9])))}".so
# extract the major version: 1
soversion="${sofile##*\.so\.}"
if [[ "$soversion" = "$sofile" ]] && ((IGNORE_INTERNAL)); then
continue
fi
if ! in_array "${soname}=${soversion}-${soarch}" "${soobjects[@]}"; then
# libfoo.so=1-64
echo "${soname}=${soversion}-${soarch}"
soobjects+=("${soname}=${soversion}-${soarch}")
fi
}
case $script_mode in
deps) find_args=(-perm -u+x);;
provides) find_args=(-name '*.so*');;
esac
find . -type f "${find_args[@]}" | while read -r filename; do
if [[ $script_mode = "provides" ]]; then
# ignore if we don't have a shared object
if ! LC_ALL=C readelf -h "$filename" 2>/dev/null | grep -q '.*Type:.*DYN (Shared object file).*'; then
continue
fi
fi
# get architecture of the file; if soarch is empty it's not an ELF binary
soarch=$(LC_ALL=C readelf -h "$filename" 2>/dev/null | sed -n 's/.*Class.*ELF\(32\|64\)/\1/p')
[[ -n $soarch ]] || continue
if [[ $script_mode = "provides" ]]; then
# get the string binaries link to: libfoo.so.1.2 -> libfoo.so.1
sofile=$(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -n 's/.*Library soname: \[\(.*\)\].*/\1/p')
[[ -z $sofile ]] && sofile="${filename##*/}"
process_sofile
elif [[ $script_mode = "deps" ]]; then
# process all libraries needed by the binary
for sofile in $(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -nr 's/.*Shared library: \[(.*)\].*/\1/p'); do
process_sofile
done
fi
done
popd >/dev/null

41
finddeps.in Normal file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
#
# finddeps - find packages that depend on a given depname
#
# License: Unspecified
m4_include(lib/common.sh)
match=$1
if [[ -z $match ]]; then
echo 'Usage: finddeps <depname>'
echo ''
echo 'Find packages that depend on a given depname.'
echo 'Run this script from the top-level directory of your ABS tree.'
echo ''
exit 1
fi
find . -type d | while read -r d; do
if [[ -f "$d/PKGBUILD" ]]; then
pkgname=() depends=() makedepends=() optdepends=()
# shellcheck source=PKGBUILD.proto
. "$d/PKGBUILD"
for dep in "${depends[@]}"; do
# lose the version comparator, if any
depname=${dep%%[<>=]*}
[[ $depname = "$match" ]] && echo "$d (depends)"
done
for dep in "${makedepends[@]}"; do
# lose the version comparator, if any
depname=${dep%%[<>=]*}
[[ $depname = "$match" ]] && echo "$d (makedepends)"
done
for dep in "${optdepends[@]/:*}"; do
# lose the version comaparator, if any
depname=${dep%%[<>=]*}
[[ $depname = "$match" ]] && echo "$d (optdepends)"
done
fi
done

49
lddd.in Normal file
View File

@@ -0,0 +1,49 @@
#!/bin/bash
#
# lddd - find broken library links on your machine
#
# License: Unspecified
m4_include(lib/common.sh)
ifs=$IFS
IFS="${IFS}:"
libdirs="/lib /usr/lib /usr/local/lib $(cat /etc/ld.so.conf.d/*)"
extras=
TEMPDIR=$(mktemp -d --tmpdir lddd-script.XXXX)
msg 'Go out and drink some tea, this will take a while :) ...'
# Check ELF binaries in the PATH and specified dir trees.
for tree in $PATH $libdirs $extras; do
msg2 "DIR %s" "$tree"
# Get list of files in tree.
files=$(find "$tree" -type f ! -name '*.a' ! -name '*.la' ! -name '*.py*' ! -name '*.txt' ! -name '*.h' ! -name '*.ttf' ! \
-name '*.rb' ! -name '*.ko' ! -name '*.pc' ! -name '*.enc' ! -name '*.cf' ! -name '*.def' ! -name '*.rules' ! -name \
'*.cmi' ! -name '*.mli' ! -name '*.ml' ! -name '*.cma' ! -name '*.cmx' ! -name '*.cmxa' ! -name '*.pod' ! -name '*.pm' \
! -name '*.pl' ! -name '*.al' ! -name '*.tcl' ! -name '*.bs' ! -name '*.o' ! -name '*.png' ! -name '*.gif' ! -name '*.cmo' \
! -name '*.cgi' ! -name '*.defs' ! -name '*.conf' ! -name '*_LOCALE' ! -name 'Compose' ! -name '*_OBJS' ! -name '*.msg' ! \
-name '*.mcopclass' ! -name '*.mcoptype')
IFS=$ifs
for i in $files; do
if (( $(file "$i" | grep -c 'ELF') != 0 )); then
# Is an ELF binary.
if (( $(ldd "$i" 2>/dev/null | grep -c 'not found') != 0 )); then
# Missing lib.
echo "$i:" >> "$TEMPDIR/raw.txt"
ldd "$i" 2>/dev/null | grep 'not found' >> "$TEMPDIR/raw.txt"
fi
fi
done
done
grep '^/' "$TEMPDIR/raw.txt" | sed -e 's/://g' >> "$TEMPDIR/affected-files.txt"
# invoke pacman
while read -r i; do
pacman -Qo "$i" | awk '{print $4,$5}' >> "$TEMPDIR/pacman.txt"
done < "$TEMPDIR/affected-files.txt"
# clean list
sort -u "$TEMPDIR/pacman.txt" >> "$TEMPDIR/possible-rebuilds.txt"
msg "Files saved to %s" "$TEMPDIR"

67
lib/archroot.sh Normal file
View File

@@ -0,0 +1,67 @@
#!/hint/bash
# License: Unspecified
:
# shellcheck disable=2034
CHROOT_VERSION='v4'
##
# usage : check_root
##
orig_argv=("$0" "$@")
check_root() {
(( EUID == 0 )) && return
if type -P sudo >/dev/null; then
exec sudo -- "${orig_argv[@]}"
else
exec su root -c "$(printf ' %q' "${orig_argv[@]}")"
fi
}
##
# usage : is_btrfs( $path )
# return : whether $path is on a btrfs
##
is_btrfs() {
[[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs ]]
}
##
# usage : is_subvolume( $path )
# return : whether $path is a the root of a btrfs subvolume (including
# the top-level subvolume).
##
is_subvolume() {
[[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs && "$(stat -c %i "$1")" == 256 ]]
}
##
# usage : is_same_fs( $path_a, $path_b )
# return : whether $path_a and $path_b are on the same filesystem
##
is_same_fs() {
[[ "$(stat -c %d "$1")" == "$(stat -c %d "$1")" ]]
}
##
# usage : subvolume_delete_recursive( $path )
#
# Find all btrfs subvolumes under and including $path and delete them.
##
subvolume_delete_recursive() {
local subvol
is_subvolume "$1" || return 0
while IFS= read -d $'\0' -r subvol; do
if ! subvolume_delete_recursive "$subvol"; then
return 1
fi
done < <(find "$1" -mindepth 1 -xdev -depth -inum 256 -print0)
if ! btrfs subvolume delete "$1" &>/dev/null; then
error "Unable to delete subvolume %s" "$subvol"
return 1
fi
return 0
}

184
lib/common.sh Normal file
View File

@@ -0,0 +1,184 @@
#!/hint/bash
# This may be included with or without `set -euE`
# License: Unspecified
[[ -z ${_INCLUDE_COMMON_SH:-} ]] || return 0
_INCLUDE_COMMON_SH=true
# shellcheck disable=1091
. /usr/share/makepkg/util.sh
# Avoid any encoding problems
export LANG=C
shopt -s extglob
# check if messages are to be printed using color
if [[ -t 2 ]]; then
colorize
else
# shellcheck disable=2034
declare -gr ALL_OFF='' BOLD='' BLUE='' GREEN='' RED='' YELLOW=''
fi
stat_busy() {
local mesg=$1; shift
# shellcheck disable=2059
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" "$@" >&2
}
stat_done() {
# shellcheck disable=2059
printf "${BOLD}done${ALL_OFF}\n" >&2
}
_setup_workdir=false
setup_workdir() {
[[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX")
_setup_workdir=true
trap 'trap_abort' INT QUIT TERM HUP
trap 'trap_exit' EXIT
}
cleanup() {
if [[ -n ${WORKDIR:-} ]] && $_setup_workdir; then
rm -rf "$WORKDIR"
fi
exit "${1:-0}"
}
abort() {
error 'Aborting...'
cleanup 255
}
trap_abort() {
trap - EXIT INT QUIT TERM HUP
abort
}
trap_exit() {
local r=$?
trap - EXIT INT QUIT TERM HUP
cleanup $r
}
die() {
(( $# )) && error "$@"
cleanup 255
}
##
# usage : lock( $fd, $file, $message, [ $message_arguments... ] )
##
lock() {
# Only reopen the FD if it wasn't handed to us
if ! [[ "/dev/fd/$1" -ef "$2" ]]; then
mkdir -p -- "$(dirname -- "$2")"
eval "exec $1>"'"$2"'
fi
if ! flock -n "$1"; then
stat_busy "${@:3}"
flock "$1"
stat_done
fi
}
##
# usage : slock( $fd, $file, $message, [ $message_arguments... ] )
##
slock() {
# Only reopen the FD if it wasn't handed to us
if ! [[ "/dev/fd/$1" -ef "$2" ]]; then
mkdir -p -- "$(dirname -- "$2")"
eval "exec $1>"'"$2"'
fi
if ! flock -sn "$1"; then
stat_busy "${@:3}"
flock -s "$1"
stat_done
fi
}
##
# usage : lock_close( $fd )
##
lock_close() {
local fd=$1
# https://github.com/koalaman/shellcheck/issues/862
# shellcheck disable=2034
exec {fd}>&-
}
##
# usage: pkgver_equal( $pkgver1, $pkgver2 )
##
pkgver_equal() {
if [[ $1 = *-* && $2 = *-* ]]; then
# if both versions have a pkgrel, then they must be an exact match
[[ $1 = "$2" ]]
else
# otherwise, trim any pkgrel and compare the bare version.
[[ ${1%%-*} = "${2%%-*}" ]]
fi
}
##
# usage: find_cached_package( $pkgname, $pkgver, $arch )
#
# $pkgver can be supplied with or without a pkgrel appended.
# If not supplied, any pkgrel will be matched.
##
find_cached_package() {
local searchdirs=("$PWD" "$PKGDEST") results=()
local targetname=$1 targetver=$2 targetarch=$3
local dir pkg pkgbasename name ver rel arch r results
for dir in "${searchdirs[@]}"; do
[[ -d $dir ]] || continue
for pkg in "$dir"/*.pkg.tar?(.?z); do
[[ -f $pkg ]] || continue
# avoid adding duplicates of the same inode
for r in "${results[@]}"; do
[[ $r -ef $pkg ]] && continue 2
done
# split apart package filename into parts
pkgbasename=${pkg##*/}
pkgbasename=${pkgbasename%.pkg.tar?(.?z)}
arch=${pkgbasename##*-}
pkgbasename=${pkgbasename%-"$arch"}
rel=${pkgbasename##*-}
pkgbasename=${pkgbasename%-"$rel"}
ver=${pkgbasename##*-}
name=${pkgbasename%-"$ver"}
if [[ $targetname = "$name" && $targetarch = "$arch" ]] &&
pkgver_equal "$targetver" "$ver-$rel"; then
results+=("$pkg")
fi
done
done
case ${#results[*]} in
0)
return 1
;;
1)
printf '%s\n' "${results[0]}"
return 0
;;
*)
error 'Multiple packages found:'
printf '\t%s\n' "${results[@]}" >&2
return 1
esac
}

25
lib/valid-tags.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/hint/bash
# License: Unspecified
:
# shellcheck disable=2034
_arch=(
x86_64
any
)
# shellcheck disable=2034
_tags=(
core-x86_64 core-any
extra-x86_64 extra-any
multilib-x86_64
staging-x86_64 staging-any
testing-x86_64 testing-any
multilib-testing-x86_64
multilib-staging-x86_64
community-x86_64 community-any
community-staging-x86_64 community-staging-any
community-testing-x86_64 community-testing-any
kde-unstable-x86_64 kde-unstable-any
gnome-unstable-x86_64 gnome-unstable-any
)

View File

@@ -1,114 +0,0 @@
#!/bin/sh
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
FORCE="n"
RUN=""
MAKEPKG_ARGS="-Ss"
chrootdir="$CHROOT_SHELL"
APPNAME=$(basename "${0}")
if [ ! -f PKGBUILD ]; then
echo "This must be run in the directory of a built package."
exit 1
fi
source PKGBUILD
if [ "$EUID" != "0" ]; then
echo "This script must be run as root."
exit 1
fi
usage ()
{
echo "usage ${APPNAME} [-h] [-c CHROOT_SHELL] [makepkg args]"
echo " Run this script in a PKGBUILD dir to build a package inside a"
echo " clean chroot. All unrecognized arguments passed to this script"
echo " will be passed to makepkg."
echo ""
echo "The \$CHROOT_SHELL environment variable is used to determine where"
echo " your chroot shell is. The shell consists of the following"
echo " directories: \$CHROOT_SHELL/{root, rw, union} but only 'root' is"
echo " required by default. The rest will be created as needed"
echo ""
echo "The chroot shell 'root' directory must be created via the following"
echo "command:"
echo " mkarchroot \$CHROOT_SHELL base base-devel sudo"
echo ""
echo "Default makepkg args: $MAKEPKG_ARGS"
exit 1
}
while getopts 'c:h' arg; do
case "${arg}" in
c) chrootdir="$OPTARG" ;;
h|?) usage ;;
*) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;;
esac
done
if [ ! -d "$chrootdir" ]; then
echo "No \$CHROOT_SHELL defined, or invalid path"
exit 1
fi
if [ ! -d "$chrootdir/root" ]; then
echo "Missing \$CHROOT_SHELL root directory."
echo "Try using: mkarchroot \$CHROOT_SHELL base base-devel sudo"
usage
fi
[ -d "$chrootdir/rw" ] || mkdir "$chrootdir/rw"
[ -d "$chrootdir/union" ] || mkdir "$chrootdir/union"
function cleanup ()
{
echo "cleaning up unioned mounts"
umount "$chrootdir/union"
}
uniondir="$chrootdir/union"
echo "building union chroot"
modprobe -q unionfs
mount -t unionfs none -o "dirs=$chrootdir/rw=rw:$chrootdir/root=ro" "$uniondir"
trap 'cleanup' 0 1 2 15
echo "moving build files to chroot"
[ -d "$uniondir/build" ] || mkdir "$uniondir/build"
source PKGBUILD
cp PKGBUILD "$uniondir/build/"
for f in ${source[@]}; do
if [ -f "$f" ]; then
cp "$f" "$uniondir/build/"
fi
done
if ! grep "^nobody" "$uniondir/etc/sudoers" >/dev/null 2>&1; then
echo "allowing 'nobody' sudo rights in the chroot"
echo "nobody ALL=(ALL) NOPASSWD: ALL" >> $uniondir/etc/sudoers
fi
#This is a little gross, but this way the script is recreated every time in the
#rw portion of the union
(cat <<EOF
#!/bin/bash
export LANG=$LOCALE
cd /build
sudo -u nobody makepkg "$MAKEPKG_ARGS"
EOF
) > "$uniondir/chrootbuild"
chmod +x "$uniondir/chrootbuild"
./mkarchroot -r "/chrootbuild" "$uniondir"
# TODO move relevant files here
echo "build complete... check \$CHROOT_SHELL/build for build results"

440
makechrootpkg.in Normal file
View File

@@ -0,0 +1,440 @@
#!/bin/bash
# License: GNU GPLv2
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
m4_include(lib/common.sh)
m4_include(lib/archroot.sh)
shopt -s nullglob
usage() {
echo "Usage: ${0##*/} [options] -r <chrootdir> [--] [makepkg args]"
echo ' Run this script in a PKGBUILD dir to build a package inside a'
echo ' clean chroot. Arguments passed to this script after the'
echo ' end-of-options marker (--) will be passed to makepkg.'
echo ''
echo ' The chroot dir consists of the following directories:'
echo ' <chrootdir>/{root, copy} but only "root" is required'
echo ' by default. The working copy will be created as needed'
echo ''
echo 'The chroot "root" directory must be created via the following'
echo 'command:'
echo ' mkarchroot <chrootdir>/root base-devel'
echo ''
echo 'This script reads {SRC,SRCPKG,PKG,LOG}DEST, MAKEFLAGS and PACKAGER'
echo 'from makepkg.conf(5), if those variables are not part of the'
echo 'environment.'
echo ''
echo "Default makepkg args: ${default_makepkg_args[*]}"
echo ''
echo 'Flags:'
echo '-h This help'
echo '-c Clean the chroot before building'
echo '-d <dir> Bind directory into build chroot as read-write'
echo '-D <dir> Bind directory into build chroot as read-only'
echo '-u Update the working copy of the chroot before building'
echo ' This is useful for rebuilds without dirtying the pristine'
echo ' chroot'
echo '-r <dir> The chroot dir to use'
echo '-I <pkg> Install a package into the working copy of the chroot'
echo '-l <copy> The directory to use as the working copy of the chroot'
echo ' Useful for maintaining multiple copies'
echo " Default: $copy"
echo '-n Run namcap on the package'
echo '-T Build in a temporary directory'
echo '-U Run makepkg as a specified user'
exit 1
}
# {{{ functions
# Usage: load_vars $makepkg_conf
# Globals:
# - SRCDEST
# - SRCPKGDEST
# - PKGDEST
# - LOGDEST
# - MAKEFLAGS
# - PACKAGER
load_vars() {
local makepkg_conf="$1" var
[[ -f $makepkg_conf ]] || return 1
for var in {SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER; do
[[ -z ${!var:-} ]] && eval "$(grep "^${var}=" "$makepkg_conf")"
done
return 0
}
# Usage: sync_chroot $rootdir $copydir [$copy]
sync_chroot() {
local rootdir=$1
local copydir=$2
local copy=${3:-$2}
if [[ "$rootdir" -ef "$copydir" ]]; then
error 'Cannot sync copy with itself: %s' "$copydir"
return 1
fi
# Get a read lock on the root chroot to make
# sure we don't clone a half-updated chroot
slock 8 "$rootdir.lock" \
"Locking clean chroot [%s]" "$rootdir"
stat_busy "Synchronizing chroot copy [%s] -> [%s]" "$rootdir" "$copy"
if is_subvolume "$rootdir" && is_same_fs "$rootdir" "$(dirname -- "$copydir")" && ! mountpoint -q "$copydir"; then
if is_subvolume "$copydir"; then
subvolume_delete_recursive "$copydir" ||
die "Unable to delete subvolume %s" "$copydir"
else
# avoid change of filesystem in case of an umount failure
rm --recursive --force --one-file-system "$copydir" ||
die "Unable to delete %s" "$copydir"
fi
btrfs subvolume snapshot "$rootdir" "$copydir" >/dev/null ||
die "Unable to create subvolume %s" "$copydir"
else
mkdir -p "$copydir"
rsync -a --delete -q -W -x "$rootdir/" "$copydir"
fi
stat_done
# Drop the read lock again
lock_close 8
# Update mtime
touch "$copydir"
}
# Usage: delete_chroot $copydir [$copy]
delete_chroot() {
local copydir=$1
local copy=${1:-$2}
stat_busy "Removing chroot copy [%s]" "$copy"
if is_subvolume "$copydir" && ! mountpoint -q "$copydir"; then
subvolume_delete_recursive "$copydir" ||
die "Unable to delete subvolume %s" "$copydir"
else
# avoid change of filesystem in case of an umount failure
rm --recursive --force --one-file-system "$copydir" ||
die "Unable to delete %s" "$copydir"
fi
# remove lock file
rm -f "$copydir.lock"
stat_done
}
# Usage: install_packages $copydir $pkgs...
install_packages() {
local copydir=$1
local install_pkgs=("${@:2}")
local -a pkgnames
local ret
pkgnames=("${install_pkgs[@]##*/}")
cp -- "${install_pkgs[@]}" "$copydir/root/"
arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
pacman -U --noconfirm -- "${pkgnames[@]/#//root/}"
ret=$?
rm -- "${pkgnames[@]/#/$copydir/root/}"
return $ret
}
# Usage: prepare_chroot $copydir $HOME $keepbuilddir $run_namcap
# Globals:
# - MAKEFLAGS
# - PACKAGER
prepare_chroot() {
local copydir=$1
local USER_HOME=$2
local keepbuilddir=$3
local run_namcap=$4
$keepbuilddir || rm -rf "$copydir/build"
local builduser_uid builduser_gid
builduser_uid="${SUDO_UID:-$UID}"
builduser_gid="$(id -g "$builduser_uid")"
local install="install -o $builduser_uid -g $builduser_gid"
local x
# We can't use useradd without chrooting, otherwise it invokes PAM modules
# which we might not be able to load (i.e. when building i686 packages on
# an x86_64 host).
sed -e '/^builduser:/d' -i "$copydir"/etc/{passwd,group}
printf >>"$copydir/etc/group" 'builduser:x:%d:\n' "$builduser_gid"
printf >>"$copydir/etc/passwd" 'builduser:x:%d:%d:builduser:/build:/bin/bash\n' "$builduser_uid" "$builduser_gid"
$install -d "$copydir"/{build,build/.gnupg,startdir,{pkg,srcpkg,src,log}dest}
for x in .gnupg/pubring.{kbx,gpg}; do
[[ -r $USER_HOME/$x ]] || continue
$install -m 644 "$USER_HOME/$x" "$copydir/build/$x"
done
sed -e '/^MAKEFLAGS=/d' -e '/^PACKAGER=/d' -i "$copydir/etc/makepkg.conf"
for x in BUILDDIR=/build PKGDEST=/pkgdest SRCPKGDEST=/srcpkgdest SRCDEST=/srcdest LOGDEST=/logdest \
"MAKEFLAGS='${MAKEFLAGS:-}'" "PACKAGER='${PACKAGER:-}'"
do
grep -q "^$x" "$copydir/etc/makepkg.conf" && continue
echo "$x" >>"$copydir/etc/makepkg.conf"
done
cat > "$copydir/etc/sudoers.d/builduser-pacman" <<EOF
builduser ALL = NOPASSWD: /usr/bin/pacman
EOF
chmod 440 "$copydir/etc/sudoers.d/builduser-pacman"
# This is a little gross, but this way the script is recreated every time in the
# working copy
{
printf '#!/bin/bash\n'
declare -f _chrootbuild
printf '_chrootbuild "$@" || exit\n'
if $run_namcap; then
declare -f _chrootnamcap
printf '_chrootnamcap || exit\n'
fi
} >"$copydir/chrootbuild"
chmod +x "$copydir/chrootbuild"
}
# These functions aren't run in makechrootpkg,
# so no global variables
_chrootbuild() {
# Work around nspawn not giving us a ctty
exec </dev/console
# No coredumps
ulimit -c 0
# shellcheck source=/dev/null
. /etc/profile
# Beware, there are some stupid arbitrary rules on how you can
# use "$" in arguments to commands with "sudo -i". ${foo} or
# ${1} is OK, but $foo or $1 isn't.
# https://bugzilla.sudo.ws/show_bug.cgi?id=765
sudo -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"
}
_chrootnamcap() {
pacman -S --needed --noconfirm namcap
for pkgfile in /startdir/PKGBUILD /pkgdest/*; do
echo "Checking ${pkgfile##*/}"
sudo -u builduser namcap "$pkgfile" 2>&1 | tee "/logdest/${pkgfile##*/}-namcap.log"
done
}
# Usage: download_sources $copydir $makepkg_user
# Globals:
# - SRCDEST
download_sources() {
local copydir=$1
local makepkg_user=$2
local builddir
builddir="$(mktemp -d)"
chmod 1777 "$builddir"
# Ensure sources are downloaded
sudo -u "$makepkg_user" env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o ||
die "Could not download sources."
# Clean up garbage from verifysource
rm -rf "$builddir"
}
# Usage: move_products $copydir $owner
# Globals:
# - PKGDEST
# - LOGDEST
# - SRCPKGDEST
move_products() {
local copydir=$1
local src_owner=$2
local pkgfile
for pkgfile in "$copydir"/pkgdest/*; do
chown "$src_owner" "$pkgfile"
mv "$pkgfile" "$PKGDEST"
# Fix broken symlink because of temporary chroot PKGDEST /pkgdest
if [[ "$PWD" != "$PKGDEST" && -L "$PWD/${pkgfile##*/}" ]]; then
ln -sf "$PKGDEST/${pkgfile##*/}"
fi
done
local l
for l in "$copydir"/logdest/*; do
[[ $l == */logpipe.* ]] && continue
chown "$src_owner" "$l"
mv "$l" "$LOGDEST"
done
for s in "$copydir"/srcpkgdest/*; do
chown "$src_owner" "$s"
mv "$s" "$SRCPKGDEST"
# Fix broken symlink because of temporary chroot SRCPKGDEST /srcpkgdest
if [[ "$PWD" != "$SRCPKGDEST" && -L "$PWD/${s##*/}" ]]; then
ln -sf "$SRCPKGDEST/${s##*/}"
fi
done
}
# }}}
main() {
default_makepkg_args=(--syncdeps --noconfirm --log --holdver --skipinteg)
makepkg_args=("${default_makepkg_args[@]}")
keepbuilddir=false
update_first=false
clean_first=false
run_namcap=false
temp_chroot=false
chrootdir=
passeddir=
makepkg_user=
declare -a install_pkgs
declare -i ret=0
bindmounts_ro=()
bindmounts_rw=()
copy=$USER
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
[[ -z "$copy" || $copy = root ]] && copy=copy
src_owner=${SUDO_USER:-$USER}
while getopts 'hcur:I:l:nTD:d:U:' arg; do
case "$arg" in
c) clean_first=true ;;
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
d) bindmounts_rw+=("--bind=$OPTARG") ;;
u) update_first=true ;;
r) passeddir="$OPTARG" ;;
I) install_pkgs+=("$OPTARG") ;;
l) copy="$OPTARG" ;;
n) run_namcap=true; makepkg_args+=(--install) ;;
T) temp_chroot=true; copy+="-$$" ;;
U) makepkg_user="$OPTARG" ;;
h|*) usage ;;
esac
done
[[ ! -f PKGBUILD && -z "${install_pkgs[*]}" ]] && die 'This must be run in a directory containing a PKGBUILD.'
[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid makepkg user.'
makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
check_root
# Canonicalize chrootdir, getting rid of trailing /
chrootdir=$(readlink -e "$passeddir")
[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir"
[[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir"
if [[ ${copy:0:1} = / ]]; then
copydir=$copy
else
copydir="$chrootdir/$copy"
fi
# Pass all arguments after -- right to makepkg
makepkg_args+=("${@:$OPTIND}")
# See if -R or -e was passed to makepkg
for arg in "${makepkg_args[@]}"; do
case ${arg%%=*} in
--repackage|--noextract) keepbuilddir=true; break ;;
--repackage|--noextract) keepbuilddir=true; break ;;
--*) ;;
-*R*|-*e*) keepbuilddir=true; break ;;
esac
done
if [[ -n $SUDO_USER ]]; then
eval "USER_HOME=~$SUDO_USER"
else
USER_HOME=$HOME
fi
umask 0022
load_vars "${XDG_CONFIG_HOME:-$USER_HOME/.config}/pacman/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf"
load_vars /etc/makepkg.conf
# Use PKGBUILD directory if these don't exist
[[ -d $PKGDEST ]] || PKGDEST=$PWD
[[ -d $SRCDEST ]] || SRCDEST=$PWD
[[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD
[[ -d $LOGDEST ]] || LOGDEST=$PWD
# Lock the chroot we want to use. We'll keep this lock until we exit.
lock 9 "$copydir.lock" "Locking chroot copy [%s]" "$copy"
if [[ ! -d $copydir ]] || $clean_first; then
sync_chroot "$chrootdir/root" "$copydir" "$copy"
fi
$update_first && arch-nspawn "$copydir" \
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
pacman -Syu --noconfirm
if [[ -n ${install_pkgs[*]:-} ]]; then
install_packages "$copydir" "${install_pkgs[@]}"
ret=$?
# If there is no PKGBUILD we have done
[[ -f PKGBUILD ]] || return $ret
fi
if [[ "$(id -u "$makepkg_user")" == 0 ]]; then
error "Running makepkg as root is not allowed."
exit 1
fi
download_sources "$copydir" "$makepkg_user"
prepare_chroot "$copydir" "$USER_HOME" "$keepbuilddir"
if arch-nspawn "$copydir" \
--bind="$PWD:/startdir" \
--bind="$SRCDEST:/srcdest" \
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
/chrootbuild "${makepkg_args[@]}"
then
move_products "$copydir" "$src_owner"
else
(( ret += 1 ))
fi
$temp_chroot && delete_chroot "$copydir" "$copy"
if (( ret != 0 )); then
if $temp_chroot; then
die "Build failed"
else
die "Build failed, check %s/build" "$copydir"
fi
else
true
fi
}
main "$@"

150
makepkg-x86_64.conf Normal file
View File

@@ -0,0 +1,150 @@
#!/hint/bash
# shellcheck disable=2034
#
# /etc/makepkg.conf
#
#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
# Format: 'protocol::agent'
DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
'rsync::/usr/bin/rsync --no-motd -z %u %o'
'scp::/usr/bin/scp -C %u %o')
# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/wget
#-- The package required by makepkg to download VCS sources
# Format: 'protocol::package'
VCSCLIENTS=('bzr::bzr'
'git::git'
'hg::mercurial'
'svn::subversion')
#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-pc-linux-gnu"
#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
#-- Debugging flags
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Defaults: BUILDENV=(!distcc color !ccache check !sign)
# A negated environment option will do the opposite of the comments below.
#
#-- distcc: Use the Distributed C/C++/ObjC compiler
#-- color: Colorize output messages
#-- ccache: Use ccache to cache compilation
#-- check: Run the check() function if present in the PKGBUILD
#-- sign: Generate PGP signature file
#
BUILDENV=(!distcc color !ccache check !sign)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""
#
#-- Specify a directory for package building.
#BUILDDIR=/tmp/makepkg
#########################################################################
# GLOBAL PACKAGE OPTIONS
# These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx !debug)
# A negated option will do the opposite of the comments below.
#
#-- strip: Strip symbols from binaries/libraries
#-- docs: Save doc directories specified by DOC_DIRS
#-- libtool: Leave libtool (.la) files in packages
#-- staticlibs: Leave static library (.a) files in packages
#-- emptydirs: Leave empty directories in packages
#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge: Remove files specified by PURGE_TARGETS
#-- upx: Compress binary executable files using UPX
#-- optipng: Optimize PNG images with optipng
#-- debug: Add debugging flags as specified in DEBUG_* variables
#
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx !debug)
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
STRIP_SHARED="--strip-unneeded"
#-- Options to be used when stripping static libraries. See `man strip' for details.
STRIP_STATIC="--strip-debug"
#-- Manual (man and info) directories to compress (if zipman is specified)
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Source packages: specify a fixed directory where all src packages will be placed
#SRCPKGDEST=/home/srcpackages
#-- Log files: specify a fixed directory where all log files will be placed
#LOGDEST=/home/makepkglogs
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>"
#-- Specify a key to use for package signing
#GPGKEY=""
#########################################################################
# COMPRESSION DEFAULTS
#########################################################################
#
COMPRESSGZ=(gzip -c -f -n)
COMPRESSBZ2=(bzip2 -c -f)
COMPRESSXZ=(xz -c -z -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)
#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
# WARNING: Do NOT modify these variables unless you know what you are
# doing.
#
PKGEXT='.pkg.tar.xz'
SRCEXT='.src.tar.gz'
# vim: set ft=sh ts=2 sw=2 et:

View File

@@ -1,156 +0,0 @@
#!/bin/sh
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
FORCE="n"
RUN=""
working_dir=""
APPNAME=$(basename "${0}")
# usage: usage <exitvalue>
usage ()
{
echo "usage ${APPNAME} [options] working-dir [package-list | app]"
echo " options:"
echo " -r <app> Run 'app' within the context of the chroot"
echo " -u Update the chroot via pacman"
echo " -f Force overwrite of files in the working-dir"
echo " -h This message"
exit $1
}
while getopts 'r:ufh' arg; do
case "${arg}" in
r) RUN="$OPTARG" ;;
u) RUN="pacman -Syu" ;;
f) FORCE="y" ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
done
if [ "$EUID" != "0" ]; then
echo "error: this script must be run as root."
exit 1
fi
shift $(($OPTIND - 1))
if [ "$RUN" == "" -a $# -lt 2 ]; then
echo "you must specify a directory and one or more packages"
usage 1
elif [ $# -lt 1 ]; then
echo "you must specify a directory"
usage 1
fi
working_dir="$(readlink -f ${1})"
shift 1
[ "${working_dir}" = "" ] && echo "error: please specify a working directory" && usage 1
# {{{ functions
function chroot_mount ()
{
echo "mounting sysfs : /sys"
[ -e "${working_dir}/sys" ] || mkdir "${working_dir}/sys"
mount -t sysfs sysfs "${working_dir}/sys"
echo "mounting procfs : /proc"
[ -e "${working_dir}/proc" ] || mkdir "${working_dir}/proc"
mount -t proc proc "${working_dir}/proc"
echo "binding device nodes : /dev"
[ -e "${working_dir}/dev" ] || mkdir "${working_dir}/dev"
mount -o bind /dev "${working_dir}/dev"
echo "binding pacman cache : /var/cache/pacman"
[ -e "${working_dir}/var/cache/pacman" ] || mkdir -p "${working_dir}/var/cache/pacman"
mount -o bind /var/cache/pacman "${working_dir}/var/cache/pacman"
trap 'chroot_umount' 0 1 2 15
}
function chroot_umount ()
{
echo "cleaning up mounts"
umount "${working_dir}/proc"
umount "${working_dir}/sys"
umount "${working_dir}/dev"
umount "${working_dir}/var/cache/pacman"
}
# }}}
if [ "$RUN" != "" ]; then
# run chroot {{{
#Sanity check
if [ ! -f "${working_dir}/.arch-chroot" ]; then
echo "error: '${working_dir}' does not appear to be a Arch chroot"
echo " please build the image using mkarchchroot"
exit 1
fi
chroot_mount
echo "starting chroot ($RUN)"
chroot "${working_dir}" "${RUN}"
# }}}
else
# {{{ build chroot
if [ -e "${working_dir}" -a "${FORCE}" = "n" ]; then
echo "error: working dir '${working_dir}' already exists - try using -f"
exit 1
fi
mkdir -p "${working_dir}/var/lib/pacman/"
chroot_mount
pacargs="--noconfirm -v " #--noprogressbar -v
pacargs="$pacargs --root=${working_dir}"
# pacman takes these as relative to the given root
pacargs="$pacargs --dbpath=/var/lib/pacman"
pacargs="$pacargs --cachedir=/var/cache/pacman/pkg"
if [ $# -eq 0 ]; then
echo "no packages to install"
else
echo "installing packages:"
for i in $@; do echo -e "\t$i"; done
op="-Sy"
if [ "$FORCE" == "y" ]; then
op="${op}f"
fi
if ! pacman ${op} ${pacargs} $@; then
echo "error: failed to install all packages"
exit 1
fi
fi
if [ -d "${working_dir}/lib/modules" ]; then
echo "running ldconfig"
ldconfig -r "${working_dir}"
fi
echo "generating default locales"
sed -i "s|^#\(.*$LANG\)|\1|g" "${working_dir}/etc/locale.gen"
chroot "${working_dir}" locale-gen
if [ ! -e "${working_dir}/.arch-chroot" ]; then
date +%s > "${working_dir}/.arch-chroot"
fi
# }}}
fi
# vim:ft=sh:ts=4:sw=4:et:

100
mkarchroot.in Normal file
View File

@@ -0,0 +1,100 @@
#!/bin/bash
# License: GNU GPLv2
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
m4_include(lib/common.sh)
m4_include(lib/archroot.sh)
working_dir=''
files=()
usage() {
echo "Usage: ${0##*/} [options] working-dir package-list..."
echo ' options:'
echo ' -C <file> Location of a pacman config file'
echo ' -M <file> Location of a makepkg config file'
echo ' -c <dir> Set pacman cache'
echo ' -f <file> Copy file from the host to the chroot'
echo ' -s Do not run setarch'
echo ' -h This message'
exit 1
}
while getopts 'hC:M:c:f:s' arg; do
case "$arg" in
C) pac_conf="$OPTARG" ;;
M) makepkg_conf="$OPTARG" ;;
c) cache_dir="$OPTARG" ;;
f) files+=("$OPTARG") ;;
s) nosetarch=1 ;;
h|?) usage ;;
*) error "invalid argument '%s'" "$arg"; usage ;;
esac
done
shift $((OPTIND - 1))
(( $# < 2 )) && die 'You must specify a directory and one or more packages.'
check_root
working_dir="$(readlink -f "$1")"
shift 1
[[ -z $working_dir ]] && die 'Please specify a working directory.'
if [[ -z $cache_dir ]]; then
cache_dirs=($(pacman -v "$cache_conf" 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g'))
else
cache_dirs=(${cache_dir})
fi
umask 0022
[[ -e $working_dir ]] && die "Working directory '%s' already exists" "$working_dir"
mkdir -p "$working_dir"
lock 9 "${working_dir}.lock" "Locking chroot"
if is_btrfs "$working_dir"; then
rmdir "$working_dir"
if ! btrfs subvolume create "$working_dir"; then
die "Couldn't create subvolume for '%s'" "$working_dir"
fi
chmod 0755 "$working_dir"
fi
for file in "${files[@]}"; do
mkdir -p "$(dirname "$working_dir$file")"
cp "$file" "$working_dir$file"
done
_env=()
while read -r varname; do
_env+=("$varname=${!varname}")
done < <(declare -x | sed -r 's/^declare -x ([^=]*)=.*/\1/' | grep -i '_proxy$')
env -i "${_env[@]}" \
pacstrap -GMcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \
"${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages'
printf '%s.UTF-8 UTF-8\n' en_US de_DE > "$working_dir/etc/locale.gen"
echo 'LANG=en_US.UTF-8' > "$working_dir/etc/locale.conf"
echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot"
systemd-machine-id-setup --root="$working_dir"
exec arch-nspawn \
${nosetarch:+-s} \
${pac_conf:+-C "$pac_conf"} \
${makepkg_conf:+-M "$makepkg_conf"} \
${cache_dir:+-c "$cache_dir"} \
"$working_dir" locale-gen

93
pacman-extra.conf Normal file
View File

@@ -0,0 +1,93 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

102
pacman-gnome-unstable.conf Normal file
View File

@@ -0,0 +1,102 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
[gnome-unstable]
Include = /etc/pacman.d/mirrorlist
[staging]
Include = /etc/pacman.d/mirrorlist
[testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community-staging]
Include = /etc/pacman.d/mirrorlist
[community-testing]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

96
pacman-kde-unstable.conf Normal file
View File

@@ -0,0 +1,96 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
[kde-unstable]
Include = /etc/pacman.d/mirrorlist
[testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community-testing]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

View File

@@ -0,0 +1,110 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
[staging]
Include = /etc/pacman.d/mirrorlist
[testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community-staging]
Include = /etc/pacman.d/mirrorlist
[community-testing]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
[multilib-staging]
Include = /etc/pacman.d/mirrorlist
[multilib-testing]
Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

View File

@@ -0,0 +1,101 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
[testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community-testing]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
[multilib-testing]
Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

102
pacman-multilib.conf Normal file
View File

@@ -0,0 +1,102 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

99
pacman-staging.conf Normal file
View File

@@ -0,0 +1,99 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
[staging]
Include = /etc/pacman.d/mirrorlist
[testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community-staging]
Include = /etc/pacman.d/mirrorlist
[community-testing]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

93
pacman-testing.conf Normal file
View File

@@ -0,0 +1,93 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
#UseDelta = 0.7
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
[testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community-testing]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

110
rebuildpkgs.in Normal file
View File

@@ -0,0 +1,110 @@
#!/bin/bash
# License: Unspecified
#
# This script rebuilds a list of packages in order
# and reports anything that fails
#
# Due to sudo usage, it is recommended to allow makechrootpkg
# to be run with NOPASSWD in your sudoers file
#
# FIXME
# Currently uses $(pwd)/rebuilds as the directory for rebuilding...
# TODO make this work for community too
m4_include(lib/common.sh)
if (( $# < 1 )); then
printf 'Usage: %s <chrootdir> <packages to rebuild>\n' "$(basename "$0")"
printf ' example: %s ~/chroot readline bash foo bar baz\n' "$(basename "$0")"
exit 1
fi
# Source makepkg.conf; fail if it is not found
if [[ -r '/etc/makepkg.conf' ]]; then
# shellcheck source=makepkg-x86_64.conf
source '/etc/makepkg.conf'
else
die '/etc/makepkg.conf not found!'
fi
# Source user-specific makepkg.conf overrides
if [[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" ]]; then
# shellcheck source=/dev/null
source "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf"
elif [[ -r "$HOME/.makepkg.conf" ]]; then
# shellcheck source=/dev/null
source "$HOME/.makepkg.conf"
fi
bump_pkgrel() {
# Get the current pkgrel from SVN and update the working copy with it
# This prevents us from incrementing out of control :)
pbuild='.svn/text-base/PKGBUILD.svn-base'
oldrel=$(grep 'pkgrel=' $pbuild | cut -d= -f2)
#remove decimals
rel=${oldrel%%.*}
newrel=$((rel + 1))
sed -i "s/pkgrel=$oldrel/pkgrel=$newrel/" PKGBUILD
}
pkg_from_pkgbuild() {
# we want the sourcing to be done in a subshell so we don't pollute our current namespace
export CARCH PKGEXT
# shellcheck source=PKGBUILD.proto
(source PKGBUILD; echo "$pkgname-$pkgver-$pkgrel-$CARCH$PKGEXT")
}
chrootdir="$1"; shift
pkgs=("$@")
SVNPATH='svn+ssh://repos.archlinux.org/srv/repos/svn-packages/svn'
msg "Work will be done in %s" "$(pwd)/rebuilds"
REBUILD_ROOT="$(pwd)/rebuilds"
mkdir -p "$REBUILD_ROOT"
cd "$REBUILD_ROOT"
/usr/bin/svn co -N $SVNPATH
FAILED=""
for pkg in "${pkgs[@]}"; do
cd "$REBUILD_ROOT/svn-packages"
msg2 "Building '%s'" "$pkg"
/usr/bin/svn update "$pkg"
if [[ ! -d "$pkg/trunk" ]]; then
FAILED="$FAILED $pkg"
warning "%s does not exist in SVN" "$pkg"
continue
fi
cd "$pkg/trunk/"
bump_pkgrel
if ! sudo makechrootpkg -u -d -r "$chrootdir" -- --noconfirm; then
FAILED="$FAILED $pkg"
error "%s Failed!" "$pkg"
else
pkgfile=$(pkg_from_pkgbuild)
if [[ -e $pkgfile ]]; then
msg2 "%s Complete" "$pkg"
else
FAILED="$FAILED $pkg"
error "%s Failed, no package built!" "$pkg"
fi
fi
done
cd "$REBUILD_ROOT"
if [[ -n $FAILED ]]; then
msg 'Packages failed:'
for pkg in $FAILED; do
msg2 "%s" "$pkg"
done
fi
msg 'SVN pkgbumps in svn-packages/ - commit when ready'

72
zsh_completion.in Normal file
View File

@@ -0,0 +1,72 @@
#compdef archbuild archco arch-nspawn archrelease archrm commitpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild communityco=archco
# License: Unspecified
m4_include(lib/valid-tags.sh)
_archbuild_args=(
'-c[Recreate the chroot before building]'
'-r[Create chroots in this directory]:base_dir:_files -/'
)
_archco_args=(
'*:packages:_devtools_completions_all_packages'
)
_arch_nspawn_args=(
'-C[Location of a pacman config file]:pacman_config:_files'
'-M[Location of a makepkg config file]:makepkg_config:_files'
'-c[Set pacman cache]:pacman_cache:_files -/'
'-h[Display usage]'
)
_archrelease_args=(
"*:arch:($_tags[*])"
)
_archrm_args=(
'1:path:_files -/'
)
_commitpkg_args=(
"-a[Release to a specific architecture only]:arch:($_arch[*])"
'-l[Set bandwidth limit]:limit'
'1:commit_msg'
)
_finddeps_args=(
'1:packages:_devtools_completions_all_packages'
)
_makechrootpkg_args=(
'-I[Install a package into the working copy]:target:_files -g "*.pkg.tar.*(.)"'
'-c[Clean the chroot before building]'
'-h[Display usage]'
'-l[The directory to use as the working copy]:copy_dir:_files -/'
'-r[The chroot dir to use]:chroot_dir:_files -/'
'-u[Update the working copy of the chroot before building]'
)
_mkarchroot_args=(
'-C[Location of a pacman config file]:pacman_config:_files'
'-M[Location of a makepkg config file]:makepkg_config:_files'
'-c[Set pacman cache]:pacman_cache:_files -/'
'-h[Display usage]'
)
_rebuildpkgs_args=(
'1:chroot_dir:_files -/'
'*:packages:_devtools_completions_all_packages'
)
_devtools_completions_all_packages() {
typeset -U packages
packages=($(_call_program packages pacman -Sql))
compadd - "${(@)packages}"
}
_devtools() {
local argname="_${service//-/_}_args[@]"
_arguments -s "${(P)argname}"
}
_devtools