summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/librefetch/librefetch16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch
index 6767a6c..92434e2 100755
--- a/src/librefetch/librefetch
+++ b/src/librefetch/librefetch
@@ -202,9 +202,12 @@ doit() {
dlcmd="${dlcmd//\%o/\"\$dst\"}"
dlcmd="${dlcmd//\%u/\"\$src\"}"
+#DBG "librefetch::doit() mode==download dlcmd=$dlcmd"
+
if { eval "$dlcmd"; } >&2; then
exit $EXIT_SUCCESS
fi
+#DBG "librefetch::doit() we did not exit success inmirror=$inmirror"
fi
# Mode: create #########################################################
@@ -218,6 +221,8 @@ doit() {
local src_missing_msg="Libre source not found. Attempting to create it from upstream sources."
local done_msg="Libre source created successfully"
+DBG "librefetch::doit(create) dst=$dst base_dst=${base_dst} suffix=$suffix" ; # DBG "PKGBUILD=" ; cat $srcbuild ;
+
if [[ $base_dst == *.sig ]]; then
# recurse to create the libre source-ball, if it does not yet exist
# the libre source-ball signature is deferred to librerelease
@@ -227,6 +232,9 @@ doit() {
msg2 "${src_missing_msg}"
doit || exit
fi
+
+DBG "librefetch::doit(create) IS_SIG"
+# set -x
# FIXME: there is a note about this signature in usage()
# create_signature "${base_dst%.sig}" || exit
if [[ -n $suffix ]]; then
@@ -236,11 +244,15 @@ doit() {
export PKGDEST=${dst%/*}
export pkg_file=$dst
+DBG "librefetch::doit(create) PKGEXT=$PKGEXT cmd=\"$makepkg\" \"${makepkg_opts[@]}\" -p \"$srcbuild\""
+
cd "$BUILDFILEDIR"
msg2 "${src_missing_msg}"
"$makepkg" "${makepkg_opts[@]}" -p "$srcbuild" >&2 && msg2 "${done_msg}" || exit
fi
fi
+
+DBG "librefetch::doit(create) OUT"
}
# sets the variables BUILDFILE, makepkg_opts, extra_opts, mode
@@ -382,6 +394,10 @@ modified_pkgbuild() {
srcbuild="$(mktemp "${pkgbuild%/*}/${cmd}.XXXXXXXXXXX.PKGBUILD.to.SRCBUILD")"
printf '%s' "$PKGBUILD_APPEND" | cat "$pkgbuild" - > "$srcbuild"
printf '%s\n' "$srcbuild"
+
+# printf "modified_pkgbuild() pkgbuild=${pkgbuild} ${pkgbuild%/*}\n" >&2
+# printf "modified_pkgbuild() TMPDIR=$TMPDIR srcbuild_loc=%s\n" "$srcbuild" >&2
+# ls -al ${pkgbuild%/*}
}