Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Something
Friday, May 11th, 2012 at 12:18:22am MDT 

  1. #!/bin/bash
  2.  
  3. set -e
  4. set -x
  5.        
  6. if [ -z $INTERNALCALL ];then
  7.     echo "This script should not be called by you. Thanks for calling."
  8.     exit 1
  9. fi
  10.  
  11. . $CC_DIR/functions
  12.  
  13. check_variable ROOTFS
  14. check_variable DISK_ID
  15.  
  16. #STRIP="/usr/share/doc /usr/share/locale/"
  17. if [ -n "$STRIP" ];then
  18.     mkdir -p $TMP/$DISK_ID-strip
  19.     rm -f $TMP/$DISK_ID-strip/list
  20.     rm -f $TMP/$DISK_ID-strip/exclusions
  21.     touch $TMP/$DISK_ID-strip/exclusions
  22.  
  23.     for exclude in $STRIP_EXCLUSIONS;do
  24.         echo "$exclude.list" >> $TMP/$DISK_ID-strip/exclusions
  25.     done
  26.    
  27.     X=`echo $STRIP_EXCLUSIONS| sed -e "s/ /\\\\\\|/g"`
  28.  
  29.     set +e
  30.     for i in $STRIP;do       
  31.         grep -h "$i" --exclude-from=$TMP/$DISK_ID-strip/exclusions $ROOTFS/var/lib/dpkg/info/*list >> $TMP/$DISK_ID-strip/list
  32.          
  33.         if [ "x$X" = "x" ];then
  34.             for f in `find $ROOTFS/var/lib/dpkg|grep "\.list$"`;do
  35.                  grep -v $i $f > $f.stripped
  36.                  mv $f.stripped $f
  37.              done
  38.          else
  39.               for f in `find $ROOTFS/var/lib/dpkg|grep "\.list$"|grep -v -e "$X"`;do
  40.                    grep -v $i $f > $f.stripped
  41.                    mv $f.stripped $f
  42.               done
  43.           fi     
  44.     done
  45.     set -e
  46.     echo "Removing..."
  47.     for i in `cat $TMP/$DISK_ID-strip/list`;do
  48.         echo $i
  49.         rm -rf $ROOTFS/$i
  50.     done
  51. fi

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
fantasy-obligation