Compare commits

...

21 Commits
0.5 ... 0.6.3

Author SHA1 Message Date
Thomas Bächler
80d0aa8912 Aaron broke it 2008-08-24 07:13:40 +02:00
Jason Chu
0dec86c4c3 Fix a typo in extrapkg 2008-05-10 11:05:20 -07:00
Aaron Griffin
182c12ec4a Remove suffix usage from extrapkg
The new dbscripts do not need this. All info can
be gathered from the $CARCH variable in the filename.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-05-06 18:31:19 -04:00
Aaron Griffin
4c56be5601 Allow makechrootpkg to install package files in the chroot
This is a very very hackish way to deal with rebuilds for
right now.

The intent is the following:
    First build foobar-1.2
    makechrootpkg -i foobar-1.2-1-i686.pkg.tar.gz
    Now build packages that depend on foobar-1.2

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-21 23:13:47 -05:00
Aaron Griffin
17ecb862f2 makechrootpkg: Always attempt to move pkg/src
Sometimes makepkg fails, but a package is built - for
instance, when makepkg cannot remove deps. In this case we
will attempt to move the pkg/src files regardless.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-21 22:56:58 -05:00
Aaron Griffin
6805bc54f4 Ensure archrelease is always run from a proper directory
It should only be run from a trunk dir containing a PKGBUILD

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-21 21:31:51 -05:00
Aaron Griffin
b54ddd2cf4 Create the 'repos' dir if it doesn't exist
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-21 21:25:41 -05:00
Jason Chu
0b36e8ecb3 Add a message that explains what to do when a merge conflict is detected and needs to be dealt with. 2008-04-20 13:30:00 -07:00
Travis Willard
f71a0fabb7 Copy ChangeLog into chroot too.
Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-14 11:19:33 -05:00
Aaron Griffin
718a6d802d Temporary workaround for unionfs issues
The latest incarnations of unionfs have issues appending
text via shell redirection, so to work around it, we can
touch the file before-hand to move it to the RW portion
of the union.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-14 11:18:09 -05:00
Jason Chu
bd6a5df0ab Start tracking svnmerge info when we create a branch
I thought it was tracked by default
2008-04-09 12:23:11 -07:00
Aaron Griffin
ba6e6648e9 Copy only the HEAD revision when releasing
This prevents the copying of local files and only
copies versioned files

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-08 01:53:18 -05:00
Aaron Griffin
d01f3d53e8 Add '64' suffix back to extrapkg
This was accidentally scrubbed, breaking 64bit uploads

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-08 01:48:43 -05:00
Aaron Griffin
fd04791f5b archrelease modifications to auto-commit handling
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-04-08 01:46:29 -05:00
Jason Chu
38dc2efcd5 Accept multiple package names to checkout with archco 2008-04-05 18:50:50 -07:00
Jason Chu
a78c8f2cb9 Fix a typo in archco -- now it has the proper url 2008-04-05 18:35:56 -07:00
Jason Chu
7c3bb0642a Update extrapkg to use svn & archrelease instead of cvs 2008-04-05 18:12:16 -07:00
Jason Chu
8842f31551 Add arch{co,release,rm} to devtools and make them install properly 2008-04-05 18:11:32 -07:00
Aaron Griffin
e76a1b2def Set $HOME before dropping permissions
Because we need a root user to chroot, when we drop
permissions to 'nobody', we're still using HOME=/root

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-03-17 12:55:24 -05:00
Simo Leone
e8490b3f14 Correcting an error in e0f139ad0e
If only you could have seen the facepalming going on...

Signed-off-by: Simo Leone <simo@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-07 23:42:32 -06:00
Dan McGee
ff1fc799c3 Add architecture-specific logic into extrapkg
This change will remove 4 needless sed lines from the PKGBUILD we use on
Arch for building this package and do the logic locally where it probably
makes more sense anyway. $CARCH should always be present as we fail if we
cannot find a correct makepkg.conf file in /etc/.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-06 22:15:34 -06:00
6 changed files with 126 additions and 26 deletions

View File

@@ -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
View 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
View 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
View 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

View File

@@ -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:

View File

@@ -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: