Felson
Group: Members
Posts: 54
Joined: Jan. 2007 |
|
Posted: Jan. 26 2007,01:01 |
|
Ok, to start, there is very little work in these that I actualy did myself. I took cbaggers bed2dsl script, and split it into 2.
The first returns a list of files from all the deb files in the locations listed. The second builds a DSL file either from a list of file names. Either from a file passed in as a arg, or from stdin.
Then I made 2 scripts of my own. The first just makes a file in the tmp dir that has a time stamp. The second gives you a list of all files that have changed since you ran the first script.
Known bugs... If you untar something that writes it with its original dates, they will not be grabbed. I plan to write one that does an md5 on all of the file on the system to determan change instead, buttoday I was to lazy to make that. That said, this should be good for anything that is installed from source, as that makes new files. I "think" I grabbed everything that needs to be stored. If some of you can take a look, and see if I missed anything important, please let me know.
Here are the scripts.
dsl_debs
Code Sample | #!/bin/bash # # dsl_debs - Returns a list of all files in all deb # files in you home dir and the apt cache dir # # Revision: 1 # Date: 02/19/05 # Original Author: cbagger01 from the DSL forums # # Rev 1 - Removed leading . from dsl file listings and # removed .dsl from mydsl menu filename # # This script will grab all *.deb files located in your # "Home" directory, IE: the /home/username directory # It will also grab all *.deb files located in your apt # cache, IE: /var/cache/apt/archives # # Before running this script, you need to actually install # all of your Debian packages using 'dpkg -i' or # 'apt-get install' or a package manager like Synaptic. # Do NOT delete your leftover *.deb files or purge your # apt-cache until after you have finished running this # script. # # Disclaimer: # This script is just a file repackaging program that # can be used for simple Debian packages. It will not # perform post-extraction configuration that is done # by more sophisticated Debian packages. It also cannot # be used to upgrade packages from older versions # that are part of the DSL livecd base installation.
# This script will not work if it is run under the 'root' effective # user ID which is 0 if [ "$EUID" -eq "0" ]; then echo "Do not use 'root' access to run this script. Aborting..." exit 1 fi
# Start things out from the home directory so we won't get confused cd $HOME
# Find all Debian packages in your home directory and grab the list of # files that are contained inside each package. Make sure that directory # names are not grabbed. Only file names will be added to the list. # Remove leading . character from the filename list. for i in $( ls $HOME/*.deb ); do dpkg -c $i | awk '{ print substr($6,2) }' \ | grep -v "\/$" done
# Find all Debian packages in your apt cache directory and grab the list # of files that are contained inside each package. Make sure that # directory names are not grabbed. Only file names will be added to the # list. # Remove leading . character from the filename list. for i in $( ls /var/cache/apt/archives/*.deb ); do dpkg -c $i | awk '{ print substr($6,2) }' \ | grep -v "\/$" done
exit 0
|
|