diff options
Diffstat (limited to 'build_tools/bin')
-rw-r--r-- | build_tools/bin/chrootrc.sh | 12 | ||||
-rw-r--r-- | build_tools/bin/km-down.prf | 7 | ||||
-rw-r--r-- | build_tools/bin/km-up.prf | 6 | ||||
-rwxr-xr-x | build_tools/bin/kmsync.sh | 96 | ||||
-rwxr-xr-x | build_tools/bin/mp | 67 | ||||
l--------- | build_tools/bin/mpr | 1 | ||||
-rwxr-xr-x | build_tools/bin/update_db_repo.sh | 21 | ||||
-rw-r--r-- | build_tools/bin/world.sh | 43 |
8 files changed, 253 insertions, 0 deletions
diff --git a/build_tools/bin/chrootrc.sh b/build_tools/bin/chrootrc.sh new file mode 100644 index 0000000..291cc52 --- /dev/null +++ b/build_tools/bin/chrootrc.sh @@ -0,0 +1,12 @@ +mount /dev/pts +export BHOME=/build_tools +export HOME=/root +. /etc/profile +. /etc/bashrc +export PATH=$PATH:$BHOME/bin:$BHOME/bld/bin +export PS1='[\u@kmbuild \W]\$' +cd $BHOME +if [ -f /root/loginrun.sh ] +then + /root/loginrun.sh +fi diff --git a/build_tools/bin/km-down.prf b/build_tools/bin/km-down.prf new file mode 100644 index 0000000..98dfe25 --- /dev/null +++ b/build_tools/bin/km-down.prf @@ -0,0 +1,7 @@ + ignore = Name temp.* + ignore = Name *~ + ignore = Name .*~ + ignore = Name *.o + ignore = Name *.tmp + ignore = Name *.db.tar.gz.old + ignore = Name *.db.tar.gz diff --git a/build_tools/bin/km-up.prf b/build_tools/bin/km-up.prf new file mode 100644 index 0000000..9fa6ce4 --- /dev/null +++ b/build_tools/bin/km-up.prf @@ -0,0 +1,6 @@ + ignore = Name temp.* + ignore = Name *~ + ignore = Name .*~ + ignore = Name *.o + ignore = Name *.tmp + ignore = Name *.db.tar.gz.old diff --git a/build_tools/bin/kmsync.sh b/build_tools/bin/kmsync.sh new file mode 100755 index 0000000..6506b56 --- /dev/null +++ b/build_tools/bin/kmsync.sh @@ -0,0 +1,96 @@ +#!/bin/bash +#This script will create and synchronize a local package mirror with the repository (as defined below) on knoppmyth.net, it will also update the database. +#This script uses a shared account on knoppmyth.net. DO NOT change the account name +# and dont' ask for the password, instead setup ssh keys. +# + + +if [ -e /etc/makepkg.conf ] +then + . /etc/makepkg.conf +else + echo "couldn't find /etc/makepkg.conf" +fi +cwd=`dirname $0` +REMOTE_DIR=/mount/repository/repo +DOCROOT=/data/pkg_repo/$CARCH + +#export UNISON="/root/.unison" +export UNISON="/data/pkg_repo/.unison" + +function sync_dirs { + REMOTE=$1 + LOCAL=$2 + + echo " Updating $3 " + echo "________________________________________________________" + + #first bring down new changes from knoppmyth.net + unison km-down -terse -logfile /tmp/unison-down.log -auto -batch -numericids ssh://reposync@knoppmyth.net/$REMOTE $LOCAL + if [ ! $? = 0 ] + then + echo "#######################################################" + echo "## ERRORS OCCURED ##" + echo "#######################################################" + exit 1 + + fi + #update the local database + update_db_repo.sh $LOCAL $3 + + #push the database back + unison km-up -logfile /tmp/unison-up.log -auto -batch -numericids ssh://reposync@knoppmyth.net/$REMOTE $LOCAL + echo "-------------------------------------------------------" + echo "----------- Finished with $3 -----------" + echo "-------------------------------------------------------" + + + + +} +#--------------------------------------------------------------- +if [ ! -d $UNISON ] +then + mkdir $UNISON +fi + +if [ ! -f $UNISON/km-down.prf ] +then + cp -f $cwd/km-down.prf $UNISON/ +fi + +if [ ! -f $UNISON/km-up.prf ] +then + cp -f $cwd/km-up.prf $UNISON/ +fi + + + +clear +case $1 in + testing) + #sync_dirs $REMOTE $LOCAL + sync_dirs $REMOTE_DIR/$CARCH/core-testing $DOCROOT/core-testing core-testing + sync_dirs $REMOTE_DIR/$CARCH/extra-testing $DOCROOT/extra-testing extra-testing + ;; + + release) + sync_dirs $REMOTE_DIR/$CARCH/core $DOCROOT/core core + sync_dirs $REMOTE_DIR/$CARCH/extra $DOCROOT/extra extra + ;; + + chroot-devel) + echo "will update chroot-devel" + sync_dirs $REMOTE_DIR/$CARCH/chroot-devel $DOCROOT/chroot-devel chroot-devel + ;; + *) + echo "invalid options" + echo "kmsync.sh (testing|release|chroot-devel) " + echo + echo "EX: kmsync.sh testing <= will sync the testing repo with km.net update the local database and resync with km.net" + #echo "kmsync.sh testing oneway <= will syncthe testing repo with km.net update the local database" + + ;; +esac +echo "Finished." +# End diff --git a/build_tools/bin/mp b/build_tools/bin/mp new file mode 100755 index 0000000..c69c622 --- /dev/null +++ b/build_tools/bin/mp @@ -0,0 +1,67 @@ +#!/bin/bash +# Used to compile a package and copy it to the correct repository location. +# all arguments are passed to makepkg +# +# +. /etc/makepkg.conf +. PKGBUILD +PKGHOME=/data/pkg_repo/packages +mydir=`pwd` +TOTALPKG="$pkgname"-"$pkgver"-"$pkgrel"-"$CARCH".pkg.tar.gz + + +if [ x`basename $0` = xmpr ] +then + PFIX="" +else + PFIX="-testing" +fi + + + + +function find_repo { + echo $mydir|grep -q "extra" + if [ $? = 0 ] + then + REPO=extra${PFIX} + else + REPO=core${PFIX} + fi + DOCROOT=/data/pkg_repo/$CARCH/$REPO +} + + +function update-repo { + + + cd $DOCROOT + echo + echo "DOCROOT=$DOCROOT" + echo + #remove old package from local copy + DELPKG="$pkgname"-"$pkgver"-*-"$CARCH".pkg.tar.gz + #echo $DOCROOT + #echo $DELPKG + echo "Removing old packages from:" + rm -fvI $DELPKG + #copy in new package + echo + echo "Updating $CARCH/$REPO with $TOTALPKG" + cp -f $PKGDEST/$TOTALPKG . + repo-add $DOCROOT/$REPO.db.tar.gz $DOCROOT/$TOTALPKG + cd - + +} + + + + + + +find_repo + +makepkg --holdver --asroot $@ || exit 1 +echo "---------updating database ----------" +update-repo #&& pacman -Sy + diff --git a/build_tools/bin/mpr b/build_tools/bin/mpr new file mode 120000 index 0000000..691afc3 --- /dev/null +++ b/build_tools/bin/mpr @@ -0,0 +1 @@ +mp
\ No newline at end of file diff --git a/build_tools/bin/update_db_repo.sh b/build_tools/bin/update_db_repo.sh new file mode 100755 index 0000000..27a594b --- /dev/null +++ b/build_tools/bin/update_db_repo.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# tiny util to regenreate the databse on the LOCAL machine +# called with + +if [ $# -ne 2 ] +then + echo "incorrect number of args" + echo "update_db_repo directory repo" + echo "EX: update_db_repo /data/local/pkg_repo/i686/core-testing core-testing" + exit 1 +fi + + +cd $1 +REPO=$2 +echo " --------------------------" +echo "updating database for $REPO" +echo " --------------------------" +pwd + repo-add -q $REPO.db.tar.gz *.pkg.tar.gz +cd - diff --git a/build_tools/bin/world.sh b/build_tools/bin/world.sh new file mode 100644 index 0000000..c8c6169 --- /dev/null +++ b/build_tools/bin/world.sh @@ -0,0 +1,43 @@ +#!/bin/bash +a="dont_do_anything_" +if [ x = x$a ] +then +#increment all pkgrel +for i in `find -name PKGBUILD`;do + + #getting pkgrel number after = + package_pkgrel=`cat $i | grep pkgrel= | cut -d'=' -f 2` + + #extract number before dot in pkgrel + beforedot=`echo $package_pkgrel | cut -n -d'.' -f 1` + + #add 1 to pkgrel + new_pkgrel=$[$beforedot+1] + + #write it back to PKGBUILD + sed -i "s:pkgrel=${package_pkgrel}:pkgrel=${new_pkgrel}:g" $i +done +fi +find ./ -name "src" -exec rm -rf {} \; + + +#packages to remove +if [ x = x$a ] +then + pacman -R --nodeps klibc + pacman -R --nodeps klibc-extras + pacman -R --nodeps klibc-kbd + pacman -R --nodeps klibc-module-init-tools + pacman -R --nodeps klibc-udev + pacman -R --nodeps heimdal +fi + + +#build base +cd /build/r6-src-jm +#makeworld -f --asroot -s -r -i --noconfirm -c -f /home/packages local +makeworld -f --asroot -s -r --noconfirm -c -f /home/packages local +cd - +cd /home/packages +repo-add r6-testing.db.tar.gz * +cd - |