From 011e0bcb4e96415a454339b5f77f547360c4aa18 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Sun, 23 Mar 2014 04:29:15 +0400 Subject: [PATCH] added repo-update --- README.md | 1 + qtcurve/my.qtcurve | 2 +- repo-update | 84 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100755 repo-update diff --git a/README.md b/README.md index 84e50ba..3e8cce3 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Description * `kdmrc` - settings for KDM. It is stored as `/usr/share/config/kdm/kdmrc`. * `local.conf` - custom settings for fontconfig. It is stored as `/etc/fonts/local.conf` * `qtcurve` (directory) - custom settings for QtCurve (including colors). +* `repo-update` - simple script for building and updating own repository * `sakura.conf` - settings for [Sakura terminal](https://launchpad.net/sakura). It is stored in `$HOME/.config/sakura/`. * `vimrc` - settings for VIM. It is stored as `$HOME/.vimrc`. * `Xresources` - settings for some Xorg applications (for example, urxvt). It is stored as `$HOME/.Xresources` diff --git a/qtcurve/my.qtcurve b/qtcurve/my.qtcurve index f83466e..87a0d27 100644 --- a/qtcurve/my.qtcurve +++ b/qtcurve/my.qtcurve @@ -114,7 +114,7 @@ round=extra roundAllTabs=false roundMbTopOnly=true sbarBgndAppearance=flat -scrollbarType=kde +scrollbarType=none selectionAppearance=harsh shadeCheckRadio=none shadeMenubarOnlyWhenActive=false diff --git a/repo-update b/repo-update new file mode 100755 index 0000000..1551f1a --- /dev/null +++ b/repo-update @@ -0,0 +1,84 @@ +#!/bin/bash + +# variables +DBNAME="arcanisrepo" +PREPAREDIR="${HOME}/arch/prepare" +REPODIR="${HOME}/arch/repo" +ROOTDIR="${HOME}/arch/root" +STAGINGDIR="${HOME}/arch/staging" + +# functions +func_remove() { + DBPATH="$1" + PKGNAME="$2" + /usr/bin/repo-remove ${DBNAME}.db.tar.gz ${PKGNAME} + /usr/bin/repo-remove ${DBNAME}.files.tar.gz ${PKGNAME} + /usr/bin/rm -f ${PKGNAME}* +} +func_build() { + PREPARE="$1" + ROOT="$2" + if grep "arch=('any')" PKGBUILD -q; then + /usr/bin/sudo /usr/bin/staging-i686-build -r "${ROOT}" + else + /usr/bin/sudo /usr/bin/staging-i686-build -r "${ROOT}" + /usr/bin/sudo /usr/bin/staging-x86_64-build -r "${ROOT}" + fi + /usr/bin/cp *.pkg.tar.xz "${PREPARE}" +} + +# error checking +if [ ! -d "${PREPAREDIR}" ]; then + echo "Prepare directory does not exist" + exit 1 +fi +if [ ! -d "${REPODIR}" ] || [ ! -d "${REPODIR}/i686" ] || [ ! -d "${REPODIR}/x86_64" ]; then + echo "Repository directory does not exist" + exit 1 +fi +if [ ! -d "${STAGINGDIR}" ]; then + echo "Staging directory does not exist" + exit 1 +fi + +# building +/usr/bin/cd "${STAGINGDIR}" +/usr/bin/find -name PKGBUILD -type f -execdir func_build "${PREPAREDIR}" "${ROOTDIR}" \; + +# signing +/usr/bin/cd "${PREPAREDIR}" +for PACKAGE in $(/usr/bin/ls *.pkg.tar.xz); do + /usr/bin/gpg -b ${PACKAGE} +done + +# creating packages list +i686_PACKAGES=$(/usr/bin/ls *.pkg.tar.xz | /usr/bin/grep "i686\|any") +x86_64_PACKAGES=$(/usr/bin/ls *.pkg.tar.xz | /usr/bin/grep "x86_64\|any") +echo "i686 packages: ${i686_PACKAGES}" +echo "x86_64 packages: ${x86_64_PACKAGES}" + +# updating i686 repo +/usr/bin/cd "${REPODIR}/i686" +for PACKAGE in ${i686_PACKAGES}; do + PKGNAME=$(echo ${PACKAGE} | /usr/bin/awk -F '-' '{for(i=1; i<=NF-3;i++) {printf("%s-", $i);}}' | /usr/bin/sed 's/.$//') + /usr/bin/ls ${PKGNAME}* && func_remove "${DBNAME}" "${PKGNAME}" + /usr/bin/cp "${PREPAREDIR}/${PACKAGE}"{,.sig} . +done +/usr/bin/repo-add --new ${DBNAME}.db.tar.gz *.pkg.tar.xz +/usr/bin/repo-add --new --files ${DBNAME}.files.tar.gz *.pkg.tar.xz + +# updating x86_64 repo +/usr/bin/cd "${REPODIR}/x86_64" +for PACKAGE in ${x86_64_PACKAGES}; do + PKGNAME=$(echo ${PACKAGE} | /usr/bin/awk -F '-' '{for(i=1; i<=NF-3;i++) {printf("%s-", $i);}}' | /usr/bin/sed 's/.$//') + /usr/bin/ls ${PKGNAME}* && func_remove "${DBNAME}" "${PKGNAME}" + /usr/bin/cp "${PREPAREDIR}/${PACKAGE}"{,.sig} . +done +/usr/bin/repo-add --new ${DBNAME}.db.tar.gz *.pkg.tar.xz +/usr/bin/repo-add --new --files ${DBNAME}.files.tar.gz *.pkg.tar.xz + +# clear +/usr/bin/cd "${PREPAREDIR}" +/usr/bin/rm -rf * +/usr/bin/cd "${STAGINGDIR}" +/usr/bin/rm -rf *