mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 01:46:19 +02:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
80d0aa8912 | ||
![]() |
0dec86c4c3 | ||
![]() |
182c12ec4a | ||
![]() |
4c56be5601 | ||
![]() |
17ecb862f2 | ||
![]() |
6805bc54f4 | ||
![]() |
b54ddd2cf4 | ||
![]() |
0b36e8ecb3 | ||
![]() |
f71a0fabb7 | ||
![]() |
718a6d802d | ||
![]() |
bd6a5df0ab | ||
![]() |
ba6e6648e9 | ||
![]() |
d01f3d53e8 | ||
![]() |
fd04791f5b |
49
archrelease
49
archrelease
@@ -1,19 +1,48 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "$1" = "" ]; then
|
if [ "$1" = "" ]; then
|
||||||
echo "Usage: archrelease <repo>"
|
echo "Usage: archrelease <repo>"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "PKGBUILD" ]; then
|
||||||
|
echo "archrelease: PKGBUILD not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$(basename $(readlink -f .))" != "trunk" ]; then
|
||||||
|
echo "archrelease: Not in a package trunk dir"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d ../repos/$1 ]; then
|
if [ ! -d ../repos/$1 ]; then
|
||||||
pushd ..
|
pushd ..
|
||||||
svn copy trunk ../repos/$1
|
[ -d repos ] || mkdir repos
|
||||||
popd
|
svn copy -r HEAD trunk repos/$1
|
||||||
|
svn commit -m "archrelease: new repo $1"
|
||||||
|
pushd repos/$1
|
||||||
|
svnmerge init
|
||||||
|
svn commit -F svnmerge-commit-message.txt
|
||||||
|
rm svnmerge-commit-message.txt
|
||||||
|
popd
|
||||||
|
popd
|
||||||
else
|
else
|
||||||
svnmerge merge ../repos/$1
|
svnmerge merge ../repos/$1
|
||||||
|
pushd ..
|
||||||
|
if [ -f trunk/svnmerge-commit-message.txt ]; then
|
||||||
|
svn commit -F trunk/svnmerge-commit-message.txt
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
# The user is going to have to clean things up a bit
|
||||||
|
echo "*** ATTENTION: There was a problem merging the package changes ***"
|
||||||
|
echo "To fix it, edit the conflicting files in repos/$1 (the ones that are C in svn status)."
|
||||||
|
echo "Once you have resolved conflicts, execute 'svn resolved <path to file>' to tell svn the error was resolved."
|
||||||
|
echo "Then to finish the merge commit, execute 'svn commit -F trunk/svnmerge-commit-message.txt' and, if there are no problems, delete trunk/svnmerge-commit-message.txt"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
rm trunk/svnmerge-commit-message.txt
|
||||||
|
else
|
||||||
|
echo "Nothing to commit"
|
||||||
|
fi
|
||||||
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pushd ..
|
|
||||||
svn commit -F trunk/svnmerge-commit-message.txt
|
|
||||||
popd
|
|
||||||
rm svnmerge-commit-message.txt
|
|
||||||
|
11
extrapkg
11
extrapkg
@@ -20,6 +20,11 @@ if [ ! -f PKGBUILD ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$CARCH" ]; then
|
||||||
|
echo "CARCH must be set to a recognized value!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
source PKGBUILD
|
source PKGBUILD
|
||||||
pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}.pkg.tar.gz
|
pkgfile=${pkgname}-${pkgver}-${pkgrel}-${CARCH}.pkg.tar.gz
|
||||||
oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
oldstylepkgfile=${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
||||||
@@ -58,8 +63,8 @@ if [ "$1" = "-l" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$repo" != "community" ]; then
|
if [ "$repo" != "community" ]; then
|
||||||
# combine what we know into a variable (suffix defined based on $CARCH)
|
# combine what we know into a variable
|
||||||
uploadto="staging/${repo}${suffix}/add/$(basename ${pkgfile})"
|
uploadto="staging/${repo}/add/$(basename ${pkgfile})"
|
||||||
scp ${scpopts} "${pkgfile}" "archlinux.org:${uploadto}"
|
scp ${scpopts} "${pkgfile}" "archlinux.org:${uploadto}"
|
||||||
if [ "$(md5sum "${pkgfile}" | cut -d' ' -f1)" != "$(ssh archlinux.org md5sum "${uploadto}" | cut -d' ' -f1)" ]; then
|
if [ "$(md5sum "${pkgfile}" | cut -d' ' -f1)" != "$(ssh archlinux.org md5sum "${uploadto}" | cut -d' ' -f1)" ]; then
|
||||||
echo "File got corrupted during upload, cancelled."
|
echo "File got corrupted during upload, cancelled."
|
||||||
@@ -73,7 +78,7 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "$(basename $pkgfile)" != "$(basename $oldstylepkgfile)" ]; then
|
if [ "$(basename $pkgfile)" != "$(basename $oldstylepkgfile)" ]; then
|
||||||
echo "Renaming makepkg3 package for compatability"
|
echo "Renaming makepkg3 package for compatibility"
|
||||||
mv $pkgfile $oldstylepkgfile
|
mv $pkgfile $oldstylepkgfile
|
||||||
pkgfile=$oldstylepkgfile
|
pkgfile=$oldstylepkgfile
|
||||||
fi
|
fi
|
||||||
|
@@ -14,6 +14,7 @@ MAKEPKG_ARGS="-sr"
|
|||||||
REPACK=""
|
REPACK=""
|
||||||
WORKDIR=$PWD
|
WORKDIR=$PWD
|
||||||
clean_first="0"
|
clean_first="0"
|
||||||
|
install_pkg=""
|
||||||
|
|
||||||
chrootdir="$CHROOT_SHELL"
|
chrootdir="$CHROOT_SHELL"
|
||||||
|
|
||||||
@@ -45,9 +46,10 @@ usage ()
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts ':r:h:c' arg; do
|
while getopts ':r:i:h:c' arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
r) chrootdir="$OPTARG" ;;
|
r) chrootdir="$OPTARG" ;;
|
||||||
|
i) install_pkg="$OPTARG" ;;
|
||||||
c) clean_first=1 ;;
|
c) clean_first=1 ;;
|
||||||
h|?) usage ;;
|
h|?) usage ;;
|
||||||
*) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;;
|
*) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;;
|
||||||
@@ -114,6 +116,17 @@ fi
|
|||||||
mount -t unionfs none -o "dirs=$chrootdir/rw=rw:$chrootdir/root=ro" "$uniondir"
|
mount -t unionfs none -o "dirs=$chrootdir/rw=rw:$chrootdir/root=ro" "$uniondir"
|
||||||
trap 'cleanup' 0 1 2 15
|
trap 'cleanup' 0 1 2 15
|
||||||
|
|
||||||
|
if [ -n "$install_pkg" ]; then
|
||||||
|
pkgname="$(basename "$install_pkg")"
|
||||||
|
echo "installing '$pkgname' in chroot"
|
||||||
|
cp "$install_pkg" "$uniondir/$pkgname"
|
||||||
|
mkarchroot -r "pacman -U /$pkgname" "$uniondir"
|
||||||
|
ret=$?
|
||||||
|
rm "$uniondir/$pkgname"
|
||||||
|
#exit early, we've done all we need to
|
||||||
|
exit $ret
|
||||||
|
fi
|
||||||
|
|
||||||
echo "moving build files to chroot"
|
echo "moving build files to chroot"
|
||||||
[ -d "$uniondir/build" ] || mkdir "$uniondir/build"
|
[ -d "$uniondir/build" ] || mkdir "$uniondir/build"
|
||||||
|
|
||||||
@@ -168,8 +181,13 @@ if [ "$install" != "" -a -f "$install" ]; then
|
|||||||
cp "$install" "$uniondir/build/"
|
cp "$install" "$uniondir/build/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f "ChangeLog" ]; then
|
||||||
|
cp ChangeLog "$uniondir/build/"
|
||||||
|
fi
|
||||||
|
|
||||||
if ! grep "^nobody" "$uniondir/etc/sudoers" >/dev/null 2>&1; then
|
if ! grep "^nobody" "$uniondir/etc/sudoers" >/dev/null 2>&1; then
|
||||||
echo "allowing 'nobody' sudo rights in the chroot"
|
echo "allowing 'nobody' sudo rights in the chroot"
|
||||||
|
touch "$uniondir/etc/sudoers"
|
||||||
echo "nobody ALL=(ALL) NOPASSWD: ALL" >> "$uniondir/etc/sudoers"
|
echo "nobody ALL=(ALL) NOPASSWD: ALL" >> "$uniondir/etc/sudoers"
|
||||||
chmod 440 "$uniondir/etc/sudoers"
|
chmod 440 "$uniondir/etc/sudoers"
|
||||||
fi
|
fi
|
||||||
@@ -188,22 +206,23 @@ chmod +x "$uniondir/chrootbuild"
|
|||||||
|
|
||||||
mkarchroot -r "/chrootbuild" "$uniondir"
|
mkarchroot -r "/chrootbuild" "$uniondir"
|
||||||
|
|
||||||
|
source ${WORKDIR}/PKGBUILD
|
||||||
|
if [ -z "$(mount | grep ${chrootdir}/union/pkgdest)" ]; then
|
||||||
|
echo "Moving completed package file to ${WORKDIR}"
|
||||||
|
mv ${chrootdir}/union/pkgdest/${pkgname}-${pkgver}-${pkgrel}-*.pkg.tar.gz ${WORKDIR}
|
||||||
|
fi
|
||||||
|
if [ -z "$(mount | grep ${chrootdir}/union/srcdest)" ]; then
|
||||||
|
echo "Moving downloaded source files to ${WORKDIR}"
|
||||||
|
mv ${chrootdir}/union/srcdest/* ${WORKDIR}
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -e ${chrootdir}/rw/build/BUILD_FAILED ]; then
|
if [ -e ${chrootdir}/rw/build/BUILD_FAILED ]; then
|
||||||
echo "Build failed, check \$CHROOT_DIR/rw/build"
|
echo "Build failed, check \$CHROOT_DIR/rw/build"
|
||||||
rm ${chrootdir}/rw/build/BUILD_FAILED
|
rm ${chrootdir}/rw/build/BUILD_FAILED
|
||||||
exit 1
|
else
|
||||||
else
|
|
||||||
source ${WORKDIR}/PKGBUILD
|
|
||||||
if [ -z "$(mount | grep ${chrootdir}/union/pkgdest)" ]; then
|
|
||||||
echo "Moving completed package file to ${WORKDIR}"
|
|
||||||
mv ${chrootdir}/union/pkgdest/${pkgname}-${pkgver}-${pkgrel}-*.pkg.tar.gz ${WORKDIR}
|
|
||||||
fi
|
|
||||||
if [ -z "$(mount | grep ${chrootdir}/union/srcdest)" ]; then
|
|
||||||
echo "Moving downloaded source files to ${WORKDIR}"
|
|
||||||
mv ${chrootdir}/union/srcdest/* ${WORKDIR}
|
|
||||||
fi
|
|
||||||
rm -rf ${chrootdir}/rw/build/*
|
rm -rf ${chrootdir}/rw/build/*
|
||||||
echo "Build complete"
|
echo "Build complete"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# vim:ft=sh:ts=4:sw=4:et:
|
# vim:ft=sh:ts=4:sw=4:et:
|
||||||
|
Reference in New Issue
Block a user