#!/bin/bash die() { echo "$@" exit 1 } if grep -q subarchs FrugalBuild && ! grep -q "subarchs.*`uname -m`" FrugalBuild; then die "please add `uname -m` to subarchs() manually and restart" fi . /usr/lib/frugalware/fwmakepkg . ./FrugalBuild || die "error while parsing the buildscript" # update archs() if ! echo ${archs[@]} |grep -q `uname -m`; then if grep -q archs= FrugalBuild; then sed -i "s/^\(archs=(.*\))/\1 '`uname -m`')/" FrugalBuild else echo "archs=(\${archs[@]} '`uname -m`')" >> FrugalBuild fi . ./FrugalBuild echo ${archs[@]} |grep -q `uname -m` || die "failed to add `uname -m` to archs()" fi if ! ls *fpm &>/dev/null; then makepkg -dgu || die "failed to download sources" rm -rf src || die "failed to remove duplicated sources" sudo makepkg -cu || die "build failed" fi if [ "$1" == "--push" -o "$1" == "--silentpush" ]; then repoman rec "added `uname -m` to archs()" || die "failed to record the patch" if [ "$1" == "--push" ]; then repoman -k push else dg push -a fi else die "now run '$0 --push' to record and push your changes" fi