mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 01:46:19 +02:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
12eec95ff8 | ||
![]() |
d4f00819ac | ||
![]() |
4a4455c086 | ||
![]() |
52e140f2fe | ||
![]() |
48dead1af7 | ||
![]() |
17e875f6b3 | ||
![]() |
a7c5010d24 | ||
![]() |
f72775feac | ||
![]() |
371f57b043 | ||
![]() |
2fe5dbf904 | ||
![]() |
5036f1250e | ||
![]() |
f00c8f66bd | ||
![]() |
df4310025b | ||
![]() |
53a864a5aa | ||
![]() |
849e6c6de5 | ||
![]() |
62e4272ca2 |
30
archrelease
30
archrelease
@@ -1,34 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" = '' ]; then
|
||||
echo 'Usage: archrelease <repo>'
|
||||
abort() {
|
||||
echo ${1:-'archrelease: Cancelled'}
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$1" = '' ]; then
|
||||
abort 'Usage: archrelease <repo>'
|
||||
fi
|
||||
|
||||
if [ ! -f PKGBUILD ]; then
|
||||
echo 'archrelease: PKGBUILD not found'
|
||||
exit 1
|
||||
abort 'archrelease: PKGBUILD not found'
|
||||
fi
|
||||
|
||||
if [ "$(basename $(readlink -f .))" != 'trunk' ]; then
|
||||
echo 'archrelease: Not in a package trunk dir'
|
||||
exit 1
|
||||
abort 'archrelease: Not in a package trunk dir'
|
||||
fi
|
||||
|
||||
if [ "$(svn diff)" != '' ]; then
|
||||
echo 'archrelease: You have not committed your changes yet!'
|
||||
echo ' Please run "svn commit" first'
|
||||
exit 1
|
||||
if [ ! -z "$(svn status -q)" ]; then
|
||||
abort 'archrelease: You have not committed your changes yet!'
|
||||
fi
|
||||
|
||||
echo -n 'releasing package...'
|
||||
pushd .. >/dev/null
|
||||
if [ -d repos/$1 ]; then
|
||||
svn rm --force -q repos/$1
|
||||
svn commit -q -m "archrelease: remove $1"
|
||||
if [ -d "repos/${1}" ]; then
|
||||
svn rm --force -q "repos/${1}"
|
||||
svn commit -q -m "archrelease: remove ${1}" || abort
|
||||
fi
|
||||
svn copy -q -r HEAD trunk repos/$1
|
||||
svn commit -q -m "archrelease: copy trunk to $1"
|
||||
svn copy -q -r HEAD trunk "repos/${1}"
|
||||
svn commit -q -m "archrelease: copy trunk to ${1}" || abort
|
||||
popd >/dev/null
|
||||
echo 'done'
|
||||
|
||||
|
22
commitpkg
22
commitpkg
@@ -5,6 +5,17 @@ abort() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
getpkgfile() {
|
||||
if [[ ${#} -ne 1 ]]; then
|
||||
echo 'ERROR: No canonical package found!' >&2
|
||||
exit 1
|
||||
elif [ ! -f "${1}" ]; then
|
||||
echo "ERROR: Package ${1} not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ${1}
|
||||
}
|
||||
|
||||
# Source makepkg.conf; fail if it is not found
|
||||
if [ -r '/etc/makepkg.conf' ]; then
|
||||
@@ -74,17 +85,18 @@ echo 'done'
|
||||
|
||||
for _arch in ${arch[@]}; do
|
||||
for _pkgname in ${pkgname[@]}; do
|
||||
pkgfile=$_pkgname-$pkgver-$pkgrel-${_arch}$PKGEXT
|
||||
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 "$PKGDEST/$pkgfile" ]; then
|
||||
pkgfile="$PKGDEST/$pkgfile"
|
||||
elif [ ! -f $pkgfile ]; then
|
||||
if [ ! -f "$pkgfile" -a -f "$pkgdestfile" ]; then
|
||||
pkgfile="$pkgdestfile"
|
||||
elif [ ! -f "$pkgfile" ]; then
|
||||
echo "skipping ${_arch}"
|
||||
continue 2
|
||||
fi
|
||||
|
||||
echo -n 'uploading '
|
||||
rsync -c -h --progress $rsyncopts "${pkgfile}" -e ssh $server:staging/$repo || abort
|
||||
rsync -p --chmod 'ug=rw,o=r' -c -h -L --progress $rsyncopts "${pkgfile}" -e ssh $server:staging/$repo || abort
|
||||
done
|
||||
archrelease $repo-${_arch} || abort
|
||||
done
|
||||
|
12
lddd
12
lddd
@@ -19,12 +19,12 @@ 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')
|
||||
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
|
||||
|
@@ -147,6 +147,8 @@ if ! grep 'SRCDEST=/srcdest' "$copydir/etc/makepkg.conf" >/dev/null 2>&1; then
|
||||
echo 'SRCDEST=/srcdest' >> "$copydir/etc/makepkg.conf"
|
||||
fi
|
||||
|
||||
# Set target CARCH as it might be used within the PKGBUILD to select correct sources
|
||||
CARCH=$(eval $(grep '^CARCH=' "$copydir/etc/makepkg.conf"))
|
||||
# Copy PKGBUILD and sources
|
||||
source PKGBUILD
|
||||
cp PKGBUILD "$copydir/build/"
|
||||
@@ -196,21 +198,20 @@ cd /build
|
||||
export HOME=/build
|
||||
sudo -u nobody makepkg $MAKEPKG_ARGS || touch BUILD_FAILED
|
||||
[ -f BUILD_FAILED ] && exit 1
|
||||
which namcap &>/dev/null && namcap /build/PKGBUILD /pkgdest/*${PKGEXT} > /pkgdest/namcap.log
|
||||
which namcap &>/dev/null && namcap /build/PKGBUILD /pkgdest/*.pkg.tar.* > /build/namcap.log
|
||||
exit 0
|
||||
EOF
|
||||
) > "$copydir/chrootbuild"
|
||||
chmod +x "$copydir/chrootbuild"
|
||||
|
||||
if mkarchroot -r "/chrootbuild" "$copydir"; then
|
||||
for pkgfile in "${copydir}"/pkgdest/*${PKGEXT}; do
|
||||
for pkgfile in "${copydir}"/pkgdest/*.pkg.tar.*; do
|
||||
[ -e "$pkgfile" ] || continue
|
||||
_pkgname=$(basename "$pkgfile")
|
||||
if [ "$add_to_db" -eq "1" ]; then
|
||||
[ -d "${copydir}/repo" ] || mkdir -p "${copydir}/repo"
|
||||
mkdir -p "${copydir}/repo"
|
||||
pushd "${copydir}/repo" >/dev/null
|
||||
cp "$pkgfile" .
|
||||
repo-add repo.db.tar.gz "$_pkgname"
|
||||
repo-add repo.db.tar.gz "$(basename "$pkgfile")"
|
||||
popd >/dev/null
|
||||
fi
|
||||
|
||||
@@ -221,16 +222,7 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then
|
||||
fi
|
||||
done
|
||||
|
||||
for f in "${copydir}"/srcdest/*; do
|
||||
[ -e "$f" ] || continue
|
||||
if [ -d "$SRCDEST" ]; then
|
||||
mv "$f" "${SRCDEST}"
|
||||
else
|
||||
mv "$f" "${WORKDIR}"
|
||||
fi
|
||||
done
|
||||
|
||||
for l in "${copydir}"/build/*-{build,package}.log; do
|
||||
for l in "${copydir}"/build/{namcap,*-{build,package}}.log; do
|
||||
[ -f "$l" ] && mv "$l" "${WORKDIR}"
|
||||
done
|
||||
else
|
||||
@@ -238,9 +230,19 @@ else
|
||||
touch "${copydir}/build/BUILD_FAILED"
|
||||
fi
|
||||
|
||||
for f in "${copydir}"/srcdest/*; do
|
||||
[ -e "$f" ] || continue
|
||||
if [ -d "$SRCDEST" ]; then
|
||||
mv "$f" "${SRCDEST}"
|
||||
else
|
||||
mv "$f" "${WORKDIR}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -e "${copydir}/build/BUILD_FAILED" ]; then
|
||||
echo "Build failed, check $copydir/build"
|
||||
rm "${copydir}/build/BUILD_FAILED"
|
||||
exit 1
|
||||
else
|
||||
rm -rf "${copydir}"/build/*
|
||||
fi
|
||||
|
@@ -26,7 +26,7 @@ usage() {
|
||||
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 " -c <dir> Set pacman cache. Default: ${cache_dir}"
|
||||
echo " -c <dir> Set pacman cache. Default: /var/cache/pacman/pkg"
|
||||
echo ' -h This message'
|
||||
exit $1
|
||||
}
|
||||
|
Reference in New Issue
Block a user