mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 01:46:19 +02:00
Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
80d0aa8912 | ||
![]() |
0dec86c4c3 | ||
![]() |
182c12ec4a | ||
![]() |
4c56be5601 | ||
![]() |
17ecb862f2 | ||
![]() |
6805bc54f4 | ||
![]() |
b54ddd2cf4 | ||
![]() |
0b36e8ecb3 | ||
![]() |
f71a0fabb7 | ||
![]() |
718a6d802d | ||
![]() |
bd6a5df0ab | ||
![]() |
ba6e6648e9 | ||
![]() |
d01f3d53e8 | ||
![]() |
fd04791f5b | ||
![]() |
38dc2efcd5 | ||
![]() |
a78c8f2cb9 | ||
![]() |
7c3bb0642a | ||
![]() |
8842f31551 | ||
![]() |
e76a1b2def |
7
Makefile
7
Makefile
@@ -8,6 +8,10 @@ install:
|
||||
ln -sf extrapkg $(DESTDIR)/usr/bin/corepkg
|
||||
ln -sf extrapkg $(DESTDIR)/usr/bin/testingpkg
|
||||
ln -sf extrapkg $(DESTDIR)/usr/bin/unstablepkg
|
||||
# arch{co,release,rm}
|
||||
install -m 755 archco $(DESTDIR)/usr/bin
|
||||
install -m 755 archrelease $(DESTDIR)/usr/bin
|
||||
install -m 755 archrm $(DESTDIR)/usr/bin
|
||||
# new chroot tools, only usable by root
|
||||
mkdir -p $(DESTDIR)/usr/sbin
|
||||
install -m 755 mkarchroot $(DESTDIR)/usr/sbin
|
||||
@@ -27,3 +31,6 @@ uninstall:
|
||||
rm $(DESTDIR)/usr/sbin/makechrootpkg
|
||||
rm $(DESTDIR)/usr/bin/lddd
|
||||
rm $(DESTDIR)/usr/bin/finddeps
|
||||
rm $(DESTDIR)/usr/bin/archco
|
||||
rm $(DESTDIR)/usr/bin/archrelease
|
||||
rm $(DESTDIR)/usr/bin/archrm
|
||||
|
10
archco
Executable file
10
archco
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
echo "Usage: archco <package name> [<package name>]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for i in "$@"; do
|
||||
svn co svn+ssh://svn.archlinux.org/home/svn-packages/$i
|
||||
done
|
48
archrelease
Executable file
48
archrelease
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
echo "Usage: archrelease <repo>"
|
||||
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
|
||||
|
||||
if [ ! -d ../repos/$1 ]; then
|
||||
pushd ..
|
||||
[ -d repos ] || mkdir repos
|
||||
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
|
||||
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
|
||||
|
13
archrm
Executable file
13
archrm
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
echo "Usage: archrm <path to checkout>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# FIXME: Check if there are uncommited changes
|
||||
#pushd $1
|
||||
#
|
||||
#popd
|
||||
|
||||
rm -rf $1
|
30
extrapkg
30
extrapkg
@@ -20,16 +20,7 @@ if [ ! -f PKGBUILD ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# define tags and staging areas based on architecture
|
||||
if [ "$CARCH" = "i686" ]; then
|
||||
currenttag='CURRENT'
|
||||
testingtag='TESTING'
|
||||
suffix=''
|
||||
elif [ "$CARCH" = "x86_64" ]; then
|
||||
currenttag='CURRENT-64'
|
||||
testingtag='TESTING-64'
|
||||
suffix='64'
|
||||
else
|
||||
if [ -z "$CARCH" ]; then
|
||||
echo "CARCH must be set to a recognized value!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -54,19 +45,14 @@ fi
|
||||
|
||||
if [ "$cmd" == "extrapkg" ]; then
|
||||
repo="extra"
|
||||
tag="$currenttag"
|
||||
elif [ "$cmd" == "corepkg" ]; then
|
||||
repo="core"
|
||||
tag="$currenttag"
|
||||
elif [ "$cmd" == "testingpkg" ]; then
|
||||
repo="testing"
|
||||
tag="$testingtag"
|
||||
elif [ "$cmd" == "unstablepkg" ]; then
|
||||
repo="unstable"
|
||||
tag="$currenttag"
|
||||
elif [ "$cmd" == "communitypkg" ]; then
|
||||
repo="community"
|
||||
tag="$currenttag"
|
||||
fi
|
||||
|
||||
# see if any limit options were passed, we'll send them to SCP
|
||||
@@ -77,8 +63,8 @@ if [ "$1" = "-l" ]; then
|
||||
fi
|
||||
|
||||
if [ "$repo" != "community" ]; then
|
||||
# combine what we know into a variable (suffix defined based on $CARCH)
|
||||
uploadto="staging/${repo}${suffix}/add/$(basename ${pkgfile})"
|
||||
# combine what we know into a variable
|
||||
uploadto="staging/${repo}/add/$(basename ${pkgfile})"
|
||||
scp ${scpopts} "${pkgfile}" "archlinux.org:${uploadto}"
|
||||
if [ "$(md5sum "${pkgfile}" | cut -d' ' -f1)" != "$(ssh archlinux.org md5sum "${uploadto}" | cut -d' ' -f1)" ]; then
|
||||
echo "File got corrupted during upload, cancelled."
|
||||
@@ -92,7 +78,7 @@ else
|
||||
exit 1
|
||||
fi
|
||||
if [ "$(basename $pkgfile)" != "$(basename $oldstylepkgfile)" ]; then
|
||||
echo "Renaming makepkg3 package for compatability"
|
||||
echo "Renaming makepkg3 package for compatibility"
|
||||
mv $pkgfile $oldstylepkgfile
|
||||
pkgfile=$oldstylepkgfile
|
||||
fi
|
||||
@@ -105,7 +91,7 @@ fi
|
||||
echo "===> Uploaded $pkgfile"
|
||||
|
||||
if [ "$1" != "" ]; then
|
||||
cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel
|
||||
svn commit -m "upgpkg: $pkgname $pkgver-$pkgrel
|
||||
$1" > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cancelled"
|
||||
@@ -114,7 +100,7 @@ if [ "$1" != "" ]; then
|
||||
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel
|
||||
$1\" message"
|
||||
else
|
||||
cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel" > /dev/null
|
||||
svn commit -m "upgpkg: $pkgname $pkgver-$pkgrel" > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cancelled"
|
||||
exit 1
|
||||
@@ -122,11 +108,11 @@ else
|
||||
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel\" message"
|
||||
fi
|
||||
|
||||
cvs tag -c -F -R $tag > /dev/null
|
||||
archrelease $repo-$CARCH
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cancelled"
|
||||
exit 1
|
||||
fi
|
||||
echo "===> Tagged as $tag"
|
||||
echo "===> Tagged for $repo-$CARCH"
|
||||
|
||||
# vim:ft=sh:ts=4:sw=4:et:
|
||||
|
@@ -14,6 +14,7 @@ MAKEPKG_ARGS="-sr"
|
||||
REPACK=""
|
||||
WORKDIR=$PWD
|
||||
clean_first="0"
|
||||
install_pkg=""
|
||||
|
||||
chrootdir="$CHROOT_SHELL"
|
||||
|
||||
@@ -45,9 +46,10 @@ usage ()
|
||||
exit 1
|
||||
}
|
||||
|
||||
while getopts ':r:h:c' arg; do
|
||||
while getopts ':r:i:h:c' arg; do
|
||||
case "${arg}" in
|
||||
r) chrootdir="$OPTARG" ;;
|
||||
i) install_pkg="$OPTARG" ;;
|
||||
c) clean_first=1 ;;
|
||||
h|?) usage ;;
|
||||
*) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;;
|
||||
@@ -114,6 +116,17 @@ fi
|
||||
mount -t unionfs none -o "dirs=$chrootdir/rw=rw:$chrootdir/root=ro" "$uniondir"
|
||||
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"
|
||||
[ -d "$uniondir/build" ] || mkdir "$uniondir/build"
|
||||
|
||||
@@ -168,8 +181,13 @@ if [ "$install" != "" -a -f "$install" ]; then
|
||||
cp "$install" "$uniondir/build/"
|
||||
fi
|
||||
|
||||
if [ -f "ChangeLog" ]; then
|
||||
cp ChangeLog "$uniondir/build/"
|
||||
fi
|
||||
|
||||
if ! grep "^nobody" "$uniondir/etc/sudoers" >/dev/null 2>&1; then
|
||||
echo "allowing 'nobody' sudo rights in the chroot"
|
||||
touch "$uniondir/etc/sudoers"
|
||||
echo "nobody ALL=(ALL) NOPASSWD: ALL" >> "$uniondir/etc/sudoers"
|
||||
chmod 440 "$uniondir/etc/sudoers"
|
||||
fi
|
||||
@@ -180,6 +198,7 @@ fi
|
||||
#!/bin/bash
|
||||
export LANG=$LOCALE
|
||||
cd /build
|
||||
export HOME=/build
|
||||
sudo -u nobody makepkg $MAKEPKG_ARGS || touch BUILD_FAILED
|
||||
EOF
|
||||
) > "$uniondir/chrootbuild"
|
||||
@@ -187,22 +206,23 @@ chmod +x "$uniondir/chrootbuild"
|
||||
|
||||
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
|
||||
echo "Build failed, check \$CHROOT_DIR/rw/build"
|
||||
rm ${chrootdir}/rw/build/BUILD_FAILED
|
||||
exit 1
|
||||
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
|
||||
else
|
||||
rm -rf ${chrootdir}/rw/build/*
|
||||
echo "Build complete"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# vim:ft=sh:ts=4:sw=4:et:
|
||||
|
Reference in New Issue
Block a user