diff options
author | P. J. McDermott <pjm@nac.net> | 2013-07-16 13:29:08 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-07-16 13:29:08 (EDT) |
commit | bf05593151083e625c9d35e30c2c113e46d7c52a (patch) | |
tree | ed57970c3bdcd3507e54d2a68f0e3a75fb73c987 /lib/cmd | |
parent | 090920007372a842c8f5a372e9dc2da3f3b17d89 (diff) |
include: Copy referenced files into the pool.
Diffstat (limited to 'lib/cmd')
-rw-r--r-- | lib/cmd/include.sh | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/lib/cmd/include.sh b/lib/cmd/include.sh index f62f747..2ea39f7 100644 --- a/lib/cmd/include.sh +++ b/lib/cmd/include.sh @@ -29,6 +29,7 @@ cmd_include_files= cmd_include_main() { + local archive= local changes= local size= local file= @@ -36,8 +37,12 @@ cmd_include_main() local binver= local arch= local plat= + local component= + local source_l= + local pool_dir= local feed= - local filename= + + archive='archive' for changes in "${@}"; do parse_control "${changes}" cmd_include_changes_field \ @@ -60,19 +65,24 @@ cmd_include_main() printf ' Architecture: %s\n' "${arch}" printf ' Platform: %s\n' "${plat}" printf ' Size: %s\n' "${size}" + component='main' + source_l="$(printf '%s\n' "${cmd_include_source}" | \ + sed 's/\(.\).*/\1/')" + pool_dir="pool/${component}/${source_l}/${cmd_include_source}" + mkdir -p "${archive}/${pool_dir}" + cp -p "$(dirname "${changes}")/${file}" \ + "${archive}/${pool_dir}/${file}" feed="${conf_incoming_channel}/${cmd_include_distribution}" feed="${feed}/main/${plat}/${arch}" - mkdir -p "dists/${feed}/.db/" - tar -xzOf "$(dirname "${changes}")/${file}" 'control.tar.gz' | \ - tar -xzO './control' >"dists/${feed}/.db/${pkg}.control" - filename="../../../../../pool/main/$(printf '%s\n' \ - "${cmd_include_source}" | \ - sed 's/\(.\).*/\1/')/${cmd_include_source}/${file}" + mkdir -p "${archive}/dists/${feed}/.db/" + tar -xzOf "${archive}/${pool_dir}/${file}" 'control.tar.gz' | \ + tar -xzO './control' \ + >"${archive}/dists/${feed}/.db/${pkg}.control" printf 'Filename: %s\nSize: %s\nMD5sum: %s\n' \ - "${filename}" "${size}" \ + "../../../../../../${pool_dir}/${file}" "${size}" \ "$(md5sum "$(dirname "${changes}")/${file}" | \ sed 's/ .*$//')" \ - >>"dists/${feed}/.db/${pkg}.control" + >>"${archive}/dists/${feed}/.db/${pkg}.control" done <<-EOF ${cmd_include_files} EOF |