diff options
author | Jan Rękorajski | 2012-09-22 19:40:56 (GMT) |
---|---|---|
committer | Jan Rękorajski | 2012-09-22 19:40:56 (GMT) |
commit | 48d8fed6fa7eaa69189b1d0ef286bdc590007904 (patch) | |
tree | 0f73091ebb09151e8b9c8e3f705d097ee919b7f3 /wwwbin | |
parent | c8ce29df6d94ba60f60fe6de0f9dc3284ca89d26 (diff) | |
download | pld-ftp-admin-48d8fed6fa7eaa69189b1d0ef286bdc590007904.zip pld-ftp-admin-48d8fed6fa7eaa69189b1d0ef286bdc590007904.tar.gz |
- wrap separate calls and loops into single pipe in pkg2src
Changed files:
wwwbin/consistency-check.sh -> 1.15
Diffstat (limited to 'wwwbin')
-rw-r--r-- | wwwbin/consistency-check.sh | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/wwwbin/consistency-check.sh b/wwwbin/consistency-check.sh index ddee3ca..b77671c 100644 --- a/wwwbin/consistency-check.sh +++ b/wwwbin/consistency-check.sh @@ -22,34 +22,18 @@ group_deps() { # uses poldek pkg2src() { local t=$(mktemp) - local t1=$(mktemp) - local t2=$(mktemp) local t3=$(mktemp) # save input cat > $t - # create list of packages from error report + # create list of N-V-R.A.rpm -> src-N pairs from error report # error: arcconf-7.0.18786-1: req libstdc++.so.5()(64bit) not found - sed -ne 's/error: \(.*\): req .* not found/\1/p' $t | sort -u > $t1 - - # create list of package -> src.rpm names - poldek --noignore -Q "$@" --cmd ls -q -s > $t2 - - # create N-V-R -> N list - local pkg error message srpm out - while read pkg; do - pkg=$(echo "$pkg" | sed -e 's,+,\\+,g') - - # there's no space between the columns, so need to match with known archs - # see https://bugs.launchpad.net/poldek/+bug/1031767 - out=$(sed -rne "s/^($pkg)\.(x86_64|i686|noarch)(.+)-[^-]+-[^-]+\.src\.rpm$/\1\t\3/p" $t2) - if [ -z "$out" ]; then - echo >&2 "nvr: No match for [$pkg]" - fi - echo "$out" - done < $t1 > $t3 + sed -ne 's/error: \(.*\): req .* not found/\1/p' $t | sort -u | \ + xargs -d '\n' poldek --noignore -Q "$@" --cmd ls -q -s | \ + sed -rne "s/^([^\t ]+)[\t ]+(.+)-[^-]+-[^-]+\.src\.rpm$/\1\t\2/p" >$t3 + local pkg error message srpm while read error pkg message; do # error: arcconf-7.0.18786-1: req libstdc++.so.5()(64bit) not found srpm=$(awk -vpkg="${pkg%:}" '$1 == pkg {printf("%s.spec", $2)}' $t3) @@ -59,7 +43,7 @@ pkg2src() { echo "$error [$srpm] $pkg $message" done < $t - rm -f $t $t1 $t2 $t3 + rm -f $t $t3 } gen_list() { |