summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/librefetch/librefetch19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch
index c723721..87a55cd 100755
--- a/src/librefetch/librefetch
+++ b/src/librefetch/librefetch
@@ -18,12 +18,12 @@
# You should have received a copy of the GNU General Public License
# along with Parabola. If not, see <http://www.gnu.org/licenses/>.
-. $(librelib conf.sh)
-. libremessages
+. $(librelib conf)
+. $(librelib messages)
+setup_traps
declare -r tempdir="$(mktemp -d --tmpdir ${0##*/}.XXXXXXXXXXX)"
-cleanup() { rm -rf -- "$tempdir"; }
-trap cleanup EXIT
+trap "rm -rf -- $(printf '%q' "$tempdir")" EXIT
cmd=${0##*/}
usage() {
@@ -91,10 +91,15 @@ main() {
local BUILDFILEDIR="${BUILDFILE%/*}"
if [[ -f "${BUILDFILEDIR}/SRCBUILD" ]]; then
BUILDFILE="${BUILDFILEDIR}/SRCBUILD"
- srcbuild="$(modified_srcbuild "$BUILDFILE")"
- else
- srcbuild="$(modified_pkgbuild "$BUILDFILE")"
fi
+ if [[ ! -f "$BUILDFILE" ]]; then
+ error "%s does not exist." "$BUILDFILE"
+ exit 1
+ fi
+ case "$BUILDFILE" in
+ */SRCBUILD) srcbuild="$(modified_srcbuild "$BUILDFILE")";;
+ *) srcbuild="$(modified_pkgbuild "$BUILDFILE")";;
+ esac
makepkg="$(modified_makepkg "$(which makepkg)")"
# Mode: checksums ######################################################