added repo-update

This commit is contained in:
arcan1s 2014-03-23 04:29:15 +04:00
parent fc877e4598
commit 011e0bcb4e
3 changed files with 86 additions and 1 deletions

View File

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

View File

@ -114,7 +114,7 @@ round=extra
roundAllTabs=false
roundMbTopOnly=true
sbarBgndAppearance=flat
scrollbarType=kde
scrollbarType=none
selectionAppearance=harsh
shadeCheckRadio=none
shadeMenubarOnlyWhenActive=false

84
repo-update Executable file
View File

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