Commit Graph

49 Commits

Author SHA1 Message Date
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
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 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 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 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
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
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
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
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 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 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
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
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
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
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 a104988329 Trap normal exit for makechrootpkg
Make sure we umount everything on a clean exit too

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-29 21:09:06 -05:00
Aaron Griffin 0b7d43615b Added GPL headers
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-21 21:08:55 -05:00
Aaron Griffin 34ee028d04 Allow us to properly drop permissions in the chroot via sudo
Use sudo to drop permissions and build as "nobody" in the chroot

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-07 12:31:22 -05:00
Aaron Griffin 656a54014b Initial checking of makechrootpkg
Mostly functional, missing true su capability....

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-03 23:24:29 -05:00