mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-14 18:36:18 +02:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2020fb406a | ||
![]() |
4427b80aba | ||
![]() |
41b54bdde5 | ||
![]() |
54bad4c91d | ||
![]() |
fc95a57556 | ||
![]() |
21458bd07b | ||
![]() |
a05969b29d | ||
![]() |
fdeaed894a | ||
![]() |
3699321904 | ||
![]() |
d8ec9c9066 | ||
![]() |
fbb2bd2b8e | ||
![]() |
d5c6bc7656 | ||
![]() |
f7615fe7d7 | ||
![]() |
1703b92e1a | ||
![]() |
cfd81ab563 | ||
![]() |
ac1ee41e4d |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
|||||||
*~
|
*~
|
||||||
devtools-*.tar.gz
|
devtools-*.tar.gz*
|
||||||
archbuild
|
archbuild
|
||||||
archco
|
archco
|
||||||
archrelease
|
archrelease
|
||||||
|
@@ -13,7 +13,7 @@ case $scriptname in
|
|||||||
archco)
|
archco)
|
||||||
SVNURL="svn+ssh://gerolde.archlinux.org/srv/svn-packages";;
|
SVNURL="svn+ssh://gerolde.archlinux.org/srv/svn-packages";;
|
||||||
communityco)
|
communityco)
|
||||||
SVNURL="svn+ssh://aur.archlinux.org/srv/svn-packages";;
|
SVNURL="svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn";;
|
||||||
*)
|
*)
|
||||||
die "Couldn't find svn url for $scriptname"
|
die "Couldn't find svn url for $scriptname"
|
||||||
;;
|
;;
|
||||||
|
@@ -66,7 +66,7 @@ for tag in "$@"; do
|
|||||||
while read -r file; do
|
while read -r file; do
|
||||||
trash+=("repos/$tag/$file")
|
trash+=("repos/$tag/$file")
|
||||||
done < <(svn ls "repos/$tag")
|
done < <(svn ls "repos/$tag")
|
||||||
[[ $trash ]] && svn rm -q "${trash[@]}"
|
[[ $trash ]] && svn rm -q "${trash[@]/%/@}"
|
||||||
else
|
else
|
||||||
mkdir -p "repos/$tag"
|
mkdir -p "repos/$tag"
|
||||||
svn add --parents -q "repos/$tag"
|
svn add --parents -q "repos/$tag"
|
||||||
|
@@ -58,7 +58,7 @@ for _pkgname in "${pkgname[@]}"; do
|
|||||||
elif [[ -f "$STARTDIR/$oldpkg" ]]; then
|
elif [[ -f "$STARTDIR/$oldpkg" ]]; then
|
||||||
ln -s "$STARTDIR/$oldpkg" "$oldpkg"
|
ln -s "$STARTDIR/$oldpkg" "$oldpkg"
|
||||||
else
|
else
|
||||||
wget --quiet "$pkgurl"
|
curl -fsLC - --retry 3 --retry-delay 3 -o "$oldpkg" "$pkgurl"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -109,7 +109,7 @@ if [[ -z $server ]]; then
|
|||||||
core|extra|testing|staging|kde-unstable|gnome-unstable)
|
core|extra|testing|staging|kde-unstable|gnome-unstable)
|
||||||
server='gerolde.archlinux.org' ;;
|
server='gerolde.archlinux.org' ;;
|
||||||
community*|multilib*)
|
community*|multilib*)
|
||||||
server='aur.archlinux.org' ;;
|
server='nymeria.archlinux.org' ;;
|
||||||
*)
|
*)
|
||||||
server='gerolde.archlinux.org'
|
server='gerolde.archlinux.org'
|
||||||
msg "Non-standard repository $repo in use, defaulting to server $server" ;;
|
msg "Non-standard repository $repo in use, defaulting to server $server" ;;
|
||||||
|
@@ -13,8 +13,8 @@ pkgbase="${1}"
|
|||||||
|
|
||||||
packages_svn='svn+ssh://gerolde.archlinux.org/srv/svn-packages'
|
packages_svn='svn+ssh://gerolde.archlinux.org/srv/svn-packages'
|
||||||
packages_server='gerolde.archlinux.org'
|
packages_server='gerolde.archlinux.org'
|
||||||
community_svn='svn+ssh://aur.archlinux.org/srv/svn-packages'
|
community_svn='svn+ssh://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn'
|
||||||
community_server='aur.archlinux.org'
|
community_server='nymeria.archlinux.org'
|
||||||
mirror='http://mirrors.kernel.org/archlinux'
|
mirror='http://mirrors.kernel.org/archlinux'
|
||||||
|
|
||||||
case $scriptname in
|
case $scriptname in
|
||||||
@@ -72,11 +72,23 @@ svn -q commit -m"${scriptname}: Moving ${pkgbase} from ${source_repo} to ${targe
|
|||||||
pushd "target_checkout/${pkgbase}/trunk" >/dev/null
|
pushd "target_checkout/${pkgbase}/trunk" >/dev/null
|
||||||
archrelease "${arch[@]/#/$target_repo-}" || die
|
archrelease "${arch[@]/#/$target_repo-}" || die
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
ssh "${target_server}" '/arch/db-update' || die
|
|
||||||
|
if [[ "${target_server}" == "${community_server}" ]]; then
|
||||||
|
dbscripts_path='/srv/repos/svn-community/dbscripts'
|
||||||
|
else
|
||||||
|
dbscripts_path='/arch'
|
||||||
|
fi
|
||||||
|
|
||||||
|
ssh "${target_server}" "${dbscripts_path}/db-update" || die
|
||||||
|
|
||||||
msg "Removing ${pkgbase} from ${source_repo}"
|
msg "Removing ${pkgbase} from ${source_repo}"
|
||||||
|
if [[ "${source_server}" == "${community_server}" ]]; then
|
||||||
|
dbscripts_path='/srv/repos/svn-community/dbscripts'
|
||||||
|
else
|
||||||
|
dbscripts_path='/arch'
|
||||||
|
fi
|
||||||
for _arch in ${arch[@]}; do
|
for _arch in ${arch[@]}; do
|
||||||
ssh "${source_server}" "/arch/db-remove ${source_repo} ${_arch} ${pkgbase}"
|
ssh "${source_server}" "${dbscripts_path}/db-remove ${source_repo} ${_arch} ${pkgbase}"
|
||||||
done
|
done
|
||||||
svn -q checkout -N "${source_svn}" source_checkout
|
svn -q checkout -N "${source_svn}" source_checkout
|
||||||
svn -q up "source_checkout/${pkgbase}"
|
svn -q up "source_checkout/${pkgbase}"
|
||||||
|
@@ -78,7 +78,7 @@ trap_abort() {
|
|||||||
|
|
||||||
trap_exit() {
|
trap_exit() {
|
||||||
trap - EXIT INT QUIT TERM HUP
|
trap - EXIT INT QUIT TERM HUP
|
||||||
cleanup 0
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
|
@@ -44,7 +44,7 @@ while getopts 'r:ufnhC:M:c:' arg; do
|
|||||||
M) makepkg_conf="$OPTARG" ;;
|
M) makepkg_conf="$OPTARG" ;;
|
||||||
n) NOCOPY='y' ;;
|
n) NOCOPY='y' ;;
|
||||||
c) cache_dir="$OPTARG" ;;
|
c) cache_dir="$OPTARG" ;;
|
||||||
h|?) usage 0 ;;
|
h|?) usage ;;
|
||||||
*) error "invalid argument '${arg}'"; usage ;;
|
*) error "invalid argument '${arg}'"; usage ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -78,18 +78,32 @@ if echo "${host_mirror}" | grep -q 'file://'; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# {{{ functions
|
# {{{ functions
|
||||||
|
bind_mount() {
|
||||||
|
local mode="${2:-rw}"
|
||||||
|
local target="${working_dir}${1}"
|
||||||
|
|
||||||
|
if [[ ! -e "$target" ]]; then
|
||||||
|
if [[ -d "$1" ]]; then
|
||||||
|
install -d "$target"
|
||||||
|
else
|
||||||
|
install -D /dev/null "$target"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
mount -o bind "$1" "$target"
|
||||||
|
mount -o remount,${mode},bind "$target"
|
||||||
|
mount --make-slave "$target"
|
||||||
|
}
|
||||||
|
|
||||||
chroot_mount() {
|
chroot_mount() {
|
||||||
trap 'trap_chroot_umount' EXIT INT QUIT TERM HUP
|
trap 'trap_chroot_umount' EXIT INT QUIT TERM HUP
|
||||||
|
|
||||||
if (( ! have_nspawn )); then
|
if (( ! have_nspawn )); then
|
||||||
[[ -e "${working_dir}/sys" ]] || mkdir "${working_dir}/sys"
|
bind_mount /sys ro
|
||||||
mount -o bind /sys "${working_dir}/sys"
|
|
||||||
mount -o remount,ro,bind "${working_dir}/sys"
|
|
||||||
|
|
||||||
[[ -e "${working_dir}/proc" ]] || mkdir "${working_dir}/proc"
|
[[ -e "${working_dir}/proc" ]] || mkdir "${working_dir}/proc"
|
||||||
mount -t proc proc -o nosuid,noexec,nodev "${working_dir}/proc"
|
mount -t proc proc -o nosuid,noexec,nodev "${working_dir}/proc"
|
||||||
mount -o bind /proc/sys "${working_dir}/proc/sys"
|
bind_mount /proc/sys ro
|
||||||
mount -o remount,ro,bind "${working_dir}/proc/sys"
|
|
||||||
|
|
||||||
[[ -e "${working_dir}/dev" ]] || mkdir "${working_dir}/dev"
|
[[ -e "${working_dir}/dev" ]] || mkdir "${working_dir}/dev"
|
||||||
mount -t tmpfs dev "${working_dir}/dev" -o mode=0755,size=10M,nosuid,strictatime
|
mount -t tmpfs dev "${working_dir}/dev" -o mode=0755,size=10M,nosuid,strictatime
|
||||||
@@ -112,35 +126,21 @@ chroot_mount() {
|
|||||||
[[ -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" -o nodev,nosuid,size=128M
|
mount -t tmpfs shm "${working_dir}/dev/shm" -o nodev,nosuid,size=128M
|
||||||
|
|
||||||
[[ -e "${working_dir}/dev/pts" ]] || mkdir "${working_dir}/dev/pts"
|
bind_mount /dev/pts
|
||||||
mount -o bind /dev/pts "${working_dir}/dev/pts"
|
|
||||||
|
|
||||||
[[ -e "${working_dir}/run" ]] || mkdir "${working_dir}/run"
|
[[ -e "${working_dir}/run" ]] || mkdir "${working_dir}/run"
|
||||||
mount -t tmpfs tmpfs "${working_dir}/run" -o mode=0755,nodev,nosuid,strictatime,size=64M
|
mount -t tmpfs tmpfs "${working_dir}/run" -o mode=0755,nodev,nosuid,strictatime,size=64M
|
||||||
|
|
||||||
for host_config in resolv.conf timezone localtime; do
|
for host_config in resolv.conf localtime; do
|
||||||
[[ -e "${working_dir}/etc/${host_config}" ]] || touch "${working_dir}/etc/${host_config}"
|
bind_mount /etc/$host_config ro
|
||||||
mount -o bind /etc/${host_config} "${working_dir}/etc/${host_config}"
|
|
||||||
mount -o remount,ro,bind "${working_dir}/etc/${host_config}"
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $host_mirror_path ]]; then
|
[[ -n $host_mirror_path ]] && bind_mount "$host_mirror_path" ro
|
||||||
[[ -e "${working_dir}/${host_mirror_path}" ]] || mkdir -p "${working_dir}/${host_mirror_path}"
|
|
||||||
mount -o bind "${host_mirror_path}" "${working_dir}/${host_mirror_path}"
|
|
||||||
mount -o remount,ro,bind "${working_dir}/${host_mirror_path}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local cache_dir_first=true
|
bind_mount "${cache_dirs[0]}"
|
||||||
for cache_dir in ${cache_dirs[@]}; do
|
for cache_dir in ${cache_dirs[@]:1}; do
|
||||||
[[ -e $cache_dir ]] || mkdir -p "${cache_dir}"
|
bind_mount "$cache_dir" ro
|
||||||
[[ -e "${working_dir}/${cache_dir}" ]] || mkdir -p "${working_dir}/${cache_dir}"
|
|
||||||
mount -o bind "${cache_dir}" "${working_dir}/${cache_dir}"
|
|
||||||
if ! ${cache_dir_first}; then
|
|
||||||
mount -o remount,ro,bind "${working_dir}/${cache_dir}"
|
|
||||||
else
|
|
||||||
cache_dir_first=false
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +160,8 @@ copy_hostconf () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trap_chroot_umount () {
|
trap_chroot_umount () {
|
||||||
trap 'trap_exit' EXIT INT QUIT TERM HUP
|
trap 'trap_abort' INT QUIT TERM HUP
|
||||||
|
trap 'trap_exit' EXIT
|
||||||
|
|
||||||
for cache_dir in ${cache_dirs[@]}; do
|
for cache_dir in ${cache_dirs[@]}; do
|
||||||
umount "${working_dir}/${cache_dir}"
|
umount "${working_dir}/${cache_dir}"
|
||||||
@@ -168,7 +169,7 @@ trap_chroot_umount () {
|
|||||||
[[ -n $host_mirror_path ]] && umount "${working_dir}/${host_mirror_path}"
|
[[ -n $host_mirror_path ]] && umount "${working_dir}/${host_mirror_path}"
|
||||||
|
|
||||||
if (( ! have_nspawn )); then
|
if (( ! have_nspawn )); then
|
||||||
for host_config in resolv.conf timezone localtime; do
|
for host_config in resolv.conf localtime; do
|
||||||
umount "${working_dir}/etc/${host_config}"
|
umount "${working_dir}/etc/${host_config}"
|
||||||
done
|
done
|
||||||
umount "${working_dir}/proc/sys"
|
umount "${working_dir}/proc/sys"
|
||||||
|
Reference in New Issue
Block a user