From bf05593151083e625c9d35e30c2c113e46d7c52a Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 16 Jul 2013 13:29:08 -0400 Subject: include: Copy referenced files into the pool. --- 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 -- cgit v0.9.1