diff options
Diffstat (limited to 'iurt_cache_cleaner.sh')
-rwxr-xr-x | iurt_cache_cleaner.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/iurt_cache_cleaner.sh b/iurt_cache_cleaner.sh index 68c0516..65f875e 100755 --- a/iurt_cache_cleaner.sh +++ b/iurt_cache_cleaner.sh @@ -25,10 +25,15 @@ function clean_package() { srpm="$3" echo -e "Cleaning all packages generated by\n $srpm." - find "$TOPDIR/$distro/"{,debug_}"$section" -name '*.rpm' ! -name '*.src.rpm' |\ + find "$TOPDIR/$distro/$section" -name '*.rpm' ! -name '*.src.rpm' |\ xargs rpm -qp --qf '%{SOURCERPM} %{name}-%{version}-%{release}.%{arch}.rpm\n' |\ - sed -n "s@^$srpm @$TOPDIR/$distro/$section/@p" |\ + sed -n "s@^$srpm @$TOPDIR/$distro/$section/@p;" |\ xargs rm -fv "$TOPDIR/$distro/$section/$srpm" + + find "$TOPDIR/debug_$distro/$section" -name '*.rpm' ! -name '*.src.rpm' |\ + xargs rpm -qp --qf '%{SOURCERPM} %{name}-%{version}-%{release}.%{arch}.rpm\n' |\ + sed -n "s@^$srpm @$TOPDIR/debug_$distro/$section/@p;" |\ + xargs rm -fv } # |