mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 01:46:19 +02:00
Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ab5eb2e4de | ||
![]() |
a1a6a8eaca | ||
![]() |
6d4367de35 | ||
![]() |
5df1f9bd6d | ||
![]() |
9b33a29ea5 | ||
![]() |
3985129c3d | ||
![]() |
e197f6d34c | ||
![]() |
c45e5bbf22 | ||
![]() |
e380f396cf | ||
![]() |
d187cdbc38 | ||
![]() |
fee49075f0 | ||
![]() |
39ae6e23d6 | ||
![]() |
61cc1f3504 | ||
![]() |
7037948b65 | ||
![]() |
0e6780f2c8 | ||
![]() |
45c8269441 | ||
![]() |
7e3013b2ae | ||
![]() |
c16e7c25c9 | ||
![]() |
c955ecf35d | ||
![]() |
160e936bba | ||
![]() |
69f9e64aa3 | ||
![]() |
71efb148df | ||
![]() |
48ccc1c7fb |
9
Makefile
9
Makefile
@@ -1,4 +1,4 @@
|
|||||||
V=0.9.19
|
V=0.9.23
|
||||||
|
|
||||||
BINPROGS = \
|
BINPROGS = \
|
||||||
checkpkg \
|
checkpkg \
|
||||||
@@ -57,6 +57,7 @@ install:
|
|||||||
install -m0644 ${CONFIGFILES} $(DESTDIR)/usr/share/devtools
|
install -m0644 ${CONFIGFILES} $(DESTDIR)/usr/share/devtools
|
||||||
for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)/usr/bin/$$l; done
|
for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)/usr/bin/$$l; done
|
||||||
for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)/usr/bin/$$l; done
|
for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)/usr/bin/$$l; done
|
||||||
|
install -Dm0644 bash_completion $(DESTDIR)/etc/bash_completion.d/devtools
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
for f in ${BINPROGS}; do rm -f $(DESTDIR)/usr/bin/$$f; done
|
for f in ${BINPROGS}; do rm -f $(DESTDIR)/usr/bin/$$f; done
|
||||||
@@ -64,8 +65,12 @@ uninstall:
|
|||||||
for f in ${CONFIGFILES}; do rm -f $(DESTDIR)/usr/share/devtools/$$f; done
|
for f in ${CONFIGFILES}; do rm -f $(DESTDIR)/usr/share/devtools/$$f; done
|
||||||
for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)/usr/bin/$$l; done
|
for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)/usr/bin/$$l; done
|
||||||
for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)/usr/bin/$$l; done
|
for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)/usr/bin/$$l; done
|
||||||
|
rm $(DESTDIR)/etc/bash_completion.d/devtools
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
.PHONY: all install uninstall dist
|
upload:
|
||||||
|
scp devtools-$(V).tar.gz gerolde.archlinux.org:/srv/ftp/other/devtools/
|
||||||
|
|
||||||
|
.PHONY: all install uninstall dist upload
|
||||||
|
@@ -23,7 +23,7 @@ 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}"
|
svn rm --force -q "repos/${1}"
|
||||||
|
69
bash_completion
Normal file
69
bash_completion
Normal 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
|
13
checkpkg
13
checkpkg
@@ -32,23 +32,22 @@ 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" .
|
cp "$STARTDIR/$pkgfile" .
|
||||||
elif [ -f "$PKGDEST/$pkgfile" ]; then
|
elif [ -f "$PKGDEST/$pkgfile" ]; then
|
||||||
cp "$PKGDEST/$pkgfile" .
|
cp "$PKGDEST/$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."
|
||||||
|
104
commitpkg
104
commitpkg
@@ -51,38 +51,31 @@ 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'
|
*)
|
||||||
elif [ "$cmd" == 'multilib-testingpkg' ]; then
|
server='gerolde.archlinux.org'
|
||||||
repo='multilib-testing'
|
echo "Non-standard repository $repo in use, defaulting to server $server" ;;
|
||||||
server='aur.archlinux.org'
|
esac
|
||||||
else
|
|
||||||
if [ $# -eq 0 ]; then
|
|
||||||
abort 'usage: commitpkg <reponame> [-l limit] [commit message]'
|
|
||||||
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
|
||||||
@@ -104,9 +97,14 @@ for i in 'changelog' 'install'; do
|
|||||||
done
|
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
|
||||||
|
|
||||||
@@ -119,7 +117,14 @@ else
|
|||||||
fi
|
fi
|
||||||
echo 'done'
|
echo 'done'
|
||||||
|
|
||||||
|
declare -a uploads
|
||||||
|
|
||||||
for _arch in ${arch[@]}; do
|
for _arch in ${arch[@]}; do
|
||||||
|
if [ -n "$commit_arch" ] && [ "${_arch}" != "$commit_arch" ]; then
|
||||||
|
echo "skipping ${_arch}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
for _pkgname in ${pkgname[@]}; do
|
for _pkgname in ${pkgname[@]}; do
|
||||||
fullver=$(get_full_version ${epoch:-0} $pkgver $pkgrel)
|
fullver=$(get_full_version ${epoch:-0} $pkgver $pkgrel)
|
||||||
pkgfile=$(getpkgfile "$_pkgname-$fullver-${_arch}".pkg.tar.?z 2>/dev/null)
|
pkgfile=$(getpkgfile "$_pkgname-$fullver-${_arch}".pkg.tar.?z 2>/dev/null)
|
||||||
@@ -133,13 +138,31 @@ for _arch in ${arch[@]}; do
|
|||||||
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/${pkgfile##*/}" || 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
|
||||||
@@ -150,4 +173,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
|
||||||
|
@@ -156,7 +156,7 @@ if [ -n "$install_pkg" ]; then
|
|||||||
mkarchroot -r "pacman -U /$pkgname" "$copydir"
|
mkarchroot -r "pacman -U /$pkgname" "$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
|
||||||
|
|
||||||
@@ -167,11 +167,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
|
||||||
@@ -277,7 +277,7 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for l in "${copydir}"/build/{namcap,*-{build,package,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
|
||||||
|
@@ -73,7 +73,7 @@ if [ -z "$cache_dir" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /etc/pacman.d/mirrorlist ]; then
|
if [ -f /etc/pacman.d/mirrorlist ]; then
|
||||||
host_mirror=$(pacman -Sdp extra/devtools 2>/dev/null | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#')
|
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='http://mirrors.kernel.org/archlinux/$repo/os/$arch'
|
host_mirror='http://mirrors.kernel.org/archlinux/$repo/os/$arch'
|
||||||
|
Reference in New Issue
Block a user