mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 09:56:18 +02:00
Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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.22
|
||||
|
||||
BINPROGS = \
|
||||
checkpkg \
|
||||
@@ -57,6 +57,7 @@ install:
|
||||
install -m0644 ${CONFIGFILES} $(DESTDIR)/usr/share/devtools
|
||||
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
|
||||
install -Dm0644 bash_completion $(DESTDIR)/etc/bash_completion.d/devtools
|
||||
|
||||
uninstall:
|
||||
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 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
|
||||
rm $(DESTDIR)/etc/bash_completion.d/devtools
|
||||
|
||||
dist:
|
||||
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!'
|
||||
fi
|
||||
|
||||
echo -n 'releasing package...'
|
||||
echo -n "releasing package to ${1}..."
|
||||
pushd .. >/dev/null
|
||||
if [ -d "repos/${1}" ]; then
|
||||
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
|
11
checkpkg
11
checkpkg
@@ -32,17 +32,16 @@ TEMPDIR=$(mktemp -d /tmp/checkpkg-script.XXXX)
|
||||
cd $TEMPDIR
|
||||
|
||||
for _pkgname in ${pkgname[@]}; do
|
||||
pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
|
||||
oldstylepkgfile=${_pkgname}-${pkgver}-${pkgrel}${PKGEXT}
|
||||
if [ -z ${epoch} ] ; then
|
||||
pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
|
||||
else
|
||||
pkgfile=${_pkgname}-${epoch}:${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
|
||||
fi
|
||||
|
||||
if [ -f "$STARTDIR/$pkgfile" ]; then
|
||||
cp "$STARTDIR/$pkgfile" .
|
||||
elif [ -f "$PKGDEST/$pkgfile" ]; then
|
||||
cp "$PKGDEST/$pkgfile" .
|
||||
elif [ -f "$STARTDIR/$oldstylepkgfile" ]; then
|
||||
cp "$STARTDIR/$oldstylepkgfile" .
|
||||
elif [ -f "$PKGDEST/$oldstylepkgfile" ]; then
|
||||
cp "$PKGDEST/$oldstylepkgfile" .
|
||||
else
|
||||
echo "File \"$pkgfile\" doesn't exist"
|
||||
exit 1
|
||||
|
92
commitpkg
92
commitpkg
@@ -51,38 +51,31 @@ fi
|
||||
. PKGBUILD
|
||||
pkgbase=${pkgbase:-$pkgname}
|
||||
|
||||
# set up repo-specific opts depending on how we were called
|
||||
server='gerolde.archlinux.org'
|
||||
if [ "$cmd" == 'extrapkg' ]; then
|
||||
repo='extra'
|
||||
elif [ "$cmd" == 'corepkg' ]; then
|
||||
repo='core'
|
||||
elif [ "$cmd" == 'testingpkg' ]; then
|
||||
repo='testing'
|
||||
elif [ "$cmd" == 'stagingpkg' ]; then
|
||||
repo='staging'
|
||||
elif [ "$cmd" == 'communitypkg' ]; then
|
||||
repo='community'
|
||||
server='aur.archlinux.org'
|
||||
elif [ "$cmd" == 'community-testingpkg' ]; then
|
||||
repo='community-testing'
|
||||
server='aur.archlinux.org'
|
||||
elif [ "$cmd" == 'community-stagingpkg' ]; then
|
||||
repo='community-staging'
|
||||
server='aur.archlinux.org'
|
||||
elif [ "$cmd" == 'multilibpkg' ]; then
|
||||
repo='multilib'
|
||||
server='aur.archlinux.org'
|
||||
elif [ "$cmd" == 'multilib-testingpkg' ]; then
|
||||
repo='multilib-testing'
|
||||
server='aur.archlinux.org'
|
||||
else
|
||||
if [ $# -eq 0 ]; then
|
||||
case "$cmd" in
|
||||
commitpkg)
|
||||
if [ $# -eq 0 ]; then
|
||||
abort 'usage: commitpkg <reponame> [-l limit] [commit message]'
|
||||
fi
|
||||
repo="$1"
|
||||
shift
|
||||
;;
|
||||
*pkg)
|
||||
repo="${cmd%pkg}"
|
||||
;;
|
||||
*)
|
||||
abort 'usage: commitpkg <reponame> [-l limit] [commit message]'
|
||||
fi
|
||||
repo="$1"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$repo" in
|
||||
core|extra|testing|staging)
|
||||
server='gerolde.archlinux.org' ;;
|
||||
community*|multilib*)
|
||||
server='aur.archlinux.org' ;;
|
||||
*)
|
||||
server='gerolde.archlinux.org'
|
||||
echo "Non-standard repository $repo in use, defaulting to server $server" ;;
|
||||
esac
|
||||
|
||||
# check if all local source files are under version control
|
||||
for s in ${source[@]}; do
|
||||
@@ -104,9 +97,9 @@ for i in 'changelog' 'install'; do
|
||||
done
|
||||
|
||||
# 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
|
||||
rsyncopts="--bwlimit=$2"
|
||||
rsyncopts="$rsyncopts --bwlimit=$2"
|
||||
shift 2
|
||||
fi
|
||||
|
||||
@@ -119,6 +112,8 @@ else
|
||||
fi
|
||||
echo 'done'
|
||||
|
||||
declare -a uploads
|
||||
|
||||
for _arch in ${arch[@]}; do
|
||||
for _pkgname in ${pkgname[@]}; do
|
||||
fullver=$(get_full_version ${epoch:-0} $pkgver $pkgrel)
|
||||
@@ -133,13 +128,31 @@ for _arch in ${arch[@]}; do
|
||||
echo "skipping ${_arch}"
|
||||
continue 2
|
||||
fi
|
||||
uploads+=("$pkgfile")
|
||||
|
||||
echo -n 'uploading '
|
||||
rsync -p --chmod 'ug=rw,o=r' -c -h -L --progress $rsyncopts --partial "${pkgfile}" -e ssh "$server:staging/$repo/${pkgfile##*/}" || abort
|
||||
if [[ $SIGNPKG == 'y' ]]; then
|
||||
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
|
||||
archrelease $repo-${_arch} || abort
|
||||
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 [ -d ../repos/$repo-i686 -a -d ../repos/$repo-x86_64 ]; then
|
||||
pushd ../repos/ >/dev/null
|
||||
@@ -150,4 +163,13 @@ if [ "${arch[*]}" == 'any' ]; then
|
||||
echo 'done'
|
||||
popd >/dev/null
|
||||
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
|
||||
|
@@ -156,7 +156,7 @@ if [ -n "$install_pkg" ]; then
|
||||
mkarchroot -r "pacman -U /$pkgname" "$copydir"
|
||||
ret=$?
|
||||
rm "$copydir/$pkgname"
|
||||
#exit early, we've done all we need to
|
||||
# Exit early, we've done all we need to
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
@@ -167,11 +167,11 @@ fi
|
||||
[ -d "$copydir/build" ] || mkdir "$copydir/build"
|
||||
|
||||
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/"*
|
||||
fi
|
||||
|
||||
# read .makpekg.conf even if called via sudo
|
||||
# Read .makepkg.conf even if called via sudo
|
||||
if [ -n "${SUDO_USER}" ]; then
|
||||
makepkg_conf="/$(eval echo ~${SUDO_USER})/.makepkg.conf"
|
||||
else
|
||||
@@ -277,7 +277,7 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then
|
||||
fi
|
||||
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}"
|
||||
done
|
||||
else
|
||||
|
Reference in New Issue
Block a user