Compare commits

..

102 Commits

Author SHA1 Message Date
Pierre Schmitz
e64c1d33eb prepare release 2011-08-14 14:12:54 +02:00
Pierre Schmitz
19f3a868f4 update makepkg.conf from pacman 3.5.4-4 2011-08-14 14:12:34 +02:00
Pierre Schmitz
f1ee5208ed supress svn verbose output 2011-08-13 23:02:45 +02:00
Pierre Schmitz
b97b245d52 prepare release 2011-08-13 22:58:08 +02:00
Lukas Fleischer
ee970f0bde commitpkg: Provide a commit message template
Generate a message template when omitting the commit message (includes
the same subject line that is used if a commit message is specified).

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

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

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

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

Regression introduced in 8384ad849d.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

145
Makefile
View File

@@ -1,84 +1,79 @@
V=0.9.10 V=0.9.25
PREFIX = /usr/local
BINPROGS = \
checkpkg \
commitpkg \
archco \
archrelease \
archrm \
archbuild \
lddd \
finddeps \
rebuildpkgs
SBINPROGS = \
mkarchroot \
makechrootpkg
CONFIGFILES = \
makepkg-i686.conf \
makepkg-x86_64.conf \
pacman-extra.conf \
pacman-testing.conf \
pacman-staging.conf \
pacman-multilib.conf \
pacman-multilib-testing.conf
COMMITPKG_LINKS = \
extrapkg \
corepkg \
testingpkg \
stagingpkg \
communitypkg \
community-testingpkg \
community-stagingpkg \
multilibpkg \
multilib-testingpkg
ARCHBUILD_LINKS = \
extra-i686-build \
extra-x86_64-build \
testing-i686-build \
testing-x86_64-build \
staging-i686-build \
staging-x86_64-build \
multilib-build \
multilib-testing-build
all: all:
install: install:
# commitpkg/checkpkg and friends install -dm0755 $(DESTDIR)$(PREFIX)/bin
install -d -m755 $(DESTDIR)/usr/bin install -dm0755 $(DESTDIR)$(PREFIX)/sbin
install -m 755 checkpkg $(DESTDIR)/usr/bin install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools
install -m 755 commitpkg $(DESTDIR)/usr/bin install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin
ln -sf commitpkg $(DESTDIR)/usr/bin/extrapkg install -m0755 ${SBINPROGS} $(DESTDIR)$(PREFIX)/sbin
ln -sf commitpkg $(DESTDIR)/usr/bin/corepkg install -m0644 ${CONFIGFILES} $(DESTDIR)$(PREFIX)/share/devtools
ln -sf commitpkg $(DESTDIR)/usr/bin/testingpkg for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done
ln -sf commitpkg $(DESTDIR)/usr/bin/stagingpkg for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done
ln -sf commitpkg $(DESTDIR)/usr/bin/communitypkg install -Dm0644 bash_completion $(DESTDIR)/etc/bash_completion.d/devtools
ln -sf commitpkg $(DESTDIR)/usr/bin/community-testingpkg ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
ln -sf commitpkg $(DESTDIR)/usr/bin/community-stagingpkg
ln -sf commitpkg $(DESTDIR)/usr/bin/multilibpkg
# 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
install -d -m 755 $(DESTDIR)/usr/sbin
install -m 755 mkarchroot $(DESTDIR)/usr/sbin
install -m 755 makechrootpkg $(DESTDIR)/usr/sbin
install -m 755 archbuild $(DESTDIR)/usr/bin
ln -sf archbuild $(DESTDIR)/usr/bin/extra-i686-build
ln -sf archbuild $(DESTDIR)/usr/bin/extra-x86_64-build
ln -sf archbuild $(DESTDIR)/usr/bin/testing-i686-build
ln -sf archbuild $(DESTDIR)/usr/bin/testing-x86_64-build
ln -sf archbuild $(DESTDIR)/usr/bin/staging-i686-build
ln -sf archbuild $(DESTDIR)/usr/bin/staging-x86_64-build
ln -sf archbuild $(DESTDIR)/usr/bin/multilib-build
# 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
# install default config
install -d -m755 $(DESTDIR)/usr/share/devtools
install -m 644 makepkg-i686.conf $(DESTDIR)/usr/share/devtools
install -m 644 makepkg-x86_64.conf $(DESTDIR)/usr/share/devtools
install -m 644 pacman-extra.conf $(DESTDIR)/usr/share/devtools
install -m 644 pacman-testing.conf $(DESTDIR)/usr/share/devtools
install -m 644 pacman-staging.conf $(DESTDIR)/usr/share/devtools
install -m 644 pacman-multilib.conf $(DESTDIR)/usr/share/devtools
uninstall: uninstall:
# remove all files we installed for f in ${BINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
rm $(DESTDIR)/usr/bin/checkpkg for f in ${SBINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/sbin/$$f; done
rm $(DESTDIR)/usr/bin/commitpkg for f in ${CONFIGFILES}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/$$f; done
rm $(DESTDIR)/usr/bin/extrapkg for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
rm $(DESTDIR)/usr/bin/corepkg for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
rm $(DESTDIR)/usr/bin/testingpkg rm $(DESTDIR)/etc/bash_completion.d/devtools
rm $(DESTDIR)/usr/bin/stagingpkg rm -f $(DESTDIR)$(PREFIX)/bin/communityco
rm $(DESTDIR)/usr/bin/communitypkg
rm $(DESTDIR)/usr/bin/community-testingpkg
rm $(DESTDIR)/usr/bin/community-stagingpkg
rm $(DESTDIR)/usr/bin/multilibpkg
rm $(DESTDIR)/usr/sbin/mkarchroot
rm $(DESTDIR)/usr/sbin/makechrootpkg
rm $(DESTDIR)/usr/bin/extra-i686-build
rm $(DESTDIR)/usr/bin/extra-x86_64-build
rm $(DESTDIR)/usr/bin/testing-i686-build
rm $(DESTDIR)/usr/bin/testing-x86_64-build
rm $(DESTDIR)/usr/bin/staging-i686-build
rm $(DESTDIR)/usr/bin/staging-x86_64-build
rm $(DESTDIR)/usr/bin/multilib-build
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
rm $(DESTDIR)/usr/share/devtools/makepkg-i686.conf
rm $(DESTDIR)/usr/share/devtools/makepkg-x86_64.conf
rm $(DESTDIR)/usr/share/devtools/pacman-extra.conf
rm $(DESTDIR)/usr/share/devtools/pacman-testing.conf
rm $(DESTDIR)/usr/share/devtools/pacman-staging.conf
rm $(DESTDIR)/usr/share/devtools/pacman-multilib.conf
dist: dist:
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip -9 > devtools-$(V).tar.gz git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip -9 > devtools-$(V).tar.gz
upload:
scp devtools-$(V).tar.gz gerolde.archlinux.org:/srv/ftp/other/devtools/
.PHONY: all install uninstall dist upload

View File

@@ -1,12 +1,15 @@
#!/bin/bash #!/bin/bash
base_packages='base base-devel sudo'
cmd="$(basename "${0%-build}")" cmd="$(basename "${0%-build}")"
if [ "${cmd}" == 'multilib' ]; then if [ "${cmd%-*}" == 'multilib' ]; then
repo='multilib' repo="${cmd}"
arch='x86_64' arch='x86_64'
base_packages+=' multilib-devel'
else else
repo=${cmd%-*} repo=${cmd%-*}
arch=${cmd#*-} arch=${cmd##*-}
fi fi
chroots='/var/tmp/archbuild' chroots='/var/tmp/archbuild'
clean_first=false clean_first=false
@@ -26,26 +29,39 @@ while getopts 'cr:' arg; do
esac esac
done done
if [ "$(uname -m)" == 'i686' -a "${arch}" != 'i686' ]; then if [ "$EUID" != '0' ]; then
echo 'You can only build i686 packages on this system' echo 'This script must be run as root.'
exit 1
fi
if [ "$(uname -m)" != 'x86_64' -a "${repo}" == 'multilib' ]; then
echo 'You can only build multilib packages on a x86_64 system'
exit 1 exit 1
fi fi
if ${clean_first} || [ ! -d "${chroots}/${repo}-${arch}" ]; then if ${clean_first} || [ ! -d "${chroots}/${repo}-${arch}" ]; then
echo "Creating chroot for [${repo}] (${arch})..." echo "Creating chroot for [${repo}] (${arch})..."
sudo rm -rf ${chroots}/${repo}-${arch}
sudo mkdir -p ${chroots}/${repo}-${arch} for copy in ${chroots}/${repo}-${arch}/*; do
setarch ${arch} sudo mkarchroot \ [[ -d $copy ]] || continue
echo "Deleting chroot copy '$(basename "${copy}")'..."
# Lock the copy
exec 9>${copy}.lock
flock 9
{ type -P btrfs && btrfs subvolume delete ${copy}; } &>/dev/null
rm -rf ${copy}
done
exec 9>&-
rm -rf ${chroots}/${repo}-${arch}
mkdir -p ${chroots}/${repo}-${arch}
setarch ${arch} mkarchroot \
-C /usr/share/devtools/pacman-${repo}.conf \ -C /usr/share/devtools/pacman-${repo}.conf \
-M /usr/share/devtools/makepkg-${arch}.conf \ -M /usr/share/devtools/makepkg-${arch}.conf \
${chroots}/${repo}-${arch}/root \ ${chroots}/${repo}-${arch}/root \
base base-devel sudo ${base_packages}
else
setarch ${arch} mkarchroot \
-u \
${chroots}/${repo}-${arch}/root
fi fi
echo "Building in chroot for [${repo}] (${arch})..." echo "Building in chroot for [${repo}] (${arch})..."
setarch ${arch} sudo makechrootpkg -c -u -r ${chroots}/${repo}-${arch} setarch ${arch} makechrootpkg -c -r ${chroots}/${repo}-${arch}

17
archco
View File

@@ -1,10 +1,23 @@
#!/bin/bash #!/bin/bash
scriptname=${0##*/}
if [ "$1" = '' ]; then if [ "$1" = '' ]; then
echo 'Usage: archco <package name> [<package name>]' echo 'Usage: '$scriptname' <package name> [<package name>]'
exit 1 exit 1
fi fi
case $scriptname in
archco)
SVNURL="svn+ssh://gerolde.archlinux.org/srv/svn-packages";;
communityco)
SVNURL="svn+ssh://aur.archlinux.org/srv/svn-packages";;
*)
echo "error: couldn't find svn url for $scriptname"
exit 1
;;
esac
for i in "$@"; do for i in "$@"; do
svn co svn+ssh://gerolde.archlinux.org/srv/svn-packages/$i svn co "$SVNURL/$i"
done done

