@@ -282,11 +282,27 @@ get_all() {
282
282
while ! (( finished )) ; do
283
283
finished=1
284
284
285
- local depends
286
- local makedepends
287
-
288
- source <( tr ' \n' ' ' < " $name /PKGBUILD" | grep -Eo ' (make)?depends=\([^)]*\)' | \
289
- sed -r " s/(['\" ])([^><='\" ]*)[><=]+[^'\" ]*\1/\1\2\1/g" | str_clean)
285
+ local depends=()
286
+ local makedepends=()
287
+ local checkdepends=()
288
+
289
+ if [[ -e " $name " /.SRCINFO ]]; then
290
+ while read -r key _ value _; do
291
+ [[ $key == depends ]] && depends+=(" $value " )
292
+ [[ $key == makedepends ]] && makedepends+=(" $value " )
293
+ [[ $key == checkdepends ]] && checkdepends+=(" $value " )
294
+ [[ $key == ' ' ]] && break
295
+ done < " $name " /.SRCINFO
296
+ else
297
+ # e.g. when using a local repository which you probably trust anyway
298
+ if ask " No .SRCINFO, source $name /PKGBUILD?" ; then
299
+ source <( tr ' \n' ' ' < " $name /PKGBUILD" | grep -Eo ' (make|check)?depends=\([^)]*\)' | \
300
+ sed -r " s/(['\" ])([^><='\" ]*)[><=]+[^'\" ]*\1/\1\2\1/g" | str_clean)
301
+ else
302
+ msg e " Must get depends from $name , inspect manually and rerun"
303
+ return 1
304
+ fi
305
+ fi
290
306
291
307
local deps=" $( pacman -T ${depends[*]} ${makedepends[*]} | tr ' \n' ' ' ) "
292
308
@@ -300,8 +316,8 @@ get_all() {
300
316
if ! get_all " $dep " 0; then
301
317
finished=0
302
318
303
- if ask " Modify PKGBUILD for $pkg ?" ; then
304
- " $EDITOR " " $pkg /PKGBUILD"
319
+ if ask " Modify PKGBUILD for $name ?" ; then
320
+ " $EDITOR " " $name /PKGBUILD"
305
321
break 1
306
322
else
307
323
msg e " Must download dependencies."
@@ -499,7 +515,7 @@ build() {
499
515
local pkg i PKGEXT
500
516
501
517
for pkg; do
502
- get_all "$pkg"
518
+ get_all "$pkg" || return 1
503
519
done
504
520
505
521
(( $# == 0 )) && return 0 # no packages to install
0 commit comments