summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-01-29 14:20:07 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-01-29 14:20:07 -0500
commitd58e08c0bc1a0ab13340e7b18cc7848f1a7b01bc (patch)
tree6e73eb1a8ef8960023b3827e31635c18d2411d63
parent217fb1c7ac68b70d7961546b59e04fee76031845 (diff)
speed up pbs-absrepo-convert--filterarch
-rwxr-xr-xpbs-absrepo-convert--filterarch7
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}"
(