summaryrefslogtreecommitdiff
path: root/pbs-absrepo-convert--filterarch
diff options
context:
space:
mode:
Diffstat (limited to '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}"
(