Compare commits

...

111 Commits
0.4 ... 0.7.0

Author SHA1 Message Date
Eric Bélanger
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 Bélanger <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
14 changed files with 739 additions and 191 deletions

View File

@@ -1,14 +1,38 @@
all: all:
install: install:
# extrapkg/checkpkg and friends # commitpkg/checkpkg and friends
mkdir -p $(DESTDIR)/usr/bin mkdir -p $(DESTDIR)/usr/bin
install -m 755 checkpkg $(DESTDIR)/usr/bin install -m 755 checkpkg $(DESTDIR)/usr/bin
install -m 755 extrapkg $(DESTDIR)/usr/bin install -m 755 commitpkg $(DESTDIR)/usr/bin
ln -s extrapkg $(DESTDIR)/usr/bin/corepkg ln -sf commitpkg $(DESTDIR)/usr/bin/extrapkg
ln -s extrapkg $(DESTDIR)/usr/bin/testingpkg ln -sf commitpkg $(DESTDIR)/usr/bin/corepkg
ln -s extrapkg $(DESTDIR)/usr/bin/unstablepkg ln -sf commitpkg $(DESTDIR)/usr/bin/testingpkg
ln -sf commitpkg $(DESTDIR)/usr/bin/communitypkg
# arch{co,release,rm}
install -m 755 archco $(DESTDIR)/usr/bin
install -m 755 archrelease $(DESTDIR)/usr/bin
install -m 755 archrm $(DESTDIR)/usr/bin
# new chroot tools, only usable by root # new chroot tools, only usable by root
mkdir -p $(DESTDIR)/usr/sbin mkdir -p $(DESTDIR)/usr/sbin
install -m 755 mkarchroot $(DESTDIR)/usr/sbin install -m 755 mkarchroot $(DESTDIR)/usr/sbin
install -m 755 makechrootpkg $(DESTDIR)/usr/sbin install -m 755 makechrootpkg $(DESTDIR)/usr/sbin
#Additional packaging helper scripts
install -m 755 lddd $(DESTDIR)/usr/bin
install -m 755 finddeps $(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/communitypkg
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

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

48
archrelease Executable file
View File

@@ -0,0 +1,48 @@
#!/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 [ ! -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

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

@@ -1,6 +1,17 @@
#!/bin/bash #!/bin/bash
source /etc/makepkg.conf # 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
strip_url() { strip_url() {
echo $1 | sed 's|^.*://.*/||g' echo $1 | sed 's|^.*://.*/||g'
@@ -13,21 +24,20 @@ fi
source PKGBUILD source PKGBUILD
pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}.pkg.tar.gz pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}${PKGEXT}
if [ ! -f $pkgfile ]; then if [ -f "$(pwd)/$pkgfile" ]; then
if [ -f $PKGDEST/$pkgfile ]; then pkgfile=$(pwd)/$pkgfile
pkgfile=$PKGDEST/$pkgfile elif [ -f "$PKGDEST/$pkgfile" ]; then
oldstylepkgfile=$PKGDEST/$oldstylepkgfile pkgfile=$PKGDEST/$pkgfile
elif [ -f $oldstylepkgfile ]; then elif [ -f "$(pwd)/$oldstylepkgfile" ]; then
pkgfile=$oldstylepkgfile pkgfile=$(pwd)/$oldstylepkgfile
elif [ -f $PKGDEST/$oldstylepkgfile ]; then elif [ -f "$PKGDEST/$oldstylepkgfile" ]; then
pkgfile=$PKGDEST/$oldstylepkgfile pkgfile=$PKGDEST/$oldstylepkgfile
else else
echo "File $pkgfile doesn't exist" echo "File \"$pkgfile\" doesn't exist"
exit 1 exit 1
fi
fi fi
tmp=`pacman -Spd --noconfirm $pkgname` tmp=`pacman -Spd --noconfirm $pkgname`
@@ -41,7 +51,7 @@ pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev`
oldpkg=`strip_url $pkgurl` oldpkg=`strip_url $pkgurl`
if [ "$oldpkg" = "$pkgfile" ]; then if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then
echo "The built package is the one in the repo right now!" echo "The built package is the one in the repo right now!"
exit 1 exit 1
fi fi
@@ -54,8 +64,8 @@ if [ ! -f $oldpkg ]; then
fi fi
fi fi
tar tzf $oldpkg > filelist-old bsdtar tf $oldpkg > filelist-old
tar tzf $pkgfile > filelist bsdtar tf "$pkgfile" > filelist
sort -o filelist filelist sort -o filelist filelist
sort -o filelist-old filelist-old sort -o filelist-old filelist-old
@@ -65,7 +75,7 @@ diff filelist-old filelist
if diff filelist-old filelist | grep '\.so\.' > /dev/null 2>&1; then if diff filelist-old filelist | grep '\.so\.' > /dev/null 2>&1; then
mkdir -p pkg mkdir -p pkg
cd pkg cd pkg
tar xzf ../$pkgfile > /dev/null bsdtar xf "$pkgfile" > /dev/null
for i in `diff ../filelist-old ../filelist | grep \> | grep \.so\. | awk '{print $2}'`; do for i in `diff ../filelist-old ../filelist | grep \> | grep \.so\. | awk '{print $2}'`; do
echo -n "${i}: " echo -n "${i}: "
objdump -p $i | grep SONAME objdump -p $i | grep SONAME
@@ -73,3 +83,5 @@ if diff filelist-old filelist | grep '\.so\.' > /dev/null 2>&1; then
else else
echo "No filename differences" echo "No filename differences"
fi fi
# vim:ft=sh:ts=4:sw=4:et:

119
commitpkg Executable file
View File

@@ -0,0 +1,119 @@
#!/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
if [ -z "$CARCH" ]; then
echo "CARCH must be set to a recognized value!"
exit 1
fi
source PKGBUILD
pkgbase=${pkgbase:-${pkgname[0]}}
for _pkgname in ${pkgname[@]}; do
pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
anypkgfile=${_pkgname}-${pkgver}-${pkgrel}-any${PKGEXT}
if [ ! -f $pkgfile ]; then
if [ -f $PKGDEST/$pkgfile ]; then
pkgfile=$PKGDEST/$pkgfile
elif [ -f $anypkgfile ]; then
pkgfile=$anypkgfile
CARCH=any
elif [ -f $PKGDEST/$anypkgfile ]; then
pkgfile=$PKGDEST/$anypkgfile
CARCH=any
else
echo "File $pkgfile doesn't exist"
exit 1
fi
fi
# 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"
else
if [ $# -eq 0 ]; then
echo "usage: commitpkg <reponame> [-l limit] [commit message]"
exit 1
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="$1 $2"
shift 2
fi
# combine what we know into a variable
uploadto="staging/${repo}/$(basename ${pkgfile})"
scp ${scpopts} "${pkgfile}" "${server}:${uploadto}"
if [ "$(md5sum "${pkgfile}" | cut -d' ' -f1)" != "$(ssh ${server} md5sum "${uploadto}" | cut -d' ' -f1)" ]; then
echo "File got corrupted during upload, cancelled."
exit 1
else
echo "File integrity okay."
fi
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Uploaded $pkgfile"
done
if [ "$1" != "" ]; then
svn commit -m "upgpkg: $pkgbase $pkgver-$pkgrel
$1" > /dev/null
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel
$1\" message"
else
svn commit >/dev/null
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Commited with \"upgpkg: $pkgbase $pkgver-$pkgrel\" message"
fi
archrelease $repo-$CARCH
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Tagged for $repo-$CARCH"
# vim:ft=sh:ts=4:sw=4:et:

33
commitpkg2any Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
# This script commits an existing package as an 'any'
# package. It is simply to help aid in the conversion
# to any-based packages
if [ $# -ne 1 ]; then
echo "Syntax: $(basename $0) <repo>"
exit 1
fi
repo=$1
source PKGBUILD
sed -i 's|^arch=.\+$|arch=(any)|' PKGBUILD
svn commit -m "upgpkg: $pkgname $pkgver-$pkgrel
Converted to arch=any" > /dev/null
archrelease $repo-any
if [ $? -ne 0 ]; then
echo "Cancelled"
exit 1
fi
echo "===> Tagged for $repo-any"
pushd ..
svn rm $repo-i686
svn rm $repo-x86_64
svn commit -m "removed $repo-i686 and $repo-x86_64 for $pkgname"
popd
echo "Don't forget to run \"/arch/db-update $repo\" on gerolde"

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

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"

41
finddeps Executable file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
#
# finddeps - find packages that depend on a given depname
#
if [ "$1" = "" ]; 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 0
fi
match=$1
tld=$(pwd)
for d in $(find . -type d); do
cd $d
if [ -f PKGBUILD ]; then
unset pkgname depends makedepends
. PKGBUILD
for dep in "${depends[@]}"; do
# lose the version comaparator, if any
depname=${dep%%[<>=]*}
if [ "$depname" = "$match" ]; then
echo "$d (depends)"
fi
done
for dep in "${makedepends[@]}"; do
# lose the version comaparator, if any
depname=${dep%%[<>=]*}
if [ "$depname" = "$match" ]; then
echo "$d (makedepends)"
fi
done
fi
cd $tld
done
# vim:ft=sh:ts=4:sw=4:et:

47
lddd Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/sh
#
# lddd - find broken library links on your machine
#
ifs=$IFS
IFS=':'
libdirs="/lib:/usr/lib:/opt/qt/lib:/opt/kde/lib:/usr/lib/libfakeroot:/opt/NX/lib"
extras=
TEMPDIR=$(mktemp /tmp/lddd-script.XXXX)
rm $TEMPDIR
mkdir -p $TEMPDIR
echo " 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
echo DIR $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'` -ne 0 ]; then
# Is an ELF binary.
if [ `ldd $i 2>/dev/null | grep -c 'not found'` -ne 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
for i in $(cat $TEMPDIR/affected-files.txt); do
pacman -Qo $i | awk '{print $4,$5}' >> $TEMPDIR/pacman.txt
done
# clean list
sort -u $TEMPDIR/pacman.txt >> $TEMPDIR/possible-rebuilds.txt
echo "Files saved to $TEMPDIR"
# vim:ft=sh:ts=4:sw=4:et:

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. # the Free Software Foundation; version 2 of the License.
@@ -10,91 +10,202 @@
FORCE="n" FORCE="n"
RUN="" RUN=""
MAKEPKG_ARGS="-Ss" MAKEPKG_ARGS="-sr"
REPACK=""
LAYER="rw"
WORKDIR=$PWD
chrootdir="$CHROOT_SHELL" update_first="0"
clean_first="0"
install_pkg=""
add_to_db=0
chrootdir=""
APPNAME=$(basename "${0}") APPNAME=$(basename "${0}")
if [ ! -f PKGBUILD ]; then usage ()
echo "This must be run in the directory of a built package." {
exit 1 echo "usage ${APPNAME} [options] -r <chrootdir> [--] [makepkg args]"
fi echo " Run this script in a PKGBUILD dir to build a package inside a"
source PKGBUILD echo " clean chroot. All unrecognized arguments passed to this script"
echo " will be passed to makepkg."
echo ""
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 chroot 'root' directory must be created via the following"
echo "command:"
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 'hcudr:I:l:' arg; do
case "${arg}" in
h) usage ;;
c) clean_first=1 ;;
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
#Get rid of trailing / in chrootdir
[ "$chrootdir" != "/" ] && chrootdir=$(echo $chrootdir | sed 's#/$##')
# Pass all arguments after -- right to makepkg
MAKEPKG_ARGS="$MAKEPKG_ARGS ${*:$OPTIND}"
# See if -R was passed to makepkg
for arg in ${*:$OPTIND}; do
if [ "$arg" = "-R" ]; then
REPACK=1
break;
fi
done
if [ "$EUID" != "0" ]; then if [ "$EUID" != "0" ]; then
echo "This script must be run as root." echo "This script must be run as root."
exit 1 exit 1
fi fi
usage () if [ ! -f PKGBUILD ]; then
{ echo "This must be run in a directory containing a PKGBUILD."
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 exit 1
} fi
source PKGBUILD
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 if [ ! -d "$chrootdir" ]; then
echo "No \$CHROOT_SHELL defined, or invalid path" echo "No chroot dir defined, or invalid path '$chrootdir'"
exit 1 exit 1
fi fi
if [ ! -d "$chrootdir/root" ]; then if [ ! -d "$chrootdir/root" ]; then
echo "Missing \$CHROOT_SHELL root directory." echo "Missing chroot dir root directory."
echo "Try using: mkarchroot \$CHROOT_SHELL base base-devel sudo" echo "Try using: mkarchroot $chrootdir/root base base-devel sudo"
usage usage
fi fi
[ -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" [ -d "$chrootdir/union" ] || mkdir "$chrootdir/union"
function cleanup () cleanup ()
{ {
echo "cleaning up unioned mounts" echo "cleaning up unioned mounts"
umount "$chrootdir/union/pkgdest" 2>/dev/null
umount "$chrootdir/union/srcdest" 2>/dev/null
umount "$chrootdir/union" umount "$chrootdir/union"
} }
uniondir="$chrootdir/union" uniondir="$chrootdir/union"
echo "building union chroot" echo "building union chroot"
modprobe -q unionfs grep -Fq aufs /proc/filesystems
mount -t unionfs none -o "dirs=$chrootdir/rw=rw:$chrootdir/root=ro" "$uniondir" if [ $? -ne 0 ]; then
modprobe -q aufs
if [ $? -ne 0 ]; then
echo "ERROR: No aufs available. Abandon ship!" && exit 1
fi
fi
mount -t aufs none -o "dirs=$chrootdir/$LAYER=rw:$chrootdir/root=ro" "$uniondir"
trap 'cleanup' 0 1 2 15 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" echo "moving build files to chroot"
[ -d "$uniondir/build" ] || mkdir "$uniondir/build" [ -d "$uniondir/build" ] || mkdir "$uniondir/build"
if [ "$REPACK" != "1" ]; then
#Remove anything in there UNLESS -R (repack) was passed to makepkg
rm -rf "$uniondir/build/"*
fi
source $uniondir/etc/makepkg.conf
[ -d "$uniondir/pkgdest" ] || mkdir "$uniondir/pkgdest"
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"
fi
chown -R nobody "$uniondir/build"
chown -R nobody "$uniondir/srcdest"
chown -R nobody "$uniondir/pkgdest"
# Copy PKGBUILD and sources
source PKGBUILD source PKGBUILD
cp PKGBUILD "$uniondir/build/" cp PKGBUILD "$uniondir/build/"
for f in ${source[@]}; do for f in ${source[@]}; do
if [ -f "$f" ]; then basef=$(echo $f | sed 's|::.*||' | sed 's|^.*://.*/||g')
cp "$f" "$uniondir/build/" if [ -f "$basef" ]; then
cp "$basef" "$uniondir/srcdest/"
elif [ -f "$SRCDEST/$basef" ]; then
cp "$SRCDEST/$basef" "$uniondir/srcdest/"
fi fi
done done
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/")
done
install_files=$(eval echo $install_files |tr '[:blank:]' '\n'|sort |uniq)
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 if ! grep "^nobody" "$uniondir/etc/sudoers" >/dev/null 2>&1; then
echo "allowing 'nobody' sudo rights in the chroot" echo "allowing 'nobody' sudo rights in the chroot"
echo "nobody ALL=(ALL) NOPASSWD: ALL" >> $uniondir/etc/sudoers touch "$uniondir/etc/sudoers"
echo "nobody ALL=(ALL) NOPASSWD: ALL" >> "$uniondir/etc/sudoers"
chmod 440 "$uniondir/etc/sudoers"
fi fi
#This is a little gross, but this way the script is recreated every time in the #This is a little gross, but this way the script is recreated every time in the
@@ -103,12 +214,61 @@ fi
#!/bin/bash #!/bin/bash
export LANG=$LOCALE export LANG=$LOCALE
cd /build cd /build
sudo -u nobody makepkg "$MAKEPKG_ARGS" 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 EOF
) > "$uniondir/chrootbuild" ) > "$uniondir/chrootbuild"
chmod +x "$uniondir/chrootbuild" chmod +x "$uniondir/chrootbuild"
./mkarchroot -r "/chrootbuild" "$uniondir" if mkarchroot -r "/chrootbuild" "$uniondir"; then
source ${WORKDIR}/PKGBUILD
# TODO move relevant files here for _pkgname in ${pkgname[@]}; do
echo "build complete... check \$CHROOT_SHELL/build for build results" pkgfile="${chrootdir}"/union/pkgdest/${_pkgname}-*${PKGEXT}
if [ -n "$add_to_db" -a -e "$pkgfile" ]; 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}-${pkgver}-${pkgrel}-*${PKGEXT}
popd >/dev/null
fi
if [ -e $pkgfile ]; then
if [ -n "$PKGDEST" ]; then
echo "Moving completed ${_pkgname} package file to ${PKGDEST}"
mv $pkgfile "${PKGDEST}"
else
echo "Moving completed ${_pkgname} package file to ${WORKDIR}"
mv $pkgfile "${WORKDIR}"
fi
fi
done
for f in ${chrootdir}/union/srcdest/*; do
[ -e "$f" ] || continue
if [ -n "$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

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. # the Free Software Foundation; version 2 of the License.
@@ -10,6 +10,7 @@
FORCE="n" FORCE="n"
RUN="" RUN=""
NOCOPY="n"
working_dir="" working_dir=""
@@ -23,15 +24,21 @@ usage ()
echo " -r <app> Run 'app' within the context of the chroot" echo " -r <app> Run 'app' within the context of the chroot"
echo " -u Update the chroot via pacman" echo " -u Update the chroot via pacman"
echo " -f Force overwrite of files in the working-dir" 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" echo " -h This message"
exit $1 exit $1
} }
while getopts 'r:ufh' arg; do while getopts 'r:ufhC:M:' arg; do
case "${arg}" in case "${arg}" in
r) RUN="$OPTARG" ;; r) RUN="$OPTARG" ;;
u) RUN="pacman -Syu" ;; u) RUN="pacman -Syu" ;;
f) FORCE="y" ;; f) FORCE="y" ;;
C) pac_conf="$OPTARG" ;;
M) makepkg_conf="$OPTARG" ;;
n) NOCOPY="y" ;;
h|?) usage 0 ;; h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;; *) echo "invalid argument '${arg}'"; usage 1 ;;
esac esac
@@ -44,7 +51,7 @@ fi
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
if [ "$RUN" == "" -a $# -lt 2 ]; then if [ "$RUN" = "" -a $# -lt 2 ]; then
echo "you must specify a directory and one or more packages" echo "you must specify a directory and one or more packages"
usage 1 usage 1
elif [ $# -lt 1 ]; then elif [ $# -lt 1 ]; then
@@ -59,7 +66,7 @@ shift 1
# {{{ functions # {{{ functions
function chroot_mount () chroot_mount ()
{ {
echo "mounting sysfs : /sys" echo "mounting sysfs : /sys"
[ -e "${working_dir}/sys" ] || mkdir "${working_dir}/sys" [ -e "${working_dir}/sys" ] || mkdir "${working_dir}/sys"
@@ -80,7 +87,17 @@ function chroot_mount ()
trap 'chroot_umount' 0 1 2 15 trap 'chroot_umount' 0 1 2 15
} }
function chroot_umount () copy_hostconf ()
{
echo "copying mtab : /etc/mtab"
cp /etc/mtab "${working_dir}/etc/mtab"
echo "copying resolv.conf : /etc/resolv.conf"
cp /etc/resolv.conf "${working_dir}/etc/resolv.conf"
}
chroot_umount ()
{ {
echo "cleaning up mounts" echo "cleaning up mounts"
umount "${working_dir}/proc" umount "${working_dir}/proc"
@@ -91,36 +108,40 @@ function chroot_umount ()
# }}} # }}}
if [ "$RUN" != "" ]; then if [ "$RUN" != "" ]; then
# run chroot {{{ # run chroot {{{
#Sanity check #Sanity check
if [ ! -f "${working_dir}/.arch-chroot" ]; then if [ ! -f "${working_dir}/.arch-chroot" ]; then
echo "error: '${working_dir}' does not appear to be a Arch chroot" echo "error: '${working_dir}' does not appear to be a Arch chroot"
echo " please build the image using mkarchchroot" echo " please build the image using mkarchroot"
exit 1 exit 1
fi fi
chroot_mount chroot_mount
copy_hostconf
echo "starting chroot ($RUN)" echo "starting chroot ($RUN)"
chroot "${working_dir}" "${RUN}" chroot "${working_dir}" ${RUN}
# }}} # }}}
else else
# {{{ build chroot # {{{ build chroot
if [ -e "${working_dir}" -a "${FORCE}" = "n" ]; then if [ -e "${working_dir}" -a "${FORCE}" = "n" ]; then
echo "error: working dir '${working_dir}' already exists - try using -f" echo "error: working dir '${working_dir}' already exists - try using -f"
exit 1 exit 1
fi fi
mkdir -p "${working_dir}/var/lib/pacman/" mkdir -p "${working_dir}/var/lib/pacman/"
mkdir -p "${working_dir}/etc/"
chroot_mount chroot_mount
pacargs="--noconfirm -v " #--noprogressbar -v pacargs="--noconfirm -v " #--noprogressbar -v
pacargs="$pacargs --root=${working_dir}" pacargs="$pacargs --root=${working_dir}"
# pacman takes these as relative to the given root # pacman takes these as relative to the given root
pacargs="$pacargs --dbpath=/var/lib/pacman"
pacargs="$pacargs --cachedir=/var/cache/pacman/pkg" pacargs="$pacargs --cachedir=/var/cache/pacman/pkg"
if [ "$pac_conf" != "" ]; then
pacargs="$pacargs --config=${pac_conf}"
fi
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
echo "no packages to install" echo "no packages to install"
@@ -129,7 +150,7 @@ else
for i in $@; do echo -e "\t$i"; done for i in $@; do echo -e "\t$i"; done
op="-Sy" op="-Sy"
if [ "$FORCE" == "y" ]; then if [ "$FORCE" = "y" ]; then
op="${op}f" op="${op}f"
fi fi
if ! pacman ${op} ${pacargs} $@; then if ! pacman ${op} ${pacargs} $@; then
@@ -143,14 +164,26 @@ else
ldconfig -r "${working_dir}" ldconfig -r "${working_dir}"
fi fi
echo "generating default locales" if [ "$pac_conf" != "" -a "$NOCOPY" = "n" ]; then
sed -i "s|^#\(.*$LANG\)|\1|g" "${working_dir}/etc/locale.gen" echo "installing custom pacman.conf"
chroot "${working_dir}" locale-gen cp ${pac_conf} ${working_dir}/etc/pacman.conf
fi
if [ "$makepkg_conf" != "" -a "$NOCOPY" = "n" ]; then
echo "installing custom makepkg.conf"
cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf
fi
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 if [ ! -e "${working_dir}/.arch-chroot" ]; then
date +%s > "${working_dir}/.arch-chroot" date +%s > "${working_dir}/.arch-chroot"
fi fi
# }}} # }}}
fi fi
# vim:ft=sh:ts=4:sw=4:et: # vim:ft=sh:ts=4:sw=4:et:

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"