Compare commits

...

99 Commits
0.5 ... 0.8.0

Author SHA1 Message Date
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
11 changed files with 521 additions and 237 deletions

View File

@@ -1,13 +1,20 @@
all:
install:
# extrapkg/checkpkg and friends
# commitpkg/checkpkg and friends
mkdir -p $(DESTDIR)/usr/bin
install -m 755 checkpkg $(DESTDIR)/usr/bin
install -m 755 extrapkg $(DESTDIR)/usr/bin
ln -sf extrapkg $(DESTDIR)/usr/bin/corepkg
ln -sf extrapkg $(DESTDIR)/usr/bin/testingpkg
ln -sf extrapkg $(DESTDIR)/usr/bin/unstablepkg
install -m 755 commitpkg $(DESTDIR)/usr/bin
ln -sf commitpkg $(DESTDIR)/usr/bin/extrapkg
ln -sf commitpkg $(DESTDIR)/usr/bin/corepkg
ln -sf commitpkg $(DESTDIR)/usr/bin/testingpkg
ln -sf commitpkg $(DESTDIR)/usr/bin/communitypkg
ln -sf commitpkg $(DESTDIR)/usr/bin/community-testingpkg
# arch{co,release,rm}
install -m 755 archco $(DESTDIR)/usr/bin
install -m 755 communityco $(DESTDIR)/usr/bin
install -m 755 archrelease $(DESTDIR)/usr/bin
install -m 755 archrm $(DESTDIR)/usr/bin
# new chroot tools, only usable by root
mkdir -p $(DESTDIR)/usr/sbin
install -m 755 mkarchroot $(DESTDIR)/usr/sbin
@@ -15,15 +22,23 @@ install:
#Additional packaging helper scripts
install -m 755 lddd $(DESTDIR)/usr/bin
install -m 755 finddeps $(DESTDIR)/usr/bin
install -m 755 rebuildpkgs $(DESTDIR)/usr/bin
uninstall:
# remove all files we installed
rm $(DESTDIR)/usr/bin/checkpkg
rm $(DESTDIR)/usr/bin/commitpkg
rm $(DESTDIR)/usr/bin/extrapkg
rm $(DESTDIR)/usr/bin/corepkg
rm $(DESTDIR)/usr/bin/testingpkg
rm $(DESTDIR)/usr/bin/unstablepkg
rm $(DESTDIR)/usr/bin/communitypkg
rm $(DESTDIR)/usr/bin/community-testingpkg
rm $(DESTDIR)/usr/sbin/mkarchroot
rm $(DESTDIR)/usr/sbin/makechrootpkg
rm $(DESTDIR)/usr/bin/lddd
rm $(DESTDIR)/usr/bin/finddeps
rm $(DESTDIR)/usr/bin/archco
rm $(DESTDIR)/usr/bin/archrelease
rm $(DESTDIR)/usr/bin/archrm
rm $(DESTDIR)/usr/bin/communityco
rm $(DESTDIR)/usr/bin/rebuildpkgs

10
archco Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
if [ "$1" = "" ]; then
echo "Usage: archco <package name> [<package name>]"
exit 1
fi
for i in "$@"; do
svn co svn+ssh://gerolde.archlinux.org/srv/svn-packages/$i
done

55
archrelease Executable file
View File

@@ -0,0 +1,55 @@
#!/bin/bash
if [ "$1" = "" ]; then
echo "Usage: archrelease <repo>"
exit 1
fi
if [ ! -f PKGBUILD ]; then
echo "archrelease: PKGBUILD not found"
exit 1
fi
if [ "$(basename $(readlink -f .))" != "trunk" ]; then
echo "archrelease: Not in a package trunk dir"
exit 1
fi
if [ "$(svn diff)" != "" ]; then
echo "archrelease: You have not committed your changes yet!"
echo " Please run 'upgpkg' or 'svn commit' first"
exit 1
fi
if [ ! -d ../repos/$1 ]; then
pushd ..
[ -d repos ] || mkdir repos
svn copy -r HEAD trunk repos/$1
svn commit -m "archrelease: new repo $1"
pushd repos/$1
svnmerge init
svn commit -F svnmerge-commit-message.txt
rm svnmerge-commit-message.txt
popd
popd
else
svnmerge merge ../repos/$1
pushd ..
if [ -f trunk/svnmerge-commit-message.txt ]; then
svn commit -F trunk/svnmerge-commit-message.txt
if [ $? -ne 0 ]; then
# The user is going to have to clean things up a bit
echo "*** ATTENTION: There was a problem merging the package changes ***"
echo "To fix it, edit the conflicting files in repos/$1 (the ones that are C in svn status)."
echo "Once you have resolved conflicts, execute 'svn resolved <path to file>' to tell svn the error was resolved."
echo "Then to finish the merge commit, execute 'svn commit -F trunk/svnmerge-commit-message.txt' and, if there are no problems, delete trunk/svnmerge-commit-message.txt"
exit $?
fi
rm trunk/svnmerge-commit-message.txt
else
echo "Nothing to commit"
fi
popd
fi
echo "===> Tagged for $1"

