Compare commits

..

10 Commits

Author SHA1 Message Date
Pierre Schmitz
8ba91b0574 prepare release 2011-11-06 10:38:39 +01:00
Pierre Schmitz
671643053d archbuild: Always use recent makepkg.conf and pacman.conf; Run namcap by default 2011-11-06 10:32:55 +01:00
Pierre Schmitz
bf96c9f949 makechrootpkg: Create separate namcap log for every single file 2011-11-06 10:31:37 +01:00
Pierre Schmitz
a030cdc532 mkarchroot: Respect makepkg.conf and pacman.conf when running a command 2011-11-06 10:27:55 +01:00
Lukas Fleischer
b7a3c74c50 commitpkg: Fix commit message
Move the message template before the if block. We moved this to the else
branch in commit aaa68e49e8 which lead to
"msgtemplate" being unset if one specifies a commit message on the
command line, thus stripping the "upgpkg:" part.

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

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

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:34:00 +01:00
Lukas Fleischer
c1752bd716 lib/common.sh: Use double brackets
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:33:51 +01:00
Eric Bélanger
42d821ef7b Capitalize output messages
Some of the output/error messages were capitalized, some were
not. This patch capitalize everything for consistency sake. Other
minor changes were done to the messages like removing the superfluous
"error:" from die messages and adding a final period to messages that
were complete sentences as appropriate.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:33:29 +01:00
11 changed files with 69 additions and 55 deletions

View File

@@ -1,4 +1,4 @@
V=20111101 V=20111106
PREFIX = /usr/local PREFIX = /usr/local
@@ -52,7 +52,7 @@ all: $(BINPROGS) $(SBINPROGS) bash_completion zsh_completion
edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g" edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g"
%: %.in %: %.in Makefile lib/common.sh
@echo "GEN $@" @echo "GEN $@"
@m4 -P $@.in | $(edit) >$@ @m4 -P $@.in | $(edit) >$@
@chmod a-w "$@" @chmod a-w "$@"

View File

@@ -53,25 +53,34 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
done done
exec 9>&- exec 9>&-
# FIXME: temporary workaround until pacman 4.0 moves to [core]
if pacman -V | grep -q 'v4.' && ( [[ "$repo" == 'extra' || "$repo" == 'multilib' ]] ); then
pacman_conf=$(mktemp)
cp "@pkgdatadir@/pacman-${repo}.conf" "${pacman_conf}"
sed -r 's/^#(SigLevel = Never)/\1/' -i "${pacman_conf}"
else
pacman_conf="@pkgdatadir@/pacman-${repo}.conf"
fi
rm -rf "${chroots}/${repo}-${arch}" rm -rf "${chroots}/${repo}-${arch}"
mkdir -p "${chroots}/${repo}-${arch}" mkdir -p "${chroots}/${repo}-${arch}"
setarch "${arch}" mkarchroot \ setarch "${arch}" mkarchroot \
-C "@pkgdatadir@/pacman-${repo}.conf" \ -C "${pacman_conf}" \
-M "@pkgdatadir@/makepkg-${arch}.conf" \ -M "@pkgdatadir@/makepkg-${arch}.conf" \
"${chroots}/${repo}-${arch}/root" \ "${chroots}/${repo}-${arch}/root" \
"${base_packages[@]}" "${base_packages[@]}"
# FIXME: temporary workaround until pacman 4.0 moves to [core] # FIXME: temporary workaround until pacman 4.0 moves to [core]
case $repo in if pacman -V | grep -q 'v4.' && ( [[ "$repo" == 'extra' || "$repo" == 'multilib' ]] ); then
core|extra|community|multilib) cp "@pkgdatadir@/pacman-${repo}.conf" "${chroots}/${repo}-${arch}/root/etc/pacman.conf"
sed -r '/^SigLevel.*/d' -i "${chroots}/${repo}-${arch}/root/etc/pacman.conf" fi
;;
esac
else else
setarch ${arch} mkarchroot \ setarch ${arch} mkarchroot \
-u \ -u \
-C "@pkgdatadir@/pacman-${repo}.conf" \
-M "@pkgdatadir@/makepkg-${arch}.conf" \
"${chroots}/${repo}-${arch}/root" "${chroots}/${repo}-${arch}/root"
fi fi
msg "Building in chroot for [${repo}] (${arch})..." msg "Building in chroot for [${repo}] (${arch})..."
setarch "${arch}" makechrootpkg -c -r "${chroots}/${repo}-${arch}" setarch "${arch}" makechrootpkg -c -n -r "${chroots}/${repo}-${arch}"

View File

@@ -15,7 +15,7 @@ case $scriptname in
communityco) communityco)
SVNURL="svn+ssh://aur.archlinux.org/srv/svn-packages";; SVNURL="svn+ssh://aur.archlinux.org/srv/svn-packages";;
*) *)
die "error: couldn't find svn url for $scriptname" die "Couldn't find svn url for $scriptname"
;; ;;
esac esac

View File

@@ -36,7 +36,7 @@ for file in "${known_files[@]}"; do
done done
for tag in "$@"; do for tag in "$@"; do
stat_busy "copying ${trunk} to ${tag}" stat_busy "Copying ${trunk} to ${tag}"
if [[ -d repos/$tag ]]; then if [[ -d repos/$tag ]]; then
declare -a trash declare -a trash
@@ -56,7 +56,7 @@ for tag in "$@"; do
stat_done stat_done
done done
stat_busy "releasing package" stat_busy "Releasing package"
printf -v tag_list ", %s" "$@"; tag_list="${tag_list#, }" printf -v tag_list ", %s" "$@"; tag_list="${tag_list#, }"
svn commit -q -m "archrelease: copy ${trunk} to $tag_list" || abort svn commit -q -m "archrelease: copy ${trunk} to $tag_list" || abort
stat_done stat_done

View File

@@ -4,9 +4,9 @@ m4_include(lib/common.sh)
getpkgfile() { getpkgfile() {
if [[ ${#} -ne 1 ]]; then if [[ ${#} -ne 1 ]]; then
die 'ERROR: No canonical package found!' die 'No canonical package found!'
elif [ ! -f "${1}" ]; then elif [ ! -f "${1}" ]; then
die "ERROR: Package ${1} not found!" die "Package ${1} not found!"
fi fi
echo ${1} echo ${1}
@@ -83,19 +83,19 @@ while getopts ':l:a:' flag; do
case $flag in case $flag in
l) rsyncopts+=("--bwlimit=$2") ;; l) rsyncopts+=("--bwlimit=$2") ;;
a) commit_arch=$2 ;; a) commit_arch=$2 ;;
:) die "option requires an argument -- '$OPTARG'" ;; :) die "Option requires an argument -- '$OPTARG'" ;;
\?) die "invalid option -- '$OPTARG'" ;; \?) die "Invalid option -- '$OPTARG'" ;;
esac esac
done done
shift $(( OPTIND - 1 )) shift $(( OPTIND - 1 ))
if [ -n "$(svn status -q)" ]; then if [ -n "$(svn status -q)" ]; then
msgtemplate="upgpkg: $pkgbase $(get_full_version)"$'\n\n'
if [ -n "$1" ]; then if [ -n "$1" ]; then
stat_busy 'committing changes to trunk' stat_busy 'Committing changes to trunk'
svn commit -q -m "${msgtemplate}${1}" || die svn commit -q -m "${msgtemplate}${1}" || die
stat_done stat_done
else else
msgtemplate="upgpkg: $pkgbase $(get_full_version)"$'\n\n'
msgfile="$(mktemp)" msgfile="$(mktemp)"
echo "$msgtemplate" > "$msgfile" echo "$msgtemplate" > "$msgfile"
if [ -n "$SVN_EDITOR" ]; then if [ -n "$SVN_EDITOR" ]; then
@@ -108,7 +108,7 @@ if [ -n "$(svn status -q)" ]; then
vi "$msgfile" vi "$msgfile"
fi fi
[ -s "$msgfile" ] || die [ -s "$msgfile" ] || die
stat_busy 'committing changes to trunk' stat_busy 'Committing changes to trunk'
svn commit -q -F "$msgfile" || die svn commit -q -F "$msgfile" || die
unlink "$msgfile" unlink "$msgfile"
stat_done stat_done
@@ -164,26 +164,26 @@ else
fi fi
if [[ ${#uploads[*]} -gt 0 ]]; then if [[ ${#uploads[*]} -gt 0 ]]; then
msg 'uploading all package and signature files' msg 'Uploading all package and signature files'
rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die
fi 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
stat_busy "removing $repo-i686 and $repo-x86_64" stat_busy "Removing $repo-i686 and $repo-x86_64"
svn rm $repo-i686 svn rm -q $repo-i686
svn rm $repo-x86_64 svn rm -q $repo-x86_64
svn commit -q -m "removed $repo-i686 and $repo-x86_64 for $pkgname" svn commit -q -m "Removed $repo-i686 and $repo-x86_64 for $pkgname"
stat_done stat_done
popd >/dev/null popd >/dev/null
fi fi
else else
if [ -d ../repos/$repo-any ]; then if [ -d ../repos/$repo-any ]; then
pushd ../repos/ >/dev/null pushd ../repos/ >/dev/null
stat_busy "removing $repo-any" stat_busy "Removing $repo-any"
svn rm $repo-any svn rm -q $repo-any
svn commit -q -m "removed $repo-any for $pkgname" svn commit -q -m "Removed $repo-any for $pkgname"
stat_done stat_done
popd >/dev/null popd >/dev/null
fi fi

View File

@@ -15,7 +15,7 @@ script_mode=${0##*/find-lib}
case $script_mode in case $script_mode in
deps|provides) true;; deps|provides) true;;
*) die "unknown mode $script_mode" ;; *) die "Unknown mode $script_mode" ;;
esac esac
if [[ -z $1 ]]; then if [[ -z $1 ]]; then