View File

@@ -9,25 +9,48 @@ if [ "$1" = '' ]; then
abort 'Usage: archrelease <repo>' abort 'Usage: archrelease <repo>'
fi fi
# TODO: validate repo is really repo-arch
if [ ! -f PKGBUILD ]; then if [ ! -f PKGBUILD ]; then
abort 'archrelease: PKGBUILD not found' abort 'archrelease: PKGBUILD not found'
fi fi
if [ "$(basename $(readlink -f .))" != 'trunk' ]; then trunk=$(basename $(pwd))
abort 'archrelease: Not in a package trunk dir'
# Normally this should be trunk, but it may be something
# such as 'gnome-unstable'
if [ "$(basename $(dirname $(pwd)))" == "repos" ]; then
abort 'archrelease: Should not be in repos dir (try from trunk/)'
fi fi
if [ ! -z "$(svn status -q)" ]; then if [ ! -z "$(svn status -q)" ]; then
abort 'archrelease: You have not committed your changes yet!' abort 'archrelease: You have not committed your changes yet!'
fi fi
echo -n 'releasing package...' echo -n "releasing package to ${1}..."
pushd .. >/dev/null pushd .. >/dev/null
if [ -d "repos/${1}" ]; then if [ -d "repos/${1}" ]; then
svn rm --force -q "repos/${1}" for file in $(svn ls "repos/${1}"); do
svn commit -q -m "archrelease: remove ${1}" || abort svn rm -q "repos/${1}/$file"
done
fi fi
svn copy -q -r HEAD trunk "repos/${1}" if [ ! -d repos ]; then
mkdir repos
svn add -q repos
fi
if [ ! -d "repos/${1}" ]; then
mkdir "repos/${1}"
svn add -q "repos/${1}"
fi
known_files=$(svn ls "trunk")
for file in $known_files; do
if [ "$file" != "${file%/}" ]; then
abort "archrelease: subdirectories are not supported in package directories!"
fi
done
for file in $known_files; do
svn copy -q -r HEAD "trunk/$file" "repos/${1}/"
done
svn commit -q -m "archrelease: copy trunk to ${1}" || abort svn commit -q -m "archrelease: copy trunk to ${1}" || abort
popd >/dev/null popd >/dev/null
echo 'done' echo 'done'

69
bash_completion Normal file
View File

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

View File

