Skip to content

Commit

Permalink
use bash native substitution which matches original
Browse files Browse the repository at this point in the history
  • Loading branch information
bsherman committed Oct 22, 2024
1 parent 8dc0ece commit d9fabeb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Containerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ RUN set -e; \
kernel_version=$(rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" kernel-core | head -n 1); \
for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \
basename=$(basename ${rpm}); \
name=$(echo ${basename} | sed -r "s/(-${kernel_version})//g"); \
name=${basename/-${kernel_version}*/}; \
if [[ "$basename" == *"$kernel_version"* ]]; then \
fpm --verbose -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \
else \
echo "Skipping $basename as it does not contain $kernel_version in its name"; \
echo "Skipping $basename rebuild as its name does not contain $kernel_version"; \
fi; \
done

Expand Down
4 changes: 2 additions & 2 deletions Containerfile.extra
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ RUN set -e; \
kernel_version=$(rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" kernel-core | head -n 1); \
for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \
basename=$(basename ${rpm}); \
name=$(echo ${basename} | sed -r "s/(-${kernel_version})//g"); \
name=${basename/-${kernel_version}*/}; \
if [[ "$basename" == *"$kernel_version"* ]]; then \
fpm --verbose -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \
else \
echo "Skipping $basename as it does not contain $kernel_version in its name"; \
echo "Skipping $basename rebuild as its name does not contain $kernel_version"; \
fi; \
done

Expand Down
4 changes: 2 additions & 2 deletions Containerfile.nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ RUN set -e; \
kernel_version=$(rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" kernel-core | head -n 1); \
for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \
basename=$(basename ${rpm}); \
name=$(echo ${basename} | sed -r "s/(-${kernel_version})//g"); \
name=${basename/-${kernel_version}*/}; \
if [[ "$basename" == *"$kernel_version"* ]]; then \
fpm --verbose -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \
else \
echo "Skipping $basename as it does not contain $kernel_version in its name"; \
echo "Skipping $basename rebuild as its name does not contain $kernel_version"; \
fi; \
done

Expand Down
4 changes: 2 additions & 2 deletions Containerfile.nvidia-open
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ RUN set -e; \
kernel_version=$(rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" kernel-core | head -n 1); \
for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \
basename=$(basename ${rpm}); \
name=$(echo ${basename} | sed -r "s/(-${kernel_version})//g"); \
name=${basename/-${kernel_version}*/}; \
if [[ "$basename" == *"$kernel_version"* ]]; then \
fpm --verbose -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \
else \
echo "Skipping $basename as it does not contain $kernel_version in its name"; \
echo "Skipping $basename rebuild as its name does not contain $kernel_version"; \
fi; \
done

Expand Down
4 changes: 2 additions & 2 deletions Containerfile.zfs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ RUN set -e; \
kernel_version=$(rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" kernel-core | head -n 1); \
for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \
basename=$(basename ${rpm}); \
name=$(echo ${basename} | sed -r "s/(-${kernel_version})//g"); \
name=${basename/-${kernel_version}*/}; \
if [[ "$basename" == *"$kernel_version"* ]]; then \
fpm --verbose -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \
else \
echo "Skipping $basename as it does not contain $kernel_version in its name"; \
echo "Skipping $basename rebuild as its name does not contain $kernel_version"; \
fi; \
done

Expand Down

0 comments on commit d9fabeb

Please sign in to comment.