13
archrm Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
if [ "$1" = "" ]; then
echo "Usage: archrm <path to checkout>"
exit 1
fi
# FIXME: Check if there are uncommited changes
#pushd $1
#
#popd
rm -rf $1

View File

@@ -23,65 +23,72 @@ if [ ! -f PKGBUILD ]; then
fi
source PKGBUILD
pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}.pkg.tar.gz
oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
if [ -f "$(pwd)/$pkgfile" ]; then
pkgfile=$(pwd)/$pkgfile
elif [ -f "$PKGDEST/$pkgfile" ]; then
pkgfile=$PKGDEST/$pkgfile
elif [ -f "$(pwd)/$oldstylepkgfile" ]; then
pkgfile=$(pwd)/$oldstylepkgfile
elif [ -f "$PKGDEST/$oldstylepkgfile" ]; then
pkgfile=$PKGDEST/$oldstylepkgfile
else
echo "File \"$pkgfile\" doesn't exist"
exit 1
if [ "$arch" == "any" ]; then
CARCH="any"
fi
tmp=`pacman -Spd --noconfirm $pkgname`
for _pkgname in ${pkgname[@]}; do
pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
oldstylepkgfile=${_pkgname}-${pkgver}-${pkgrel}${PKGEXT}
if [ $? -ne 0 ]; then
echo "Couldn't download previous package."
if [ -f "$(pwd)/$pkgfile" ]; then
pkgfile=$(pwd)/$pkgfile
elif [ -f "$PKGDEST/$pkgfile" ]; then
pkgfile=$PKGDEST/$pkgfile
elif [ -f "$(pwd)/$oldstylepkgfile" ]; then
pkgfile=$(pwd)/$oldstylepkgfile
elif [ -f "$PKGDEST/$oldstylepkgfile" ]; then
pkgfile=$PKGDEST/$oldstylepkgfile
else
echo "File \"$pkgfile\" doesn't exist"
exit 1
fi
fi
pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev`
tmp=`pacman -Spd --noconfirm $_pkgname`
oldpkg=`strip_url $pkgurl`
if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then
echo "The built package is the one in the repo right now!"
if [ $? -ne 0 ]; then
echo "Couldn't download previous package for $_pkgname."
exit 1
fi
fi
if [ ! -f $oldpkg ]; then
pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev`
oldpkg=`strip_url $pkgurl`
if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then
echo "The built package ($_pkgname) 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://##'` .
cp `echo $pkgurl | sed 's#^file://##'` .
elif [ -f $PKGDEST/$oldpkg ]; then
cp $PKGDEST/$oldpkg .
else
wget $pkgurl
wget --quiet $pkgurl
fi
fi
fi
tar tzf $oldpkg > filelist-old
tar tzf "$pkgfile" > filelist
bsdtar tf $oldpkg > filelist-$_pkgname-old
bsdtar tf "$pkgfile" > filelist-$_pkgname
sort -o filelist filelist
sort -o filelist-old filelist-old
sort -o filelist-$_pkgname filelist-$_pkgname
sort -o filelist-$_pkgname-old filelist-$_pkgname-old
diff filelist-old filelist
diff filelist-$_pkgname-old filelist-$_pkgname
if diff filelist-old filelist | grep '\.so\.' > /dev/null 2>&1; then
if diff filelist-$_pkgname-old filelist-$_pkgname | 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
bsdtar xf "$pkgfile" > /dev/null
for i in `diff ../filelist-$_pkgname-old ../filelist-$_pkgname | grep \> | grep \.so\. | awk '{print $2}'`; do
echo -n "${i}: "
objdump -p $i | grep SONAME
done
else
echo "No filename differences"
fi
else
echo "No filename differences for $_pkgname."
fi
done
# vim:ft=sh:ts=4:sw=4:et:

121
commitpkg Executable file
View File

@@ -0,0 +1,121 @@
#!/bin/bash
abort() {
echo ${1:-"Cancelled"}
exit 1
}
# Verify that a remote file exists and is identical to a local one
# Usage: package_verify <local path> <remote host> <remote path>
package_verify() {
local remote_checksum=$(ssh $2 openssl sha1 "'$3'" 2>/dev/null |
grep -o '[0-9a-f]\{40\}$')
local local_checksum=$(openssl sha1 "$1" | grep -o '[0-9a-f]\{40\}$')
if [ -n "$remote_checksum" -a "$remote_checksum" == "$local_checksum" ]; then
return 0
fi
return 1
}
# Source makepkg.conf; fail if it is not found
if [ -r "/etc/makepkg.conf" ]; then
source "/etc/makepkg.conf"
else
abort "/etc/makepkg.conf not found!"
fi
# Source user-specific makepkg.conf overrides
if [ -r ~/.makepkg.conf ]; then
source ~/.makepkg.conf
fi
cmd=$(basename "$0")
if [ ! -f PKGBUILD ]; then
abort "No PKGBUILD file"
fi
source PKGBUILD
pkgbase=${pkgbase:-$pkgname}
# set up repo-specific opts depending on how we were called
server="gerolde.archlinux.org"
if [ "$cmd" == "extrapkg" ]; then
repo="extra"
elif [ "$cmd" == "corepkg" ]; then
repo="core"
elif [ "$cmd" == "testingpkg" ]; then
repo="testing"
elif [ "$cmd" == "communitypkg" ]; then
repo="community"
server="aur.archlinux.org"
elif [ "$cmd" == "community-testingpkg" ]; then
repo="community-testing"
server="aur.archlinux.org"
else
if [ $# -eq 0 ]; then
abort "usage: commitpkg <reponame> [-l limit] [commit message]"
fi
repo="$1"
shift
fi
# see if any limit options were passed, we'll send them to SCP
unset scpopts
if [ "$1" = "-l" ]; then
scpopts="-l $2"
shift 2
fi
for _arch in ${arch[@]}; do
echo "===> Uploading to staging/$repo for arch=${_arch}"
for _pkgname in ${pkgname[@]}; do
pkgfile=$_pkgname-$pkgver-$pkgrel-${_arch}$PKGEXT
if [ ! -f $pkgfile -a -f "$PKGDEST/$pkgfile" ]; then
pkgfile="$PKGDEST/$pkgfile"
elif [ ! -f $pkgfile ]; then
echo "File $pkgfile doesn't exist"
# skip to next architecture
continue 2
fi
# combine what we know into a variable
uploadto=staging/$repo/$(basename "$pkgfile")
# don't re-upload the same package (useful for -any sub packages)
if ! package_verify "$pkgfile" $server "$uploadto"; then
scp $scpopts "$pkgfile" $server:"$uploadto" || abort
fi
if ! package_verify "$pkgfile" $server "$uploadto"; then
abort "File got corrupted during upload, cancelled."
else
echo "File integrity okay."
fi
echo "===> Uploaded $pkgfile"
done
if [ -n "$1" ]; then
svn commit -m "upgpkg: $pkgbase $pkgver-$pkgrel
$1" >/dev/null || abort
echo "===> Commited with message:
upgpkg: $pkgbase $pkgver-$pkgrel
$1"
else
svn commit || abort
echo "===> Commited"
fi
archrelease $repo-${_arch} || abort
done
if [ "${arch[*]}" == "any" ]; then
if [ -d ../repos/$repo-i686 -a -d ../repos/$repo-x86_64 ]; then
pushd ../repos/
svn rm $repo-i686
svn rm $repo-x86_64
svn commit -m "removed $repo-i686 and $repo-x86_64 for $pkgname"
popd
fi
fi
# vim:ft=sh:ts=4:sw=4:et:

10
communityco Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
if [ "$1" = "" ]; then
echo "Usage: communityco <package name> [<package name>]"
exit 1
fi
for i in "$@"; do
svn co svn+ssh://aur.archlinux.org/srv/svn-packages/$i
done

116
extrapkg
View File

@@ -1,116 +0,0 @@
#!/bin/bash
# Source makepkg.conf; fail if it is not found
if [ -r "/etc/makepkg.conf" ]; then
source "/etc/makepkg.conf"
else
echo "/etc/makepkg.conf not found!"
exit 1
fi
# Source user-specific makepkg.conf overrides
if [ -r ~/.makepkg.conf ]; then
source ~/.makepkg.conf
fi
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/$(basename ${pkgfile})
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"
# vim:ft=sh:ts=4:sw=4:et:

View File

@@ -12,44 +12,58 @@ FORCE="n"
RUN=""
MAKEPKG_ARGS="-sr"
REPACK=""
LAYER="rw"
WORKDIR=$PWD
clean_first="0"
chrootdir="$CHROOT_SHELL"
update_first="0"
clean_first="0"
install_pkg=""
add_to_db=0
chrootdir=""
APPNAME=$(basename "${0}")
usage ()
{
echo "usage ${APPNAME} [-h] [-c] [-r CHROOT_SHELL] [--] [makepkg args]"
echo "usage ${APPNAME} [options] -r <chrootdir> [--] [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 " The chroot dir consists of the following directories:"
echo " <chrootdir>/{root, rw, union} but only 'root' is required"
echo " by default. The rest will be created as needed"
echo ""
echo "The -c flag, if specified, will remove all files created by previous"
echo "builds using makechrootpkg. This will ensure a clean chroot is used."
echo ""
echo "The chroot shell 'root' directory must be created via the following"
echo "The chroot 'root' directory must be created via the following"
echo "command:"
echo " mkarchroot \$CHROOT_SHELL/root base base-devel sudo"
echo ""
echo "If you have problems passing params to makepkg or need to pass long"
echo "options, put -- between the makechrootpkg args and the makepkg args"
echo " mkarchroot <chrootdir>/root base base-devel sudo"
echo ""
echo "Default makepkg args: $MAKEPKG_ARGS"
echo ""
echo "Flags:"
echo "-h This help"
echo "-c Clean the chroot before building"
echo "-u Update the rw layer of the chroot before building"
echo " This is useful for rebuilds without dirtying the pristine"
echo " chroot"
echo "-d Add the package to a local db at /repo after building"
echo "-r <dir> The chroot shell to use"
echo "-I <pkg> Install a package into the rw layer of the chroot"
echo "-l <layer> The directory to use as the rw layer of the union"
echo " Useful for maintain multiple layers. Default: rw"
exit 1
}
while getopts ':r:h:c' arg; do
while getopts 'hcudr:I:l:' arg; do
case "${arg}" in
r) chrootdir="$OPTARG" ;;
h) usage ;;
c) clean_first=1 ;;
h|?) usage ;;
u) update_first=1 ;;
d) add_to_db=1 ;;
r) chrootdir="$OPTARG" ;;
I) install_pkg="$OPTARG" ;;
l) LAYER="$OPTARG" ;;
*) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;;
esac
done
@@ -80,40 +94,54 @@ fi
source PKGBUILD
if [ ! -d "$chrootdir" ]; then
echo "No \$CHROOT_SHELL defined, or invalid path ($chrootdir)"
echo "No chroot dir defined, or invalid path '$chrootdir'"
exit 1
fi
if [ ! -d "$chrootdir/root" ]; then
echo "Missing \$CHROOT_SHELL root directory."
echo "Try using: mkarchroot \$CHROOT_SHELL base base-devel sudo"
echo "Missing chroot dir root directory."
echo "Try using: mkarchroot $chrootdir/root base base-devel sudo"
usage
fi
[ -d "$chrootdir/rw" -a "$clean_first" -eq "1" ] && rm -rf "$chrootdir/rw/"
[ -d "$chrootdir/rw" ] || mkdir "$chrootdir/rw"
[ -d "$chrootdir/$LAYER" -a "$clean_first" -eq "1" ] && rm -rf "$chrootdir/$LAYER/"
[ -d "$chrootdir/$LAYER" ] || mkdir "$chrootdir/$LAYER"
[ -d "$chrootdir/union" ] || mkdir "$chrootdir/union"
cleanup ()
{
echo "cleaning up unioned mounts"
umount "$chrootdir/union/pkgdest" 2>/dev/null
umount "$chrootdir/union/srcdest" 2>/dev/null
umount "$chrootdir/union"
}
uniondir="$chrootdir/union"
echo "building union chroot"
grep -Fq unionfs /proc/filesystems
grep -Fq aufs /proc/filesystems
if [ $? -ne 0 ]; then
modprobe -q unionfs
if [ $? -ne 0 ];
echo "ERROR: No unionfs available. Abandon ship!" && exit 1
modprobe -q aufs
if [ $? -ne 0 ]; then
echo "ERROR: No aufs available. Abandon ship!" && exit 1
fi
fi
mount -t unionfs none -o "dirs=$chrootdir/rw=rw:$chrootdir/root=ro" "$uniondir"
mount -t aufs none -o "dirs=$chrootdir/$LAYER=rw:$chrootdir/root=ro" "$uniondir"
trap 'cleanup' 0 1 2 15
if [ -n "$install_pkg" ]; then
pkgname="$(basename "$install_pkg")"
echo "installing '$pkgname' in chroot"
cp "$install_pkg" "$uniondir/$pkgname"
mkarchroot -r "pacman -U /$pkgname" "$uniondir"
ret=$?
rm "$uniondir/$pkgname"
#exit early, we've done all we need to
exit $ret
fi
if [ $update_first -eq 1 ]; then
echo "updating chroot"
mkarchroot -r "pacman -Syu --noconfirm" "$uniondir"
fi
echo "moving build files to chroot"
[ -d "$uniondir/build" ] || mkdir "$uniondir/build"
@@ -122,30 +150,13 @@ if [ "$REPACK" != "1" ]; then
rm -rf "$uniondir/build/"*
fi
# Copy makepkg.conf and ~/.makepkg.conf into the chroot so packager has
# all their custom variables set.
if [ -r "/etc/makepkg.conf" ]; then
rm $uniondir/etc/makepkg.conf
cp /etc/makepkg.conf $uniondir/etc/makepkg.conf
fi
if [ -r ~/.makepkg.conf ]; then
cat ~/.makepkg.conf >> $uniondir/etc/makepkg.conf
fi
source $uniondir/etc/makepkg.conf
# Magic trickery with PKGDEST and SRCDEST, so that the built
# files end up where they're expected in the _real_ filesystem
[ -d "$uniondir/srcdest" ] || mkdir "$uniondir/srcdest"
[ -d "$uniondir/pkgdest" ] || mkdir "$uniondir/pkgdest"
[ ! -z "$PKGDEST" ] && mount --bind "$PKGDEST" "$uniondir/pkgdest"
[ ! -z "$SRCDEST" ] && mount --bind "$SRCDEST" "$uniondir/srcdest"
if ! grep "PKGDEST=/pkgdest" "$uniondir/etc/makepkg.conf" >/dev/null 2>&1; then
echo "Setting PKGDEST in makepkg.conf"
echo "PKGDEST=/pkgdest" >> "$uniondir/etc/makepkg.conf"
fi
[ -d "$uniondir/srcdest" ] || mkdir "$uniondir/srcdest"
if ! grep "SRCDEST=/srcdest" "$uniondir/etc/makepkg.conf" >/dev/null 2>&1; then
echo "Setting SRCDEST in makepkg.conf"
echo "SRCDEST=/srcdest" >> "$uniondir/etc/makepkg.conf"
@@ -159,17 +170,35 @@ chown -R nobody "$uniondir/pkgdest"
source PKGBUILD
cp PKGBUILD "$uniondir/build/"
for f in ${source[@]}; do
basef=$(basename $f)
basef=$(echo $f | sed 's|::.*||' | sed 's|^.*://.*/||g')
if [ -f "$basef" ]; then
cp "$basef" "$uniondir/srcdest/"
elif [ -f "$SRCDEST/$basef" ]; then
cp "$SRCDEST/$basef" "$uniondir/srcdest/"
fi
done
if [ "$install" != "" -a -f "$install" ]; then
cp "$install" "$uniondir/build/"
install_files=$(grep "install=" PKGBUILD)
for pkg in ${pkgname[@]}; do
install_files+=' '
install_files+=$(echo $install_files |sed "s/\$pkgname/$pkg/"|sed "s/\${pkgname}/$pkg/")
install_files=$(eval echo $install_files |tr '[:blank:]' '\n'|sort |uniq)
done
for f in $install_files;do
install="${f#"install="}"
if [ "$install" != "" -a -f "$install" ]; then
cp "$install" "$uniondir/build/"
fi
done
if [ -f "ChangeLog" ]; then
cp ChangeLog "$uniondir/build/"
fi
if ! grep "^nobody" "$uniondir/etc/sudoers" >/dev/null 2>&1; then
echo "allowing 'nobody' sudo rights in the chroot"
touch "$uniondir/etc/sudoers"
echo "nobody ALL=(ALL) NOPASSWD: ALL" >> "$uniondir/etc/sudoers"
chmod 440 "$uniondir/etc/sudoers"
fi
@@ -180,29 +209,63 @@ fi
#!/bin/bash
export LANG=$LOCALE
cd /build
export HOME=/build
sudo -u nobody makepkg $MAKEPKG_ARGS || touch BUILD_FAILED
[ -f BUILD_FAILED ] && exit 1
which namcap &>/dev/null && namcap /build/PKGBUILD /pkgdest/*${PKGEXT} > /pkgdest/namcap.log
exit 0
EOF
) > "$uniondir/chrootbuild"
chmod +x "$uniondir/chrootbuild"
mkarchroot -r "/chrootbuild" "$uniondir"
if mkarchroot -r "/chrootbuild" "$uniondir"; then
if [ -e ${chrootdir}/rw/build/BUILD_FAILED ]; then
echo "Build failed, check \$CHROOT_DIR/rw/build"
rm ${chrootdir}/rw/build/BUILD_FAILED
exit 1
else
source ${WORKDIR}/PKGBUILD
if [ -z "$(mount | grep ${chrootdir}/union/pkgdest)" ]; then
echo "Moving completed package file to ${WORKDIR}"
mv ${chrootdir}/union/pkgdest/${pkgname}-${pkgver}-${pkgrel}-*.pkg.tar.gz ${WORKDIR}
fi
if [ -z "$(mount | grep ${chrootdir}/union/srcdest)" ]; then
echo "Moving downloaded source files to ${WORKDIR}"
mv ${chrootdir}/union/srcdest/* ${WORKDIR}
fi
rm -rf ${chrootdir}/rw/build/*
echo "Build complete"
# Source global makepkg.conf for SRCDEST and PKGDEST vars
[ -f /etc/makepkg.conf ] && source /etc/makepkg.conf
[ -f ~/.makepkg.conf ] && source ~/.makepkg.conf
for pkgfile in "${chrootdir}"/union/pkgdest/*${PKGEXT}; do
[ -e "$pkgfile" ] || continue
_pkgname=$(basename "$pkgfile")
if [ "$add_to_db" -eq "1" ]; then
[ -d "${chrootdir}/union/repo" ] || mkdir -p "${chrootdir}/union/repo"
pushd "${chrootdir}/union/repo" >/dev/null
cp "$pkgfile" .
repo-add repo.db.tar.${DB_COMPRESSION} "$_pkgname"
popd >/dev/null
fi
if [ -d "$PKGDEST" ]; then
echo "Moving completed ${_pkgname%${PKGEXT}} package file to ${PKGDEST}"
mv "$pkgfile" "${PKGDEST}"
else
echo "Moving completed ${_pkgname%${PKGEXT}} package file to ${WORKDIR}"
mv "$pkgfile" "${WORKDIR}"
fi
done
for f in "${chrootdir}"/union/srcdest/*; do
[ -e "$f" ] || continue
if [ -d "$SRCDEST" ]; then
echo "Moving downloaded source file $(basename $f) to ${SRCDEST}"
mv "$f" "${SRCDEST}"
else
echo "Moving downloaded source file $(basename $f) to ${WORKDIR}"
mv "$f" "${WORKDIR}"
fi
done
else
#just in case. We returned 1, make sure we fail
touch "${chrootdir}/union/build/BUILD_FAILED"
fi
if [ -e "${chrootdir}/union/build/BUILD_FAILED" ]; then
echo "Build failed, check $chrootdir/$LAYER/build"
rm "${chrootdir}/union/build/BUILD_FAILED"
else
rm -rf "${chrootdir}"/union/build/*
echo "Build complete"
fi
# vim:ft=sh:ts=4:sw=4:et:

View File

@@ -10,6 +10,7 @@
FORCE="n"
RUN=""
NOCOPY="n"
working_dir=""
@@ -25,6 +26,7 @@ usage ()
echo " -f Force overwrite of files in the working-dir"
echo " -C <file> location of a pacman config file"
echo " -M <file> location of a makepkg config file"
echo " -n do not copy config files into the chroot"
echo " -h This message"
exit $1
}
@@ -36,6 +38,7 @@ while getopts 'r:ufhC:M:' arg; do
f) FORCE="y" ;;
C) pac_conf="$OPTARG" ;;
M) makepkg_conf="$OPTARG" ;;
n) NOCOPY="y" ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
@@ -161,19 +164,21 @@ else
ldconfig -r "${working_dir}"
fi
if [ "$pac_conf" != "" ]; then
if [ "$pac_conf" != "" -a "$NOCOPY" = "n" ]; then
echo "installing custom pacman.conf"
cp ${pac_conf} ${working_dir}/etc/pacman.conf
fi
if [ "$makepkg_conf" != "" ]; then
if [ "$makepkg_conf" != "" -a "$NOCOPY" = "n" ]; then
echo "installing custom makepkg.conf"
cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf
fi
echo "generating default locales"
cp /etc/locale.gen "${working_dir}/etc/locale.gen"
chroot "${working_dir}" locale-gen
if [ -e "${working_dir}/etc/locale.gen" ]; then
echo "generating default locales from host system"
cp /etc/locale.gen "${working_dir}/etc/locale.gen"
chroot "${working_dir}" locale-gen
fi
if [ ! -e "${working_dir}/.arch-chroot" ]; then
date +%s > "${working_dir}/.arch-chroot"

101
rebuildpkgs Executable file
View File

@@ -0,0 +1,101 @@
#!/bin/bash
# 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
if [ $# -le 1 ]; then
echo "usage: $(basename $0) <chrootdir> <packages to rebuild>"
echo " example: $(basename $0) ~/chroot readline bash foo bar baz"
exit 1
fi
# Source makepkg.conf; fail if it is not found
if [ -r "/etc/makepkg.conf" ]; then
source "/etc/makepkg.conf"
else
echo "/etc/makepkg.conf not found!"
exit 1
fi
die () {
echo $@ >&2
exit 1
}
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=$(echo $oldrel | cut -d. -f1)
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
(. PKGBUILD; echo "$pkgname-$pkgver-$pkgrel-$CARCH$PKGEXT")
}
chrootdir="$1"; shift
pkgs="$@"
SVNPATH="svn+ssh://gerolde.archlinux.org/srv/svn-packages"
echo ":: Work will be done in $(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"
echo ":: Building '$pkg'"
/usr/bin/svn update "$pkg"
if [ ! -d "$pkg/trunk" ]; then
FAILED="$FAILED $pkg"
echo ":: $pkg does not exist in SVN"
continue
fi
cd "$pkg/trunk/"
bump_pkgrel
if ! sudo makechrootpkg -u -d -r "$chrootdir" -- --noconfirm; then
FAILED="$FAILED $pkg"
echo ":: $pkg Failed!"
else
pkgfile=$(pkg_from_pkgbuild)
if [ -e "$pkgfile" ]; then
echo ":: $pkg Complete"
else
FAILED="$FAILED $pkg"
echo ":: $pkg Failed, no package built!"
fi
fi
done
cd "$REBUILD_ROOT"
if [ "$FAILED" != "" ]; then
echo "Packages failed:"
for pkg in $FAILED; do
echo -e "\t$pkg"
done
fi
echo "SVN pkgbumps in svn-packages/ - commit when ready"