Skip to content
Snippets Groups Projects
Commit 18add97a authored by Ruben Rodriguez's avatar Ruben Rodriguez
Browse files

Changes to purge by source package name, not binary package name

parent 252df483
No related branches found
No related tags found
No related merge requests found
...@@ -8,17 +8,10 @@ db.bak ...@@ -8,17 +8,10 @@ db.bak
update.log update.log
update.log.bak update.log.bak
ERROR ERROR
conf/purge-hardy conf/purge-*
conf/purge-jaunty
conf/purge-karmic
conf/purge-lucid
conf/purge-maverick
conf/purge-oneiric
incoming/* incoming/*
incoming incoming
checksums.db checksums.db
remove.sh remove.sh
conf/purge-natty
conf/purge-oneiric
check check
list list
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -6,28 +6,28 @@ Suite: lucid ...@@ -6,28 +6,28 @@ Suite: lucid
Components: main>main universe>main Components: main>main universe>main
UDebComponents: main>main universe>main UDebComponents: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-lucid FilterSrcList: install purge-lucid
Name: lucid-updates Name: lucid-updates
Method: http://archive.ubuntu.com/ubuntu/ Method: http://archive.ubuntu.com/ubuntu/
Suite: lucid-updates Suite: lucid-updates
Components: main>main universe>main Components: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-lucid FilterSrcList: install purge-lucid
Name: lucid-security Name: lucid-security
Method: http://archive.ubuntu.com/ubuntu/ Method: http://archive.ubuntu.com/ubuntu/
Suite: lucid-security Suite: lucid-security
Components: main>main universe>main Components: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-lucid FilterSrcList: install purge-lucid
Name: lucid-backports Name: lucid-backports
Method: http://archive.ubuntu.com/ubuntu/ Method: http://archive.ubuntu.com/ubuntu/
Suite: lucid-backports Suite: lucid-backports
Components: main>main universe>main Components: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-lucid FilterSrcList: install purge-lucid
...@@ -38,28 +38,28 @@ Suite: precise ...@@ -38,28 +38,28 @@ Suite: precise
Components: main>main universe>main Components: main>main universe>main
UDebComponents: main>main universe>main UDebComponents: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-precise FilterSrcList: install purge-precise
Name: precise-updates Name: precise-updates
Method: http://archive.ubuntu.com/ubuntu/ Method: http://archive.ubuntu.com/ubuntu/
Suite: precise-updates Suite: precise-updates
Components: main>main universe>main Components: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-precise FilterSrcList: install purge-precise
Name: precise-security Name: precise-security
Method: http://archive.ubuntu.com/ubuntu/ Method: http://archive.ubuntu.com/ubuntu/
Suite: precise-security Suite: precise-security
Components: main>main universe>main Components: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-precise FilterSrcList: install purge-precise
Name: precise-backports Name: precise-backports
Method: http://archive.ubuntu.com/ubuntu/ Method: http://archive.ubuntu.com/ubuntu/
Suite: precise-backports Suite: precise-backports
Components: main>main universe>main Components: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-precise FilterSrcList: install purge-precise
Name: trusty Name: trusty
...@@ -68,26 +68,26 @@ Suite: trusty ...@@ -68,26 +68,26 @@ Suite: trusty
Components: main>main universe>main Components: main>main universe>main
UDebComponents: main>main universe>main UDebComponents: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-trusty FilterSrcList: install purge-trusty
Name: trusty-updates Name: trusty-updates
Method: http://archive.ubuntu.com/ubuntu/ Method: http://archive.ubuntu.com/ubuntu/
Suite: trusty-updates Suite: trusty-updates
Components: main>main universe>main Components: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-trusty FilterSrcList: install purge-trusty
Name: trusty-security Name: trusty-security
Method: http://archive.ubuntu.com/ubuntu/ Method: http://archive.ubuntu.com/ubuntu/
Suite: trusty-security Suite: trusty-security
Components: main>main universe>main Components: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-trusty FilterSrcList: install purge-trusty
Name: trusty-backports Name: trusty-backports
Method: http://archive.ubuntu.com/ubuntu/ Method: http://archive.ubuntu.com/ubuntu/
Suite: trusty-backports Suite: trusty-backports
Components: main>main universe>main Components: main>main universe>main
VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1 VerifyRelease: 3F272F5B|437D05B5|8D8AEBF1
FilterList: install purge-trusty FilterSrcList: install purge-trusty
...@@ -18,13 +18,9 @@ ...@@ -18,13 +18,9 @@
set -e set -e
[ $3"1" = "test1" ] && TEST=echo
DIST=$1 DIST=$1
CODENAME=$2 CODENAME=$2
#REPLACE=$(ls -1 /home/systems/devel/helpers/$DIST/make-* | sed 's:^.*/::; s:make-::')
REPLACE=$(git --git-dir=/home/systems/devel/.git ls-tree -r --name-only $CODENAME|grep helpers/make-|sed 's/.*make-//') REPLACE=$(git --git-dir=/home/systems/devel/.git ls-tree -r --name-only $CODENAME|grep helpers/make-|sed 's/.*make-//')
NETINST="apt-setup base-installer choose-mirror debian-installer main-menu netcfg net-retriever pkgsel"
if [ -x purge-$DIST ] if [ -x purge-$DIST ]
then then
...@@ -33,28 +29,75 @@ else ...@@ -33,28 +29,75 @@ else
exit 1 exit 1
fi fi
PACKAGES="$REPLACE $NETINST $REMOVE $UNBRAND" echo listing $DIST
reprepro -A source list $DIST | cut -d' ' -f2 > list1
for SOURCE in $PACKAGES reprepro -A source list $DIST-updates | cut -d' ' -f2 >> list1
do reprepro -A source list $DIST-security | cut -d' ' -f2 >> list1
ls pool/*/*/${SOURCE}/ > /dev/null 2>&1 || continue reprepro -A source list $DIST-backports | cut -d' ' -f2 >> list1
echo Found $SOURCE directory sort -u < list1 > list
for package in $(ls -1 pool/*/*/${SOURCE}/* 2>/dev/null | awk -F '/' '{print $5}'|awk -F '_' '{print $1}'|sort -u )
do PACKAGES="$REPLACE $REMOVE $UNBRAND"
echo Found $package package
for repo in $DIST $DIST-updates $DIST-security $DIST-backports echo Searching for packages to remove in $DIST
do for PACKAGE in $PACKAGES; do
if $TEST reprepro -v remove $repo $package 2>&1 | grep -q "Not removed"
then if echo $PACKAGE |grep -q '\*'; then
echo E: Not in $repo PACKAGE=$(echo $PACKAGE |sed 's/-*//; s/*//')
else for REPO in $DIST $DIST-updates $DIST-security $DIST-backports; do
echo Blacklisting $package EXTRAPACKAGES=$(egrep "^$REPO\|" list |grep " $PACKAGE"|cut -d" " -f2)
echo "$package purge" >> conf/purge-$DIST for EXTRA in $EXTRAPACKAGES; do
fi echo "$EXTRA purge" >> conf/purge-$DIST
echo 1 reprepro -v removesrc $REPO $EXTRA
reprepro -v removesrc $REPO $EXTRA
done
done done
done fi
echo "$PACKAGE purge" >> conf/purge-$DIST
for REPO in $DIST $DIST-updates $DIST-security $DIST-backports; do
if grep "^$PACKAGE$" -q list; then
echo 2 reprepro -v removesrc $REPO $PACKAGE
reprepro -v removesrc $REPO $PACKAGE
fi
done
done
for file in conf/purge*; do
cat $file | sort -u > $file.tmp
mv $file.tmp $file
done
exit
#--------------------------------------------------------------
echo Searching for missing packages in $DIST
rm -f /tmp/sourcemissing
for REPO in $DIST $DIST-updates $DIST-security $DIST-backports; do
reprepro sourcemissing $REPO >> /tmp/sourcemissing
done done
echo Sorting blacklist while read line; do
sort -u < conf/purge-$DIST > /tmp/purge-$DIST
mv /tmp/purge-$DIST conf/purge-$DIST dist=$(echo $line | cut -d" " -f1 )
sourcepkg=$(echo $line | cut -d" " -f2 )
package=$(echo $line | cut -d" " -f4|sed 's_.*/__; s/_.*//' )
dir=$(echo $line | cut -d" " -f4 | sed 's/\(.*\)\/.*/\1/' )
if ! ls $dir|grep dsc -q; then
echo "$sourcepkg purge" conf/purge-$dist
echo "$sourcepkg purge" >> conf/purge-$dist
fi
#echo reprepro -v remove $dist $package
#reprepro -v remove $dist $package
done < /tmp/sourcemissing
#--------------------------------------------------------------
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
savelog logs/update.log doall(){
exec &> logs/update.log
date date
echo Updating... echo Updating...
...@@ -31,21 +30,13 @@ else ...@@ -31,21 +30,13 @@ else
date > ERROR date > ERROR
fi fi
listpackages(){
for dist in $1 $1-updates $1-security $1-backports
do
reprepro list $dist >> list
done
}
echo Removing non free packages... echo Removing non free packages...
rm list rm list
#sh purge.sh hardy robur
sh purge.sh lucid taranis sh purge.sh lucid taranis
#sh purge.sh natty dagda
#sh purge.sh oneiric brigantia
sh purge.sh precise toutatis sh purge.sh precise toutatis
sh purge.sh trusty belenos sh purge.sh trusty belenos
echo DONE echo DONE
sh list.sh > list }
savelog logs/update.log
doall 2>&1 | tee logs/update.log
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment