mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 01:46:19 +02:00
Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
80d0aa8912 | ||
![]() |
0dec86c4c3 | ||
![]() |
182c12ec4a | ||
![]() |
4c56be5601 | ||
![]() |
17ecb862f2 | ||
![]() |
6805bc54f4 | ||
![]() |
b54ddd2cf4 | ||
![]() |
0b36e8ecb3 | ||
![]() |
f71a0fabb7 | ||
![]() |
718a6d802d | ||
![]() |
bd6a5df0ab | ||
![]() |
ba6e6648e9 | ||
![]() |
d01f3d53e8 | ||
![]() |
fd04791f5b | ||
![]() |
38dc2efcd5 | ||
![]() |
a78c8f2cb9 | ||
![]() |
7c3bb0642a | ||
![]() |
8842f31551 | ||
![]() |
e76a1b2def | ||
![]() |
e8490b3f14 | ||
![]() |
ff1fc799c3 |
7
Makefile
7
Makefile
@@ -8,6 +8,10 @@ install:
|
|||||||
ln -sf extrapkg $(DESTDIR)/usr/bin/corepkg
|
ln -sf extrapkg $(DESTDIR)/usr/bin/corepkg
|
||||||
ln -sf extrapkg $(DESTDIR)/usr/bin/testingpkg
|
ln -sf extrapkg $(DESTDIR)/usr/bin/testingpkg
|
||||||
ln -sf extrapkg $(DESTDIR)/usr/bin/unstablepkg
|
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
|
# new chroot tools, only usable by root
|
||||||
mkdir -p $(DESTDIR)/usr/sbin
|
mkdir -p $(DESTDIR)/usr/sbin
|
||||||
install -m 755 mkarchroot $(DESTDIR)/usr/sbin
|
install -m 755 mkarchroot $(DESTDIR)/usr/sbin
|
||||||
@@ -27,3 +31,6 @@ uninstall:
|
|||||||
rm $(DESTDIR)/usr/sbin/makechrootpkg
|
rm $(DESTDIR)/usr/sbin/makechrootpkg
|
||||||
rm $(DESTDIR)/usr/bin/lddd
|
rm $(DESTDIR)/usr/bin/lddd
|
||||||
rm $(DESTDIR)/usr/bin/finddeps
|
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
|
26
extrapkg
26
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
|
||||||
@@ -40,19 +45,14 @@ fi
|
|||||||
|
|
||||||
if [ "$cmd" == "extrapkg" ]; then
|
if [ "$cmd" == "extrapkg" ]; then
|
||||||
repo="extra"
|
repo="extra"
|
||||||
tag="CURRENT"
|
|
||||||
elif [ "$cmd" == "corepkg" ]; then
|
elif [ "$cmd" == "corepkg" ]; then
|
||||||
repo="core"
|
repo="core"
|
||||||
tag="CURRENT"
|
|
||||||
elif [ "$cmd" == "testingpkg" ]; then
|
elif [ "$cmd" == "testingpkg" ]; then
|
||||||
repo="testing"
|
repo="testing"
|
||||||
tag="TESTING"
|
|
||||||
elif [ "$cmd" == "unstablepkg" ]; then
|
elif [ "$cmd" == "unstablepkg" ]; then
|
||||||
repo="unstable"
|
repo="unstable"
|
||||||
tag="CURRENT"
|
|
||||||
elif [ "$cmd" == "communitypkg" ]; then
|
elif [ "$cmd" == "communitypkg" ]; then
|
||||||
repo="community"
|
repo="community"
|
||||||
tag="CURRENT"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# see if any limit options were passed, we'll send them to SCP
|
# see if any limit options were passed, we'll send them to SCP
|
||||||
@@ -63,8 +63,10 @@ if [ "$1" = "-l" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$repo" != "community" ]; then
|
if [ "$repo" != "community" ]; then
|
||||||
scp ${scpopts} ${pkgfile} archlinux.org:staging/$repo/add/$(basename ${pkgfile})
|
# combine what we know into a variable
|
||||||
if [ "$(md5sum ${pkgfile} | cut -d' ' -f1)" != "$(ssh archlinux.org md5sum staging/${repo}/add/$(basename ${pkgfile}) | cut -d' ' -f1)" ]; then
|
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."
|
echo "File got corrupted during upload, cancelled."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
@@ -76,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
|
||||||
@@ -89,7 +91,7 @@ fi
|
|||||||
echo "===> Uploaded $pkgfile"
|
echo "===> Uploaded $pkgfile"
|
||||||
|
|
||||||
if [ "$1" != "" ]; then
|
if [ "$1" != "" ]; then
|
||||||
cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel
|
svn commit -m "upgpkg: $pkgname $pkgver-$pkgrel
|
||||||
$1" > /dev/null
|
$1" > /dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Cancelled"
|
echo "Cancelled"
|
||||||
@@ -98,7 +100,7 @@ if [ "$1" != "" ]; then
|
|||||||
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel
|
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel
|
||||||
$1\" message"
|
$1\" message"
|
||||||
else
|
else
|
||||||
cvs commit -m "upgpkg: $pkgname $pkgver-$pkgrel" > /dev/null
|
svn commit -m "upgpkg: $pkgname $pkgver-$pkgrel" > /dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Cancelled"
|
echo "Cancelled"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -106,11 +108,11 @@ else
|
|||||||
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel\" message"
|
echo "===> Commited with \"upgpkg: $pkgname $pkgver-$pkgrel\" message"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cvs tag -c -F -R $tag > /dev/null
|
archrelease $repo-$CARCH
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Cancelled"
|
echo "Cancelled"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "===> Tagged as $tag"
|
echo "===> Tagged for $repo-$CARCH"
|
||||||
|
|
||||||
# vim:ft=sh:ts=4:sw=4:et:
|
# vim:ft=sh:ts=4:sw=4:et:
|
||||||
|
@@ -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" ;;
|
||||||
@@ -107,13 +109,24 @@ echo "building union chroot"
|
|||||||
grep -Fq unionfs /proc/filesystems
|
grep -Fq unionfs /proc/filesystems
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
modprobe -q unionfs
|
modprobe -q unionfs
|
||||||
if [ $? -ne 0 ];
|
if [ $? -ne 0 ]; then
|
||||||
echo "ERROR: No unionfs available. Abandon ship!" && exit 1
|
echo "ERROR: No unionfs available. Abandon ship!" && exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
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
|
||||||
@@ -180,6 +198,7 @@ fi
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export LANG=$LOCALE
|
export LANG=$LOCALE
|
||||||
cd /build
|
cd /build
|
||||||
|
export HOME=/build
|
||||||
sudo -u nobody makepkg $MAKEPKG_ARGS || touch BUILD_FAILED
|
sudo -u nobody makepkg $MAKEPKG_ARGS || touch BUILD_FAILED
|
||||||
EOF
|
EOF
|
||||||
) > "$uniondir/chrootbuild"
|
) > "$uniondir/chrootbuild"
|
||||||
@@ -187,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