diff options
author | P. J. McDermott <pj@pehjota.net> | 2013-12-03 00:00:00 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-08-15 08:55:35 (EDT) |
commit | f1da1182ff26e17cf1f0c4733bb903fab344a7c6 (patch) | |
tree | 98619cd143c46dc8e767e914e6b720393db5b36f | |
parent | 470bfb57d1cb6f68d9f260ab8afe688ed46821d0 (diff) |
feed_find_pkgs(): Write to a filenames file
-rw-r--r-- | lib/feed.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/feed.sh b/lib/feed.sh index 85660d7..08e7acd 100644 --- a/lib/feed.sh +++ b/lib/feed.sh @@ -27,6 +27,7 @@ feed_pkg_cb= feed_dep_fields= feed_pkgs= feed_deps_fd= +feed_fnames_fd= feed_pkg_include= feed_pkg= feed_deps= @@ -40,11 +41,13 @@ feed_download() return 0 } +# TODO: Write to a filenames file. feed_find_pkgs() { local pkg_cb="${1}" local dep_fields="${2}" local deps_file="${3}" + local fnames_file="${4}" feed_pkg_cb="${pkg_cb}" feed_dep_fields=" $(printf '%s ' ${dep_fields})" @@ -52,6 +55,8 @@ feed_find_pkgs() fopen "${deps_file}" 'a' feed_deps_fd=${FD} + fopen "${fnames_file}" 'a' + feed_fnames_fd=${FD} feed_pkg_include='false' feed_pkg='' @@ -73,6 +78,8 @@ feed_field_cb() if [ "x${name}" = 'xPackage' ]; then feed_pkg="${value}" + elif [ "x${name}" = 'xFilename' ]; then + printf '%s %s\n' "${feed_pkg}" "${value}" >&${feed_fnames_fd} elif [ "x${feed_dep_fields#* ${name} }" != "x${feed_dep_fields}" ]; then feed_deps="${feed_deps}${value}, " fi |