You are not logged in.
Pages: 1
well, i noticed i had only 500 MB free on my root partition, so i decided to go and clean out my /var/abs (freeing up roughly 2 gigs). Here is a bash script i wrote to remove the src/ and pkg/ recursively from your abs root. (it also cleans out your unstable, extra and other repositories abs looks at)
#!/bin/bash
source /etc/abs/abs.conf
cd $ABSROOT
for h in $(ls /etc/abs/supfile* | sed 's/./ /g' | gawk '{print $2}'); do pushd $h
for i in *; do pushd $i
for j in *; do pushd $j
rm src/ pkg/ -rf && popd; done; popd; done; popd; done
Oh yeah, you need gawk for it to work.
Offline
Not anymore
4c4
< for h in $(ls /etc/abs/supfile* | sed 's/./ /g' | gawk '{print $2}'); do pushd $h
---
> for h in "${SUPFILES[@]}"; do pushd "${h#!}"
BTW, there is no /var/abs/arch directory...
Offline
No arch in /var/abs? too bad, .
I wasn't sure how to access that variable, hehe. thanks
Offline
The above scripts did not work for me. So I've written my own one. It's much longer but for me as a beginner in scripting it's easier to understand and modify.
#!/bin/bash
source /etc/abs/abs.conf
echo "ABSROOT="$ABSROOT
cd $ABSROOT
before=`du -csh $ABSROOT`
echo "space used now" $before; sleep 5
# current
for toppath in `ls -1 $ABSROOT -I community -I extra -I local -I testing -I install.proto -I PKGBUILD.proto`; do
echo "toppath is" $toppath
cd $ABSROOT/$toppath
for subpath in *; do
cd $ABSROOT/$toppath/$subpath
rm -rf pkg/ src/ filelist && echo $ABSROOT/$toppath/$subpath "clean now"
cd ..
done
cd ..
done
# extra
cd $ABSROOT/extra
for toppath in `ls -1 $ABSROOT/extra`; do
echo "toppath is" $toppath
cd $ABSROOT/extra/$toppath
for subpath in *; do
cd $ABSROOT/extra/$toppath/$subpath
rm -rf pkg/ src/ filelist && echo $ABSROOT/extra/$toppath/$subpath "clean now"
cd ..
done
cd ..
done
# community
cd $ABSROOT/community
for toppath in `ls -1 $ABSROOT/community`; do
echo "toppath is" $toppath
cd $ABSROOT/community/$toppath
for subpath in *; do
cd $ABSROOT/community/$toppath/$subpath
rm -rf pkg/ src/ filelist && echo $ABSROOT/community/$toppath/$subpath "clean now"
cd ..
done
cd ..
done
# testing
cd $ABSROOT/testing
for subpath in *; do
cd $ABSROOT/testing/$subpath
rm -rf pkg/ src/ filelist && echo $ABSROOT/testing/$subpath "clean now"
cd ..
done
# local / AUR
cd $ABSROOT/local
#removes the downloaded AUR build stuff
ls -l *.tar.gz
rm -f *.tar.gz
for subpath in `ls -1 $ABSROOT/local -I install.proto -I PKGBUILD.proto`; do
cd $ABSROOT/local/$subpath; pwd
rm -rf pkg/ src/ filelist && echo $ABSROOT/local/$subpath "clean"
cd ..
done
after=`du -csh $ABSROOT`
echo "used space before cleaning" $before
echo "used space now" $after
Offline
what happened to being super lazy?
# rm -rf /var/abs
# abs
Offline
it may be semi - 40% - 32% - 58.9% usefull to set the PKGDEST variable in makepkg.conf so that all packages are moved to that location instead of being scattered all over your abs tree.
Offline
Pages: 1