View File

@@ -58,14 +58,14 @@ stat_done() {
} }
setup_workdir() { setup_workdir() {
[ -z "$WORKDIR" ] && WORKDIR=$(mktemp -d /tmp/$(basename $0).XXXXXXXXXX) [[ -z $WORKDIR ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX")
} }
cleanup() { cleanup() {
trap - EXIT INT QUIT TERM trap - EXIT INT QUIT TERM
[ -n "$WORKDIR" ] && rm -rf "$WORKDIR" [[ -n $WORKDIR ]] && rm -rf "$WORKDIR"
[ "$1" ] && exit $1 [[ $1 ]] && exit $1
} }
abort() { abort() {

View File

@@ -114,7 +114,7 @@ umask 0022
# Note this is the same FD number as in mkarchroot # Note this is the same FD number as in mkarchroot
exec 9>"$copydir.lock" exec 9>"$copydir.lock"
if ! flock -n 9; then if ! flock -n 9; then
stat_busy "locking chroot copy '$copy'" stat_busy "Locking chroot copy '$copy'"
flock 9 flock 9
stat_done stat_done
fi fi
@@ -125,12 +125,12 @@ if [[ ! -d $copydir ]] || $clean_first; then
exec 8>"$chrootdir/root.lock" exec 8>"$chrootdir/root.lock"
if ! flock -sn 8; then if ! flock -sn 8; then
stat_busy "locking clean chroot" stat_busy "Locking clean chroot"
flock -s 8 flock -s 8
stat_done stat_done
fi fi
stat_busy 'creating clean working copy' stat_busy 'Creating clean working copy'
use_rsync=false use_rsync=false
if type -P btrfs >/dev/null; then if type -P btrfs >/dev/null; then
[[ -d $copydir ]] && btrfs subvolume delete "$copydir" &>/dev/null [[ -d $copydir ]] && btrfs subvolume delete "$copydir" &>/dev/null
@@ -274,7 +274,10 @@ sudo -u nobody makepkg $makepkg_args || touch BUILD_FAILED
if $run_namcap; then if $run_namcap; then
pacman -S --needed --noconfirm namcap pacman -S --needed --noconfirm namcap
namcap /build/PKGBUILD /pkgdest/*.pkg.tar.?z > /build/namcap.log for pkgfile in /build/PKGBUILD /pkgdest/*.pkg.tar.?z; do
echo "Checking \${pkgfile##*/}"
namcap "\$pkgfile" 2>&1 | tee "/build/\${pkgfile##*/}-namcap.log"
done
fi fi
exit 0 exit 0
@@ -282,7 +285,7 @@ EOF
chmod +x "$copydir/chrootbuild" chmod +x "$copydir/chrootbuild"
if mkarchroot -r "/chrootbuild" "$copydir"; then if mkarchroot -r "/chrootbuild" "$copydir"; then
for pkgfile in "$copydir"/pkgdest/*.pkg.tar.*; do for pkgfile in "$copydir"/pkgdest/*.pkg.tar.?z; do
if $add_to_db; then if $add_to_db; then
mkdir -p "$copydir/repo" mkdir -p "$copydir/repo"
pushd "$copydir/repo" >/dev/null pushd "$copydir/repo" >/dev/null
@@ -294,7 +297,7 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then
mv "$pkgfile" "$PKGDEST" mv "$pkgfile" "$PKGDEST"
done done
for l in "$copydir"/build/{namcap,*-{build,check,package,package_*}}.log; do for l in "$copydir"/build/*-{build,check,namcap,package,package_*}.log; do
[[ -f $l ]] && mv "$l" . [[ -f $l ]] && mv "$l" .
done done
else else

View File

@@ -48,21 +48,21 @@ while getopts 'r:ufnhC:M:c:' arg; do
done done
if [ "$EUID" != '0' ]; then if [ "$EUID" != '0' ]; then
die 'this script must be run as root.' die 'This script must be run as root.'
fi fi
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
if [ "$RUN" = '' -a $# -lt 2 ]; then if [ "$RUN" = '' -a $# -lt 2 ]; then
die 'you must specify a directory and one or more packages' die 'You must specify a directory and one or more packages.'
elif [ $# -lt 1 ]; then elif [ $# -lt 1 ]; then
die 'you must specify a directory' die 'You must specify a directory.'
fi fi
working_dir="$(readlink -f ${1})" working_dir="$(readlink -f ${1})"
shift 1 shift 1
[ "${working_dir}" = '' ] && die 'please specify a working directory' [ "${working_dir}" = '' ] && die 'Please specify a working directory.'
if [ -z "$cache_dir" ]; then if [ -z "$cache_dir" ]; then
cache_conf=${working_dir}/etc/pacman.conf cache_conf=${working_dir}/etc/pacman.conf
@@ -129,6 +129,14 @@ 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 "Server = ${host_mirror}" > ${working_dir}/etc/pacman.d/mirrorlist echo "Server = ${host_mirror}" > ${working_dir}/etc/pacman.d/mirrorlist
if [ "$pac_conf" != "" -a "$NOCOPY" = "n" ]; then
cp ${pac_conf} ${working_dir}/etc/pacman.conf
fi
if [ "$makepkg_conf" != "" -a "$NOCOPY" = "n" ]; then
cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf
fi
} }
chroot_umount () { chroot_umount () {
@@ -149,7 +157,7 @@ chroot_lock () {
# Lock the chroot. Take note of the FD number. # Lock the chroot. Take note of the FD number.
if ! flock -n 9; then if ! flock -n 9; then
stat_busy "locking chroot" stat_busy "Locking chroot"
flock 9 flock 9
stat_done stat_done
fi fi
@@ -161,7 +169,7 @@ 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
die "'${working_dir}' does not appear to be a Arch chroot" die "'${working_dir}' does not appear to be a Arch chroot."
fi fi
chroot_lock chroot_lock
@@ -174,7 +182,7 @@ if [ "$RUN" != "" ]; then
else else
# {{{ build chroot # {{{ build chroot
if [ -e "${working_dir}" -a "${FORCE}" = "n" ]; then if [ -e "${working_dir}" -a "${FORCE}" = "n" ]; then
die "working dir '${working_dir}' already exists - try using -f" die "Working directory '${working_dir}' already exists - try using -f"
fi fi
if { type -P btrfs && btrfs subvolume create "${working_dir}"; } &>/dev/null; then if { type -P btrfs && btrfs subvolume create "${working_dir}"; } &>/dev/null; then
@@ -198,7 +206,7 @@ else
op="${op}f" op="${op}f"
fi fi
if ! pacman ${op} ${pacargs} $@; then if ! pacman ${op} ${pacargs} $@; then
die 'failed to install all packages' die 'Failed to install all packages'
fi fi
fi fi
@@ -206,19 +214,13 @@ else
ldconfig -r "${working_dir}" ldconfig -r "${working_dir}"
fi fi
if [ "$pac_conf" != "" -a "$NOCOPY" = "n" ]; then
cp ${pac_conf} ${working_dir}/etc/pacman.conf
fi
if [ "$makepkg_conf" != "" -a "$NOCOPY" = "n" ]; then
cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf
fi
if [ -e "${working_dir}/etc/locale.gen" ]; then if [ -e "${working_dir}/etc/locale.gen" ]; then
sed -i 's@^#\(en_US\|de_DE\)\(\.UTF-8\)@\1\2@' "${working_dir}/etc/locale.gen" sed -i 's@^#\(en_US\|de_DE\)\(\.UTF-8\)@\1\2@' "${working_dir}/etc/locale.gen"
chroot "${working_dir}" /usr/sbin/locale-gen chroot "${working_dir}" /usr/sbin/locale-gen
fi fi
copy_hostconf
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

View File

@@ -48,7 +48,7 @@ Architecture = auto
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # Disable signature checks for now
SigLevel = Never #SigLevel = Never
# #
# REPOSITORIES # REPOSITORIES

View File

@@ -48,7 +48,7 @@ Architecture = auto
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # Disable signature checks for now
SigLevel = Never #SigLevel = Never
# #
# REPOSITORIES # REPOSITORIES