@@ -32,32 +32,31 @@ TEMPDIR=$(mktemp -d /tmp/checkpkg-script.XXXX)
cd $TEMPDIR cd $TEMPDIR
for _pkgname in ${pkgname[@]}; do for _pkgname in ${pkgname[@]}; do
pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT} if [ -z ${epoch} ] ; then
oldstylepkgfile=${_pkgname}-${pkgver}-${pkgrel}${PKGEXT} pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
else
pkgfile=${_pkgname}-${epoch}:${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
fi
if [ -f "$STARTDIR/$pkgfile" ]; then if [ -f "$STARTDIR/$pkgfile" ]; then
cp "$STARTDIR/$pkgfile" . ln -s "$STARTDIR/$pkgfile" "$pkgfile"
elif [ -f "$PKGDEST/$pkgfile" ]; then elif [ -f "$PKGDEST/$pkgfile" ]; then
cp "$PKGDEST/$pkgfile" . ln -s "$PKGDEST/$pkgfile" "$pkgfile"
elif [ -f "$STARTDIR/$oldstylepkgfile" ]; then
cp "$STARTDIR/$oldstylepkgfile" .
elif [ -f "$PKGDEST/$oldstylepkgfile" ]; then
cp "$PKGDEST/$oldstylepkgfile" .
else else
echo "File \"$pkgfile\" doesn't exist" echo "File \"$pkgfile\" doesn't exist"
exit 1 exit 1
fi fi
tmp=`pacman -Spd --noconfirm $_pkgname` tmp=$(pacman -Spdd --noconfirm $_pkgname)
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Couldn't download previous package for $_pkgname." echo "Couldn't download previous package for $_pkgname."
exit 1 exit 1
fi fi
pkgurl=`echo $tmp | rev | cut -d ' ' -f 1 | rev` pkgurl=$(echo $tmp | rev | cut -d ' ' -f 1 | rev)
oldpkg=`strip_url $pkgurl` oldpkg=$(strip_url $pkgurl)
if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then if [ "$(basename $oldpkg)" = "$(basename $pkgfile)" ]; then
echo "The built package ($_pkgname) is the one in the repo right now!" echo "The built package ($_pkgname) is the one in the repo right now!"
@@ -66,9 +65,11 @@ for _pkgname in ${pkgname[@]}; do
if [ ! -f $oldpkg ]; then if [ ! -f $oldpkg ]; then
if echo $pkgurl | grep '^file:///' > /dev/null 2>&1; then if echo $pkgurl | grep '^file:///' > /dev/null 2>&1; then
cp `echo $pkgurl | sed 's#^file://##'` . ln -s "${pkgurl#file://}" $(basename "${pkgurl#file://}")
elif [ -f $PKGDEST/$oldpkg ]; then elif [ -f "$PKGDEST/$oldpkg" ]; then
cp $PKGDEST/$oldpkg . ln -s "$PKGDEST/$oldpkg" "$oldpkg"
elif [ -f "$STARTDIR/$oldpkg" ]; then
ln -s "$STARTDIR/$oldpkg" "$oldpkg"
else else
wget --quiet $pkgurl wget --quiet $pkgurl
fi fi
@@ -80,16 +81,16 @@ for _pkgname in ${pkgname[@]}; do
sort -o filelist-$_pkgname filelist-$_pkgname sort -o filelist-$_pkgname filelist-$_pkgname
sort -o filelist-$_pkgname-old filelist-$_pkgname-old sort -o filelist-$_pkgname-old filelist-$_pkgname-old
diff filelist-$_pkgname-old filelist-$_pkgname sdiff -s filelist-$_pkgname-old filelist-$_pkgname
if diff filelist-$_pkgname-old filelist-$_pkgname | grep '\.so\.' > /dev/null 2>&1; then if diff filelist-$_pkgname-old filelist-$_pkgname | grep '\.so' > /dev/null 2>&1; then
mkdir -p pkg mkdir -p pkg
cd pkg cd pkg
bsdtar xf ../"$pkgfile" > /dev/null bsdtar xf ../"$pkgfile" > /dev/null
for i in `diff ../filelist-$_pkgname-old ../filelist-$_pkgname | grep \> | grep \.so\. | awk '{print $2}'`; do for i in $(diff ../filelist-$_pkgname-old ../filelist-$_pkgname | grep \> | grep '\.so' | awk '{print $2}'); do
echo -n "${i}: " echo "${i}: " "$(objdump -p $i | grep SONAME)"
objdump -p $i | grep SONAME
done done
cd ..
else else
echo "No soname differences for $_pkgname." echo "No soname differences for $_pkgname."
fi fi

166
commitpkg
View File

@@ -17,6 +17,19 @@ getpkgfile() {
echo ${1} echo ${1}
} }
##
# usage : get_full_version( $epoch, $pkgver, $pkgrel )
# return : full version spec, including epoch (if necessary), pkgver, pkgrel
##
get_full_version() {
if [[ $1 -eq 0 ]]; then
# zero epoch case, don't include it in version
echo $2-$3
else
echo $1:$2-$3
fi
}
# Source makepkg.conf; fail if it is not found # Source makepkg.conf; fail if it is not found
if [ -r '/etc/makepkg.conf' ]; then if [ -r '/etc/makepkg.conf' ]; then
source '/etc/makepkg.conf' source '/etc/makepkg.conf'
@@ -38,89 +51,133 @@ fi
. PKGBUILD . PKGBUILD
pkgbase=${pkgbase:-$pkgname} pkgbase=${pkgbase:-$pkgname}
# set up repo-specific opts depending on how we were called case "$cmd" in
server='gerolde.archlinux.org' commitpkg)
if [ "$cmd" == 'extrapkg' ]; then if [ $# -eq 0 ]; then
repo='extra' abort 'usage: commitpkg <reponame> [-l limit] [-a arch] [commit message]'
elif [ "$cmd" == 'corepkg' ]; then fi
repo='core' repo="$1"
elif [ "$cmd" == 'testingpkg' ]; then shift
repo='testing' ;;
elif [ "$cmd" == 'stagingpkg' ]; then *pkg)
repo='staging' repo="${cmd%pkg}"
elif [ "$cmd" == 'communitypkg' ]; then ;;
repo='community' *)
server='aur.archlinux.org' abort 'usage: commitpkg <reponame> [-l limit] [-a arch] [commit message]'
elif [ "$cmd" == 'community-testingpkg' ]; then ;;
repo='community-testing' esac
server='aur.archlinux.org'
elif [ "$cmd" == 'community-stagingpkg' ]; then case "$repo" in
repo='community-staging' core|extra|testing|staging)
server='aur.archlinux.org' server='gerolde.archlinux.org' ;;
elif [ "$cmd" == 'multilibpkg' ]; then community*|multilib*)
repo='multilib' server='aur.archlinux.org' ;;
server='aur.archlinux.org' *)
else server='gerolde.archlinux.org'
if [ $# -eq 0 ]; then echo "Non-standard repository $repo in use, defaulting to server $server" ;;
abort 'usage: commitpkg <reponame> [-l limit] [commit message]' esac
fi
repo="$1"
shift
fi
# check if all local source files are under version control # check if all local source files are under version control
(for s in ${source[@]}; do for s in "${source[@]}"; do
echo $s | grep -vq '://' && \ if [[ $s != *://* ]] && ! svn status -v "$s" | grep -q '^[ AMRX~]'; then
svn status $s | grep -q '?' && \ abort "$s is not under version control"
abort "$s is not under version control" fi
done) || true done
# check if changelog and install files are under version control # check if changelog and install files are under version control
(for i in 'changelog' 'install'; do for i in 'changelog' 'install'; do
filelist=$(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD) filelist=$(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)
for file in $filelist; do for file in $filelist; do
# evaluate any bash variables used # evaluate any bash variables used
eval file=${file} eval file=${file}
if svn status ${file} | grep -q '?'; then if ! svn status -v "${file}" | grep -q '^[ AMRX~]'; then
abort "${file} is not under version control" abort "${file} is not under version control"
fi fi
done done
done) || true done
# see if any limit options were passed, we'll send them to rsync # see if any limit options were passed, we'll send them to rsync
unset rsyncopts rsyncopts='-e ssh -p --chmod=ug=rw,o=r -c -h -L --progress --partial -y'
if [ "$1" = '-l' ]; then if [ "$1" = '-l' ]; then
rsyncopts="--bwlimit=$2" rsyncopts="$rsyncopts --bwlimit=$2"
shift 2
fi
if [ "$1" = "-a" ]; then
commit_arch=$2
shift 2 shift 2
fi fi
echo -n 'committing changes to trunk...' echo -n 'committing changes to trunk...'
msgtemplate="upgpkg: $pkgbase $(get_full_version ${epoch:-0} $pkgver $pkgrel)
"
if [ -n "$1" ]; then if [ -n "$1" ]; then
svn commit -q -m "upgpkg: $pkgbase $pkgver-$pkgrel svn commit -q -m "${msgtemplate}${1}" || abort
$1" || abort
else else
svn commit -q || abort msgfile="$(mktemp)"
echo "$msgtemplate" > "$msgfile"
if [ -n "$SVN_EDITOR" ]; then
$SVN_EDITOR "$msgfile"
elif [ -n "$VISUAL" ]; then
$VISUAL "$msgfile"
elif [ -n "$EDITOR" ]; then
$EDITOR "$msgfile"
else
vi "$msgfile"
fi
[ -s "$msgfile" ] || abort
svn commit -q -F "$msgfile" || abort
unlink "$msgfile"
fi fi
echo 'done' echo 'done'
for _arch in ${arch[@]}; do declare -a uploads
for _pkgname in ${pkgname[@]}; do
pkgfile=$(getpkgfile "$_pkgname-$pkgver-$pkgrel-${_arch}".pkg.tar.* 2>/dev/null)
pkgdestfile=$(getpkgfile "$PKGDEST/$_pkgname-$pkgver-$pkgrel-${_arch}".pkg.tar.* 2>/dev/null)
if [ ! -f "$pkgfile" -a -f "$pkgdestfile" ]; then for _arch in ${arch[@]}; do
if [ -n "$commit_arch" ] && [ "${_arch}" != "$commit_arch" ]; then
echo "skipping ${_arch}"
continue
fi
for _pkgname in ${pkgname[@]}; do
fullver=$(get_full_version ${epoch:-0} $pkgver $pkgrel)
pkgfile=$(getpkgfile "$_pkgname-$fullver-${_arch}".pkg.tar.?z 2>/dev/null)
pkgdestfile=$(getpkgfile "$PKGDEST/$_pkgname-$fullver-${_arch}".pkg.tar.?z 2>/dev/null)
if [ -f "$pkgfile" ]; then
pkgfile="./$pkgfile"
elif [ -f "$pkgdestfile" ]; then
pkgfile="$pkgdestfile" pkgfile="$pkgdestfile"
elif [ ! -f "$pkgfile" ]; then else
echo "skipping ${_arch}" echo "skipping ${_arch}"
continue 2 continue 2
fi fi
uploads+=("$pkgfile")
echo -n 'uploading ' if [[ $SIGNPKG == 'y' ]]; then
rsync -p --chmod 'ug=rw,o=r' -c -h -L --progress $rsyncopts --partial "${pkgfile}" -e ssh $server:staging/$repo || abort echo "Signing package ${pkgfile}..."
if [[ -n $GPGKEY ]]; then
SIGNWITHKEY="-u ${GPGKEY}"
fi
gpg --detach-sign --use-agent ${SIGNWITHKEY} "${pkgfile}" || abort
fi
sigfile="${pkgfile}.sig"
if [ -f "${sigfile}" ]; then
uploads+=("$sigfile")
elif [[ $SIGNPKG == 'y' ]]; then
abort "Signature ${pkgfile}.sig was not found"
fi
done done
archrelease $repo-${_arch} || abort archrelease $repo-${_arch} || abort
done done
if [[ ${#uploads[*]} -gt 0 ]]; then
echo 'uploading all package and signature files'
rsync $rsyncopts "${uploads[@]}" "$server:staging/$repo/" || abort
fi
if [ "${arch[*]}" == 'any' ]; then if [ "${arch[*]}" == 'any' ]; then
if [ -d ../repos/$repo-i686 -a -d ../repos/$repo-x86_64 ]; then if [ -d ../repos/$repo-i686 -a -d ../repos/$repo-x86_64 ]; then
pushd ../repos/ >/dev/null pushd ../repos/ >/dev/null
@@ -131,4 +188,13 @@ if [ "${arch[*]}" == 'any' ]; then
echo 'done' echo 'done'
popd >/dev/null popd >/dev/null
fi fi
else
if [ -d ../repos/$repo-any ]; then
pushd ../repos/ >/dev/null
echo "removing $repo-any..."
svn rm $repo-any
svn commit -q -m "removed $repo-any for $pkgname"
echo 'done'
popd >/dev/null
fi
fi fi

View File

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

View File

@@ -21,19 +21,26 @@ for d in $(find . -type d); do
unset pkgname depends makedepends unset pkgname depends makedepends
. PKGBUILD . PKGBUILD
for dep in "${depends[@]}"; do for dep in "${depends[@]}"; do
# lose the version comaparator, if any # lose the version comparator, if any
depname=${dep%%[<>=]*} depname=${dep%%[<>=]*}
if [ "$depname" = "$match" ]; then if [ "$depname" = "$match" ]; then
echo "$d (depends)" echo "$d (depends)"
fi fi
done done
for dep in "${makedepends[@]}"; do for dep in "${makedepends[@]}"; do
# lose the version comaparator, if any # lose the version comparator, if any
depname=${dep%%[<>=]*} depname=${dep%%[<>=]*}
if [ "$depname" = "$match" ]; then if [ "$depname" = "$match" ]; then
echo "$d (makedepends)" echo "$d (makedepends)"
fi fi
done done
for dep in "${optdepends[@]/:*}"; do
# lose the version comaparator, if any
depname=${dep%%[<>=]*}
if [ "$depname" = "$match" ]; then
echo "$d (optdepends)"
fi
done
fi fi
cd $tld cd $tld
done done

8
lddd
View File

@@ -4,9 +4,9 @@
# #
ifs=$IFS ifs=$IFS
IFS=':' IFS="${IFS}:"
libdirs='/lib:/usr/lib:/opt/qt/lib:/opt/kde/lib:/usr/lib/libfakeroot:/opt/NX/lib' libdirs="/lib /usr/lib /usr/local/lib $(cat /etc/ld.so.conf.d/*)"
extras= extras=
TEMPDIR=$(mktemp -d /tmp/lddd-script.XXXX) TEMPDIR=$(mktemp -d /tmp/lddd-script.XXXX)
@@ -25,9 +25,9 @@ for tree in $PATH $libdirs $extras; do
-name '*.mcopclass' ! -name '*.mcoptype') -name '*.mcopclass' ! -name '*.mcoptype')
IFS=$ifs IFS=$ifs
for i in $files; do for i in $files; do
if [ `file $i | grep -c 'ELF'` -ne 0 ]; then if [ $(file $i | grep -c 'ELF') -ne 0 ]; then
# Is an ELF binary. # Is an ELF binary.
if [ `ldd $i 2>/dev/null | grep -c 'not found'` -ne 0 ]; then if [ $(ldd $i 2>/dev/null | grep -c 'not found') -ne 0 ]; then
# Missing lib. # Missing lib.
echo "$i:" >> $TEMPDIR/raw.txt echo "$i:" >> $TEMPDIR/raw.txt
ldd $i 2>/dev/null | grep 'not found' >> $TEMPDIR/raw.txt ldd $i 2>/dev/null | grep 'not found' >> $TEMPDIR/raw.txt

View File

@@ -12,7 +12,6 @@ FORCE='n'
RUN='' RUN=''
MAKEPKG_ARGS='-s --noconfirm' MAKEPKG_ARGS='-s --noconfirm'
REPACK='' REPACK=''
COPY='copy'
WORKDIR=$PWD WORKDIR=$PWD
update_first='0' update_first='0'
@@ -24,6 +23,10 @@ chrootdir=''
APPNAME=$(basename "${0}") APPNAME=$(basename "${0}")
default_copy=$USER
[[ -n $SUDO_USER ]] && default_copy=$SUDO_USER
[[ -z $default_copy || $default_copy = root ]] && default_copy=copy
usage() { usage() {
echo "usage ${APPNAME} [options] -r <chrootdir> [--] [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 ' Run this script in a PKGBUILD dir to build a package inside a'
@@ -50,7 +53,8 @@ usage() {
echo '-r <dir> The chroot dir to use' echo '-r <dir> The chroot dir to use'
echo '-I <pkg> Install a package into the working copy of the chroot' echo '-I <pkg> Install a package into the working copy of the chroot'
echo '-l <copy> The directory to use as the working copy of the chroot' echo '-l <copy> The directory to use as the working copy of the chroot'
echo ' Useful for maintain multiple copies Default: copy' echo ' Useful for maintaining multiple copies.'
echo " Default: $default_copy"
exit 1 exit 1
} }
@@ -62,14 +66,20 @@ while getopts 'hcudr:I:l:' arg; do
d) add_to_db=1 ;; d) add_to_db=1 ;;
r) chrootdir="$OPTARG" ;; r) chrootdir="$OPTARG" ;;
I) install_pkg="$OPTARG" ;; I) install_pkg="$OPTARG" ;;
l) COPY="$OPTARG" ;; l) copy="$OPTARG" ;;
*) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; *) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;;
esac esac
done done
#Get rid of trailing / in chrootdir # Canonicalize chrootdir, getting rid of trailing /
[ "$chrootdir" != "/" ] && chrootdir=$(echo $chrootdir | sed 's#/$##') chrootdir=$(readlink -e "$chrootdir")
copydir="$chrootdir/$COPY"
if [[ ${copy:0:1} = "/" ]]; then
copydir=$copy
else
[[ -z $copy ]] && copy=$default_copy
copydir="$chrootdir/$copy"
fi
# Pass all arguments after -- right to makepkg # Pass all arguments after -- right to makepkg
MAKEPKG_ARGS="$MAKEPKG_ARGS ${*:$OPTIND}" MAKEPKG_ARGS="$MAKEPKG_ARGS ${*:$OPTIND}"
@@ -87,7 +97,7 @@ if [ "$EUID" != '0' ]; then
exit 1 exit 1
fi fi
if [ ! -f PKGBUILD ]; then if [ ! -f PKGBUILD -a -z "$install_pkg" ]; then
echo 'This must be run in a directory containing a PKGBUILD.' echo 'This must be run in a directory containing a PKGBUILD.'
exit 1 exit 1
fi fi
@@ -104,20 +114,53 @@ if [ ! -d "$chrootdir/root" ]; then
fi fi
umask 0022 umask 0022
# Lock the chroot we want to use. We'll keep this lock until we exit.
# Note this is the same FD number as in mkarchroot
exec 9>"$copydir.lock"
if ! flock -n 9; then
echo -n "locking chroot copy '$copy'..."
flock 9
echo "done"
fi
if [ ! -d "$copydir" -o "$clean_first" -eq "1" ]; then if [ ! -d "$copydir" -o "$clean_first" -eq "1" ]; then
# Get a read lock on the root chroot to make
# sure we don't clone a half-updated chroot
exec 8>"$chrootdir/root.lock"
if ! flock -sn 8; then
echo -n "locking clean chroot..."
flock -s 8
echo "done"
fi
echo -n 'creating clean working copy...' echo -n 'creating clean working copy...'
mkdir -p "$copydir" use_rsync=false
rsync -a --delete -q -W -x "$chrootdir/root/" "$copydir" if type -P btrfs >/dev/null; then
[ -d $copydir ] && btrfs subvolume delete "$copydir" &>/dev/null
btrfs subvolume snapshot "$chrootdir/root" "$copydir" &>/dev/null || use_rsync=true
else
use_rsync=true
fi
if $use_rsync; then
mkdir -p "$copydir"
rsync -a --delete -q -W -x "$chrootdir/root/" "$copydir"
fi
echo 'done' echo 'done'
# Drop the read lock again
exec 8>&-
fi fi
if [ -n "$install_pkg" ]; then if [ -n "$install_pkg" ]; then
pkgname="$(basename "$install_pkg")" pkgname="$(basename "$install_pkg")"
cp "$install_pkg" "$copydir/$pkgname" cp "$install_pkg" "$copydir/$pkgname"
mkarchroot -r "pacman -U /$pkgname" "$copydir" mkarchroot -r "pacman -U /$pkgname --noconfirm" "$copydir"
ret=$? ret=$?
rm "$copydir/$pkgname" rm "$copydir/$pkgname"
#exit early, we've done all we need to # Exit early, we've done all we need to
exit $ret exit $ret
fi fi
@@ -128,11 +171,11 @@ fi
[ -d "$copydir/build" ] || mkdir "$copydir/build" [ -d "$copydir/build" ] || mkdir "$copydir/build"
if [ "$REPACK" != "1" ]; then if [ "$REPACK" != "1" ]; then
#Remove anything in there UNLESS -R (repack) was passed to makepkg # Remove anything in there UNLESS -R (repack) was passed to makepkg
rm -rf "$copydir/build/"* rm -rf "$copydir/build/"*
fi fi
# read .makpekg.conf even if called via sudo # Read .makepkg.conf even if called via sudo
if [ -n "${SUDO_USER}" ]; then if [ -n "${SUDO_USER}" ]; then
makepkg_conf="/$(eval echo ~${SUDO_USER})/.makepkg.conf" makepkg_conf="/$(eval echo ~${SUDO_USER})/.makepkg.conf"
else else
@@ -160,9 +203,15 @@ if ! grep 'SRCDEST="/srcdest"' "$copydir/etc/makepkg.conf" >/dev/null 2>&1; then
echo 'SRCDEST="/srcdest"' >> "$copydir/etc/makepkg.conf" echo 'SRCDEST="/srcdest"' >> "$copydir/etc/makepkg.conf"
fi fi
[ -z "${MAKEFLAGS}" ] && eval $(grep '^MAKEFLAGS=' /etc/makepkg.conf) [ -z "${MAKEFLAGS}" ] && eval $(grep '^MAKEFLAGS=' /etc/makepkg.conf)
[ -n "${MAKEFLAGS}" ] && echo "MAKEFLAGS='${MAKEFLAGS}'" >> "$copydir/etc/makepkg.conf" if [ -n "${MAKEFLAGS}" ]; then
sed -i '/^MAKEFLAGS=/d' "$copydir/etc/makepkg.conf"
echo "MAKEFLAGS='${MAKEFLAGS}'" >> "$copydir/etc/makepkg.conf"
fi
[ -z "${PACKAGER}" ] && eval $(grep '^PACKAGER=' /etc/makepkg.conf) [ -z "${PACKAGER}" ] && eval $(grep '^PACKAGER=' /etc/makepkg.conf)
[ -n "${PACKAGER}" ] && echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf" if [ -n "${PACKAGER}" ]; then
sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf"
echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf"
fi
# Set target CARCH as it might be used within the PKGBUILD to select correct sources # Set target CARCH as it might be used within the PKGBUILD to select correct sources
eval $(grep '^CARCH=' "$copydir/etc/makepkg.conf") eval $(grep '^CARCH=' "$copydir/etc/makepkg.conf")
@@ -196,11 +245,8 @@ chown -R nobody "$copydir/build"
chown -R nobody "$copydir/srcdest" chown -R nobody "$copydir/srcdest"
chown -R nobody "$copydir/pkgdest" chown -R nobody "$copydir/pkgdest"
if ! grep "^nobody" "$copydir/etc/sudoers" >/dev/null 2>&1; then echo 'nobody ALL = NOPASSWD: /usr/bin/pacman' > "$copydir/etc/sudoers.d/nobody-pacman"
touch "$copydir/etc/sudoers" chmod 440 "$copydir/etc/sudoers.d/nobody-pacman"
echo 'nobody ALL=(ALL) NOPASSWD: ALL' >> "$copydir/etc/sudoers"
chmod 440 "$copydir/etc/sudoers"
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
#working copy #working copy
@@ -235,7 +281,7 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then
fi fi
done done
for l in "${copydir}"/build/{namcap,*-{build,package}}.log; do for l in "${copydir}"/build/{namcap,*-{build,check,package,package_*}}.log; do
[ -f "$l" ] && mv "$l" "${WORKDIR}" [ -f "$l" ] && mv "$l" "${WORKDIR}"
done done
else else
@@ -256,6 +302,4 @@ if [ -e "${copydir}/build/BUILD_FAILED" ]; then
echo "Build failed, check $copydir/build" echo "Build failed, check $copydir/build"
rm "${copydir}/build/BUILD_FAILED" rm "${copydir}/build/BUILD_FAILED"
exit 1 exit 1
else
rm -rf "${copydir}"/build/*
fi fi

View File

@@ -29,9 +29,9 @@ CHOST="i686-pc-linux-gnu"
#-- Exclusive: will only run on i686 #-- Exclusive: will only run on i686
# -march (or -mcpu) builds exclusively for an architecture # -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family # -mtune optimizes for an architecture, but builds for whole processor family
CFLAGS="-march=i686 -mtune=generic -O2 -pipe" CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe" CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"
#-- Make Flags: change this for DistCC/SMP systems #-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2" #MAKEFLAGS="-j2"
@@ -39,15 +39,16 @@ LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed"
# BUILD ENVIRONMENT # BUILD ENVIRONMENT
######################################################################### #########################################################################
# #
# Defaults: BUILDENV=(fakeroot !distcc color !ccache) # Defaults: BUILDENV=(fakeroot !distcc color !ccache check)
# A negated environment option will do the opposite of the comments below. # A negated environment option will do the opposite of the comments below.
# #
#-- fakeroot: Allow building packages as a non-root user #-- fakeroot: Allow building packages as a non-root user
#-- distcc: Use the Distributed C/C++/ObjC compiler #-- distcc: Use the Distributed C/C++/ObjC compiler
#-- color: Colorize output messages #-- color: Colorize output messages
#-- ccache: Use ccache to cache compilation #-- ccache: Use ccache to cache compilation
#-- check: Run the check() function if present in the PKGBUILD
# #
BUILDENV=(fakeroot !distcc color !ccache) BUILDENV=(fakeroot !distcc color !ccache check)
# #
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition, #-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster. #-- specify a space-delimited list of hosts running in the DistCC cluster.
@@ -61,7 +62,7 @@ BUILDENV=(fakeroot !distcc color !ccache)
# Default: OPTIONS=(strip docs libtool emptydirs zipman purge) # Default: OPTIONS=(strip docs libtool emptydirs zipman purge)
# A negated option will do the opposite of the comments below. # A negated option will do the opposite of the comments below.
# #
#-- strip: Strip symbols from binaries/libraries in STRIP_DIRS #-- strip: Strip symbols from binaries/libraries
#-- docs: Save doc directories specified by DOC_DIRS #-- docs: Save doc directories specified by DOC_DIRS
#-- libtool: Leave libtool (.la) files in packages #-- libtool: Leave libtool (.la) files in packages
#-- emptydirs: Leave empty directories in packages #-- emptydirs: Leave empty directories in packages
@@ -82,8 +83,6 @@ STRIP_STATIC="--strip-debug"
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info}) MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified) #-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc}) DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Directories to be searched for the strip option (if strip is specified)
STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
#-- Files to be removed from all packages (if purge is specified) #-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)

View File

@@ -29,9 +29,9 @@ CHOST="x86_64-unknown-linux-gnu"
#-- Exclusive: will only run on x86_64 #-- Exclusive: will only run on x86_64
# -march (or -mcpu) builds exclusively for an architecture # -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family # -mtune optimizes for an architecture, but builds for whole processor family
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe" CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe" CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"
#-- Make Flags: change this for DistCC/SMP systems #-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2" #MAKEFLAGS="-j2"
@@ -39,15 +39,16 @@ LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed"
# BUILD ENVIRONMENT # BUILD ENVIRONMENT
######################################################################### #########################################################################
# #
# Defaults: BUILDENV=(fakeroot !distcc color !ccache) # Defaults: BUILDENV=(fakeroot !distcc color !ccache check)
# A negated environment option will do the opposite of the comments below. # A negated environment option will do the opposite of the comments below.
# #
#-- fakeroot: Allow building packages as a non-root user #-- fakeroot: Allow building packages as a non-root user
#-- distcc: Use the Distributed C/C++/ObjC compiler #-- distcc: Use the Distributed C/C++/ObjC compiler
#-- color: Colorize output messages #-- color: Colorize output messages
#-- ccache: Use ccache to cache compilation #-- ccache: Use ccache to cache compilation
#-- check: Run the check() function if present in the PKGBUILD
# #
BUILDENV=(fakeroot !distcc color !ccache) BUILDENV=(fakeroot !distcc color !ccache check)
# #
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition, #-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster. #-- specify a space-delimited list of hosts running in the DistCC cluster.
@@ -61,7 +62,7 @@ BUILDENV=(fakeroot !distcc color !ccache)
# Default: OPTIONS=(strip docs libtool emptydirs zipman purge) # Default: OPTIONS=(strip docs libtool emptydirs zipman purge)
# A negated option will do the opposite of the comments below. # A negated option will do the opposite of the comments below.
# #
#-- strip: Strip symbols from binaries/libraries in STRIP_DIRS #-- strip: Strip symbols from binaries/libraries
#-- docs: Save doc directories specified by DOC_DIRS #-- docs: Save doc directories specified by DOC_DIRS
#-- libtool: Leave libtool (.la) files in packages #-- libtool: Leave libtool (.la) files in packages
#-- emptydirs: Leave empty directories in packages #-- emptydirs: Leave empty directories in packages
@@ -82,8 +83,6 @@ STRIP_STATIC="--strip-debug"
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info}) MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified) #-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc}) DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Directories to be searched for the strip option (if strip is specified)
STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
#-- Files to be removed from all packages (if purge is specified) #-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)

View File

@@ -26,7 +26,7 @@ usage() {
echo ' -C <file> Location of a pacman config file' echo ' -C <file> Location of a pacman config file'
echo ' -M <file> Location of a makepkg config file' echo ' -M <file> Location of a makepkg config file'
echo ' -n Do not copy config files into the chroot' echo ' -n Do not copy config files into the chroot'
echo " -c <dir> Set pacman cache. Default: /var/cache/pacman/pkg" echo ' -c <dir> Set pacman cache. Default: /var/cache/pacman/pkg'
echo ' -h This message' echo ' -h This message'
exit $1 exit $1
} }
@@ -34,7 +34,7 @@ usage() {
while getopts 'r:ufnhC:M:c:' arg; do while getopts 'r:ufnhC:M:c:' arg; do
case "${arg}" in case "${arg}" in
r) RUN="$OPTARG" ;; r) RUN="$OPTARG" ;;
u) RUN='pacman -Syu --noconfirm' ;; u) RUN='/bin/sh -c "pacman -Syu --noconfirm && (pacman -Qqu >/dev/null && pacman -Su --noconfirm || exit 0)"' ;;
f) FORCE='y' ;; f) FORCE='y' ;;
C) pac_conf="$OPTARG" ;; C) pac_conf="$OPTARG" ;;
M) makepkg_conf="$OPTARG" ;; M) makepkg_conf="$OPTARG" ;;
@@ -68,22 +68,21 @@ shift 1
if [ -z "$cache_dir" ]; then if [ -z "$cache_dir" ]; then
cache_conf=${working_dir}/etc/pacman.conf cache_conf=${working_dir}/etc/pacman.conf
[ ! -f $cache_conf ] && cache_conf=${pac_conf:-/etc/pacman.conf} [ ! -f $cache_conf ] && cache_conf=${pac_conf:-/etc/pacman.conf}
cache_dir=$((grep -m 1 '^CacheDir' $cache_conf || echo 'CacheDir = /var/cache/pacman/pkg') | sed 's/CacheDir\s*=\s*//') cache_dir=$( (grep -m 1 '^CacheDir' $cache_conf || echo 'CacheDir = /var/cache/pacman/pkg') | sed 's/CacheDir\s*=\s*//')
unset cache_conf unset cache_conf
fi fi
if [ -f /etc/pacman.d/mirrorlist ]; then if [ -f /etc/pacman.d/mirrorlist ]; then
host_mirror=$(grep -v '^#' -m1 /etc/pacman.d/mirrorlist | sed -E 's#/os/(i686|x86_64)#/os/\$arch#g') host_mirror=$(pacman -Sddp extra/devtools 2>/dev/null | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#')
fi fi
if [ -z "${host_mirror}" ]; then if [ -z "${host_mirror}" ]; then
host_mirror='Server = http://mirrors.kernel.org/archlinux/$repo/os/$arch' host_mirror='http://mirrors.kernel.org/archlinux/$repo/os/$arch'
fi fi
if echo "${host_mirror}" | grep -q 'file://'; then if echo "${host_mirror}" | grep -q 'file://'; then
host_mirror_path=$(echo "${host_mirror}" | sed -E 's#Server\s=\sfile://(/.*)/\$repo/os/(\$arch|i686|x86_64)#\1#g') host_mirror_path=$(echo "${host_mirror}" | sed -E 's#file://(/.*)/\$repo/os/\$arch#\1#g')
fi fi
# {{{ functions # {{{ functions
chroot_mount() { chroot_mount() {
[ -e "${working_dir}/sys" ] || mkdir "${working_dir}/sys" [ -e "${working_dir}/sys" ] || mkdir "${working_dir}/sys"
mount -t sysfs sysfs "${working_dir}/sys" mount -t sysfs sysfs "${working_dir}/sys"
@@ -92,13 +91,27 @@ chroot_mount() {
mount -t proc proc "${working_dir}/proc" mount -t proc proc "${working_dir}/proc"
[ -e "${working_dir}/dev" ] || mkdir "${working_dir}/dev" [ -e "${working_dir}/dev" ] || mkdir "${working_dir}/dev"
mount -o bind /dev "${working_dir}/dev" mount -t tmpfs dev "${working_dir}/dev" -o mode=0755,size=10M,nosuid
mknod -m 666 "${working_dir}/dev/null" c 1 3
mknod -m 666 "${working_dir}/dev/zero" c 1 5
mknod -m 600 "${working_dir}/dev/console" c 5 1
mknod -m 644 "${working_dir}/dev/random" c 1 8
mknod -m 644 "${working_dir}/dev/urandom" c 1 9
mknod -m 666 "${working_dir}/dev/tty" c 5 0
mknod -m 666 "${working_dir}/dev/tty0" c 4 0
mknod -m 666 "${working_dir}/dev/full" c 1 7
ln -s /proc/kcore "${working_dir}/dev/core"
ln -s /proc/self/fd "${working_dir}/dev/fd"
ln -s /proc/self/fd/0 "${working_dir}/dev/stdin"
ln -s /proc/self/fd/1 "${working_dir}/dev/stdout"
ln -s /proc/self/fd/2 "${working_dir}/dev/stderr"
[ -e "${working_dir}/dev/shm" ] || mkdir "${working_dir}/dev/shm" [ -e "${working_dir}/dev/shm" ] || mkdir "${working_dir}/dev/shm"
mount -t tmpfs shm "${working_dir}/dev/shm" mount -t tmpfs shm "${working_dir}/dev/shm" -o nodev,nosuid,size=128M
[ -e "${working_dir}/dev/pts" ] || mkdir "${working_dir}/dev/pts" [ -e "${working_dir}/dev/pts" ] || mkdir "${working_dir}/dev/pts"
mount -t devpts devpts "${working_dir}/dev/pts" mount -t devpts devpts "${working_dir}/dev/pts" -o newinstance,ptmxmode=666
ln -s pts/ptmx "${working_dir}/dev/ptmx"
[ -e "${cache_dir}" ] || mkdir -p "${cache_dir}" [ -e "${cache_dir}" ] || mkdir -p "${cache_dir}"
[ -e "${working_dir}/${cache_dir}" ] || mkdir -p "${working_dir}/${cache_dir}" [ -e "${working_dir}/${cache_dir}" ] || mkdir -p "${working_dir}/${cache_dir}"
@@ -110,13 +123,13 @@ chroot_mount() {
mount -o remount,ro,bind "${host_mirror_path}" "${working_dir}/${host_mirror_path}" mount -o remount,ro,bind "${host_mirror_path}" "${working_dir}/${host_mirror_path}"
fi fi
trap 'chroot_umount' 0 1 2 15 trap 'chroot_umount' EXIT INT QUIT TERM HUP
} }
copy_hostconf () { copy_hostconf () {
chroot "${working_dir}" /bin/findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS > "${working_dir}/etc/mtab" chroot "${working_dir}" /bin/findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS > "${working_dir}/etc/mtab"
cp /etc/resolv.conf "${working_dir}/etc/resolv.conf" cp /etc/resolv.conf "${working_dir}/etc/resolv.conf"
echo "${host_mirror}" > ${working_dir}/etc/pacman.d/mirrorlist echo "Server = ${host_mirror}" > ${working_dir}/etc/pacman.d/mirrorlist
} }
chroot_umount () { chroot_umount () {
@@ -128,6 +141,20 @@ chroot_umount () {
umount "${working_dir}/${cache_dir}" umount "${working_dir}/${cache_dir}"
[ -n "${host_mirror_path}" ] && umount "${working_dir}/${host_mirror_path}" [ -n "${host_mirror_path}" ] && umount "${working_dir}/${host_mirror_path}"
} }
chroot_lock () {
# Only reopen the FD if it wasn't handed to us
if [ "$(readlink -f /dev/fd/9)" != "${working_dir}.lock" ]; then
exec 9>"${working_dir}.lock"
fi
# Lock the chroot. Take note of the FD number.
if ! flock -n 9; then
echo -n "locking chroot..."
flock 9
echo "done"
fi
}
# }}} # }}}
umask 0022 umask 0022
@@ -140,22 +167,28 @@ if [ "$RUN" != "" ]; then
exit 1 exit 1
fi fi
chroot_lock
chroot_mount chroot_mount
copy_hostconf copy_hostconf
chroot "${working_dir}" ${RUN} eval 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/" if { type -P btrfs && btrfs subvolume create "${working_dir}"; } &>/dev/null; then
chmod 0755 "${working_dir}"
fi
mkdir -p "${working_dir}/var/lib/pacman/sync"
mkdir -p "${working_dir}/etc/" mkdir -p "${working_dir}/etc/"
chroot_lock
chroot_mount chroot_mount
pacargs="--noconfirm --root=${working_dir} --cachedir=${cache_dir}" pacargs="--noconfirm --root=${working_dir} --cachedir=${cache_dir}"
@@ -187,7 +220,7 @@ if [ "$RUN" != "" ]; then
fi fi
if [ -e "${working_dir}/etc/locale.gen" ]; then if [ -e "${working_dir}/etc/locale.gen" ]; then
echo -e 'en_US.UTF-8 UTF-8\nde_DE.UTF-8 UTF-8' > "${working_dir}/etc/locale.gen" sed -i 's@^#\(en_US\|de_DE\)\(\.UTF-8\)@\1\2@' "${working_dir}/etc/locale.gen"
chroot "${working_dir}" locale-gen chroot "${working_dir}" locale-gen
fi fi

View File

@@ -17,7 +17,7 @@ HoldPkg = pacman glibc
# If upgrades are available for these packages they will be asked for first # If upgrades are available for these packages they will be asked for first
SyncFirst = pacman SyncFirst = pacman
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl -C - %u > %o #XferCommand = /usr/bin/curl -C - -f %u > %o
#CleanMethod = KeepInstalled #CleanMethod = KeepInstalled
Architecture = auto Architecture = auto
@@ -33,6 +33,7 @@ Architecture = auto
#ShowSize #ShowSize
#UseDelta #UseDelta
#TotalDownload #TotalDownload
#CheckSpace
# #
# REPOSITORIES # REPOSITORIES
@@ -58,23 +59,18 @@ Architecture = auto
# after the header, and they will be used before the default mirrors. # after the header, and they will be used before the default mirrors.
#[testing] #[testing]
## Add your preferred servers here, they will be used first
#Include = /etc/pacman.d/mirrorlist #Include = /etc/pacman.d/mirrorlist
[core] [core]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[extra] [extra]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
#[community-testing] #[community-testing]
## Add your preferred servers here, they will be used first
#Include = /etc/pacman.d/mirrorlist #Include = /etc/pacman.d/mirrorlist
[community] [community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for # An example of a custom package repository. See the pacman manpage for

View File

@@ -0,0 +1,88 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
HoldPkg = pacman glibc
# If upgrades are available for these packages they will be asked for first
SyncFirst = pacman
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl -C - -f %u > %o
#CleanMethod = KeepInstalled
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options (all disabled by default)
#UseSyslog
#ShowSize
#UseDelta
#TotalDownload
#CheckSpace
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
[testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community-testing]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repository here.
[multilib-testing]
Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#Server = file:///home/custompkgs

View File

@@ -17,7 +17,7 @@ HoldPkg = pacman glibc
# If upgrades are available for these packages they will be asked for first # If upgrades are available for these packages they will be asked for first
SyncFirst = pacman SyncFirst = pacman
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl -C - %u > %o #XferCommand = /usr/bin/curl -C - -f %u > %o
#CleanMethod = KeepInstalled #CleanMethod = KeepInstalled
Architecture = auto Architecture = auto
@@ -33,6 +33,7 @@ Architecture = auto
#ShowSize #ShowSize
#UseDelta #UseDelta
#TotalDownload #TotalDownload
#CheckSpace
# #
# REPOSITORIES # REPOSITORIES
@@ -58,27 +59,23 @@ Architecture = auto
# after the header, and they will be used before the default mirrors. # after the header, and they will be used before the default mirrors.
#[testing] #[testing]
## Add your preferred servers here, they will be used first
#Include = /etc/pacman.d/mirrorlist #Include = /etc/pacman.d/mirrorlist
[core] [core]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[extra] [extra]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
#[community-testing] #[community-testing]
## Add your preferred servers here, they will be used first
#Include = /etc/pacman.d/mirrorlist #Include = /etc/pacman.d/mirrorlist
[community] [community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repository here.
[multilib] [multilib]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for # An example of a custom package repository. See the pacman manpage for

View File

@@ -17,7 +17,7 @@ HoldPkg = pacman glibc
# If upgrades are available for these packages they will be asked for first # If upgrades are available for these packages they will be asked for first
SyncFirst = pacman SyncFirst = pacman
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl -C - %u > %o #XferCommand = /usr/bin/curl -C - -f %u > %o
#CleanMethod = KeepInstalled #CleanMethod = KeepInstalled
Architecture = auto Architecture = auto
@@ -33,6 +33,7 @@ Architecture = auto
#ShowSize #ShowSize
#UseDelta #UseDelta
#TotalDownload #TotalDownload
#CheckSpace
# #
# REPOSITORIES # REPOSITORIES
@@ -58,31 +59,24 @@ Architecture = auto
# after the header, and they will be used before the default mirrors. # after the header, and they will be used before the default mirrors.
[staging] [staging]
## Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[testing] [testing]
## Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[core] [core]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[extra] [extra]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[community-staging] [community-staging]
## Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[community-testing] [community-testing]
## Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[community] [community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for # An example of a custom package repository. See the pacman manpage for

View File

@@ -17,7 +17,7 @@ HoldPkg = pacman glibc
# If upgrades are available for these packages they will be asked for first # If upgrades are available for these packages they will be asked for first
SyncFirst = pacman SyncFirst = pacman
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl -C - %u > %o #XferCommand = /usr/bin/curl -C - -f %u > %o
#CleanMethod = KeepInstalled #CleanMethod = KeepInstalled
Architecture = auto Architecture = auto
@@ -33,6 +33,7 @@ Architecture = auto
#ShowSize #ShowSize
#UseDelta #UseDelta
#TotalDownload #TotalDownload
#CheckSpace
# #
# REPOSITORIES # REPOSITORIES
@@ -58,23 +59,18 @@ Architecture = auto
# after the header, and they will be used before the default mirrors. # after the header, and they will be used before the default mirrors.
[testing] [testing]
## Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[core] [core]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[extra] [extra]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[community-testing] [community-testing]
## Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
[community] [community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for # An example of a custom package repository. See the pacman manpage for