diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-01-29 14:20:07 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-01-29 14:20:07 -0500 |
commit | d58e08c0bc1a0ab13340e7b18cc7848f1a7b01bc (patch) | |
tree | 6e73eb1a8ef8960023b3827e31635c18d2411d63 | |
parent | 217fb1c7ac68b70d7961546b59e04fee76031845 (diff) |
speed up pbs-absrepo-convert--filterarch
-rwxr-xr-x | pbs-absrepo-convert--filterarch | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pbs-absrepo-convert--filterarch b/pbs-absrepo-convert--filterarch index 5940fa0..506baf3 100755 --- a/pbs-absrepo-convert--filterarch +++ b/pbs-absrepo-convert--filterarch @@ -11,7 +11,7 @@ fi # generate map of all packages to their repo repos="$(mktemp)" -find */repos/* -type d -printf '%h/%h\n' | sed -r 's@^([^/]*)/repos/(.*)-[^-]*$@\1 \2@'|sort -u > "$repos" +printf '%s\n' */repos/*-"$arch" | sed -r 's@^([^/]*)/repos/(.*)-[^-]*$@\1 \2@' | sort -u > "$repos" # clean the working directory rm -rf * @@ -20,8 +20,9 @@ rm -rf * cat "$tree" | while read mode type treehash path; do package="${path%%/*}" repo="$(sed -n "s/^${package} //p" "$repos")" - commithash="$(sed -n "s/^${treehash} //p" "../packages-${package}.commits")" - if [[ -n "$commithash" ]]; then + commitfile="../packages-${package}.commits" + if [[ -f "$commitfile" ]]; then + commithash="$(sed -n "s/^${treehash} //p" "$commitfile")" mkdir -p "$repo" git submodule add ./ "${repo}/${package}" ( |