Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-22 16:43:40 +0200
committerErich Eckner <git@eckner.net>2017-06-22 16:43:40 +0200
commit0e13adff76c5ab655df3b9fb0dcd28b4df5083f5 (patch)
tree2e0922a2550b6776ca790545a68bbed234af6be3
parentb46ff981026ec7541b23c131c0c77b984fd33cae (diff)
remove "grep ... part1*part2" bug
-rwxr-xr-xbin/db-update9
-rwxr-xr-xbin/get-assignment3
-rwxr-xr-xbin/get-package-updates3
-rwxr-xr-xbin/return-assignment6
-rwxr-xr-xbin/why_dont_you12
5 files changed, 15 insertions, 18 deletions
diff --git a/bin/db-update b/bin/db-update
index eaf0337..01db113 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -184,12 +184,13 @@ move_packages() {
# add and remove the packages locally
if grep -qxF "${repo}" "${tmp_dir}/"*".from_repo"; then
+
${dummynator} repo-remove -q \
"${tmp_dir}/${repo}/${repo}.db.tar.gz" \
$(
- grep -xF "${repo}" "${tmp_dir}/"*".from_repo" | \
+ grep -lxF "${repo}" "${tmp_dir}/"*".from_repo" | \
sed '
- s|\.from_repo:[^:]\+$|.parts_names|
+ s|\.from_repo$|.parts_names|
' | \
xargs -rn1 cat
)
@@ -199,9 +200,9 @@ move_packages() {
${dummynator} repo-add -q \
"${tmp_dir}/${repo}/${repo}.db.tar.gz" \
$(
- grep -xF "${repo}" "${tmp_dir}/"*".to_repo" | \
+ grep -lxF "${repo}" "${tmp_dir}/"*".to_repo" | \
sed '
- s|\.to_repo:[^:]\+$||
+ s|\.to_repo$||
' | \
while read -r package; do
sed \
diff --git a/bin/get-assignment b/bin/get-assignment
index c028007..e46dd39 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -40,8 +40,7 @@ hand_out_assignment() {
echo "${slave}" > "${work_dir}/package-states/$1.$2.$3.$4.locked"
# lock every loop this package breaks
- grep -xF "${1}" "${work_dir}/build-list.loops/"loop_* | \
- cut -d: -f1 | \
+ grep -lxF "${1}" "${work_dir}/build-list.loops/"loop_* | \
tee -a "${work_dir}/package-states/$1.$2.$3.$4.locked" | \
sed 's|$|.locked|' | \
xargs -rn1 touch
diff --git a/bin/get-package-updates b/bin/get-package-updates
index 90d6b8f..9d5a4c4 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -237,8 +237,7 @@ while [ -n "${black_listed_new}" ]; do
black_listed_new="$(
echo "${black_listed_new}" | \
while read -r bl_package; do
- grep -xF "${bl_package}" "${work_dir}/package-infos/"*.depends | \
- cut -d: -f1 | \
+ grep -lxF "${bl_package}" "${work_dir}/package-infos/"*.depends | \
sed '
s|^.*/||
s|\(\.[^.]\+\)\{3\}$||
diff --git a/bin/return-assignment b/bin/return-assignment
index 3090089..8e24ed8 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -68,8 +68,7 @@ if [ "$5" = 'ERROR' ]; then
grep '\.locked$' | \
sed 's@^.*/\([^/]\+\)\.\([0-9a-f]\{40\}\.\)\{2\}[^.]\+\.locked$@\1@'
)"
- grep -xF "${1}" "${work_dir}/build-list.loops/loop_"* 2> /dev/null | \
- cut -d: -f1 | \
+ grep -lxF "${1}" "${work_dir}/build-list.loops/loop_"* 2> /dev/null | \
while read -r loop; do
if [ -z "$(
(
@@ -206,8 +205,7 @@ ls "${work_dir}/package-states" | \
xargs -rn1 rm -f
# remove all loops which are broken by this package
-grep -xF "$1" "${work_dir}/build-list.loops/loop_"* 2> /dev/null | \
- cut -d: -f1 | \
+grep -lxF "$1" "${work_dir}/build-list.loops/loop_"* 2> /dev/null | \
sed 'p;s|$|.locked|' | \
xargs -rn1 rm -f
diff --git a/bin/why_dont_you b/bin/why_dont_you
index 2c4d43e..6424335 100755
--- a/bin/why_dont_you
+++ b/bin/why_dont_you
@@ -58,10 +58,11 @@ case "${action}" in
sort | \
uniq -d | \
while read -r dep; do
- grep -Fx "${dep}" "${work_dir}/package-infos/"*".builds" | \
- cut -d: -f1 | \
- xargs -rn1 basename | \
- cut -d. -f1
+ grep -lxF "${dep}" "${work_dir}/package-infos/"*".builds" | \
+ sed '
+ s|^.*/||
+ s|\(\.[^.]\+\)\{3\}||
+ '
done | \
sort -u
@@ -86,8 +87,7 @@ case "${action}" in
fi
dependent_packages="$(
- grep -xF "${pkg}" "${work_dir}/package-infos/"*".depends" | \
- cut -d: -f1 | \
+ grep -lxF "${pkg}" "${work_dir}/package-infos/"*".depends" | \
sed '
s|^.*/||
s|\.depends$||