tazwok rev 354
Add command: list-blocked, block, unblock
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Feb 24 00:00:55 2011 +0100 (2011-02-24) |
parents | db18d2db42c2 |
children | f8983e6aff0b |
files | tazwok |
line diff
1.1 --- a/tazwok Wed Feb 23 22:44:05 2011 +0100 1.2 +++ b/tazwok Thu Feb 24 00:00:55 2011 +0100 1.3 @@ -3262,6 +3262,39 @@ 1.4 exit 1 1.5 fi 1.6 ;; 1.7 + list-blocked) 1.8 + # List all blocked packages 1.9 + echo "" 1.10 + cat $PACKAGES_REPOSITORY/blocked 1.11 + echo "" ;; 1.12 + block) 1.13 + # Add a pkg name to the list of blocked packages. 1.14 + echo "" 1.15 + if grep -qs "^$2$" $PACKAGES_REPOSITORY/blocked; then 1.16 + echo -e "$2 is already in the blocked packages list." 1.17 + else 1.18 + echo -n "Adding $2 to : $PACKAGES_REPOSITORY/blocked... " 1.19 + echo "$2" >> $PACKAGES_REPOSITORY/blocked && echo "Done" 1.20 + if grep -q "^$2$" $PACKAGES_REPOSITORY/cooklist; then 1.21 + echo -n "Removing $2 from : $DB_DIR/cooklist... " 1.22 + sed -i /"^$2$"/d $PACKAGES_REPOSITORY/cooklist && echo "Done" 1.23 + fi 1.24 + fi 1.25 + echo "" ;; 1.26 + unblock) 1.27 + # Remove a pkg name from the list of blocked packages. 1.28 + echo "" 1.29 + if grep -qs "^$2$" $PACKAGES_REPOSITORY/blocked; then 1.30 + echo -n "Removing $2 from : $PACKAGES_REPOSITORY/blocked... " 1.31 + sed -i /"^$2$"/d $PACKAGES_REPOSITORY/blocked 1.32 + sed -i '/^$/d' $PACKAGES_REPOSITORY/blocked && echo "Done" 1.33 + echo -n "Adding $2 to : $DB_DIR/cooklist... " 1.34 + echo "$2" >> $DB_DIR/cooklist && echo "Done" 1.35 + sort_cooklist 1.36 + else 1.37 + echo -e "$2 is not in the blocked packages list." 1.38 + fi 1.39 + echo "" ;; 1.40 usage|*) 1.41 # Print usage also for all unknown commands. 1.42 #