Does it cache things?
Because I had to remodel a script at the last moment in order to get a DIY repository working over NFS. And, I'm getting the ghist that apt-move somehow cache's things, thus reducing the amount of read/writes if I use apt-move cache.
Am I right about this?
I read the man page. I didn't get it. Someone want to explain in detail about this? Please?
Here's my script.
It does apt-move fsck.
Then it makes the repository.
Then I delete whatever apt-move left behind.
Code:
#!/bin/sh
######################################
# Program: Debian Pool creator
# Objective: Create a Debian pool
# Last update: September 16th, 2008
######################################
# Download pre-requisites
## Check for apt-move
if [ -e /usr/bin/apt-move ]
then
clear
else
apt-get -y install apt-move
fi
## Check for apt-ftparchive
if [ -e /usr/bin/apt-ftparchive ]
then
clear
else
apt-get -y install apt-utils
apt-get -y install apt-ftparchive
fi
#################################################################
# Create an archive of whatever (just one big fucking annoyance)
#################################################################
apt-move fsck
######################################
# Make the necessary folders
######################################
# Make mirroring folder
mkdir -p /mirrors/debian/
cd /mirrors/debian/
# Make the folder-trees for the various distros
mkdir -p /mirrors/debian/dists/lenny/{non-free,contrib,multiverse}/binary-i386
mkdir -p /mirrors/debian/dists/testing/{non-free,contrib,multiverse}/binary-i386
mkdir -p /mirrors/debian/dists/sid/{non-free,contrib,multiverse}/binary-i386
mkdir -p /mirrors/debian/dists/unstable/{non-free,contrib,multiverse}/binary-i386
# Make the pool directory
mkdir -p /mirrors/debian/pool/{main,non-free,contrib,multiverse}
##########
# Lenny
##########
echo "--------------------------------"
echo "Working on Lenny packages"
echo "--------------------------------"
# Move the packages to /mirrors/debian
apt-move -d lenny update
# Organize the "main" packages
apt-ftparchive packages pool/main/ | gzip -9c > /mirrors/debian/dists/lenny/main/binary-i386/Packages.gz
# Organize the "multiverse" packages
apt-ftparchive packages pool/multiverse/ | gzip -9c > /mirrors/debian/dists/lenny/multiverse/binary-i386/Packages.gz
# Organize the "contrib" packages
apt-ftparchive packages pool/contrib/ | gzip -9c > /mirrors/debian/dists/lenny/contrib/binary-i386/Packages.gz
# Organize the "non-free" packages
apt-ftparchive packages pool/non-free/ | gzip -9c > /mirrors/debian/dists/lenny/non-free/binary-i386/Packages.gz
clear
##########
# Testing
##########
echo "--------------------------------"
echo "Working on testing packages"
echo "--------------------------------"
# Move the packages to /mirrors/debian
apt-move -d testing update
# Organize the "main" packages
apt-ftparchive packages pool/main/ | gzip -9c > dists/testing/main/binary-i386/Packages.gz
# Organize the "multiverse" packages
apt-ftparchive packages pool/multiverse/ | gzip -9c > dists/testing/multiverse/binary-i386/Packages.gz
# Organize the "contrib" packages
apt-ftparchive packages pool/contrib/ | gzip -9c > dists/testing/contrib/binary-i386/Packages.gz
# Organize the "non-free" packages
apt-ftparchive packages pool/non-free/ | gzip -9c > dists/testing/non-free/binary-i386/Packages.gz
clear
##########
# Sid
##########
echo "--------------------------------"
echo "Working on Sid packages"
echo "--------------------------------"
# Move the packages to /mirrors/debian
apt-move -d sid update
# Organize the "main" packages
apt-ftparchive packages pool/main/ | gzip -9c > dists/sid/main/binary-i386/Packages.gz
# Organize the "multiverse" packages
apt-ftparchive packages pool/multiverse/ | gzip -9c > dists/sid/multiverse/binary-i386/Packages.gz
# Organize the "contrib" packages
apt-ftparchive packages pool/contrib/ | gzip -9c > dists/sid/contrib/binary-i386/Packages.gz
# Organize the "non-free" packages
apt-ftparchive packages pool/non-free/ | gzip -9c > dists/sid/non-free/binary-i386/Packages.gz
clear
##########
# Unstable
##########
echo "--------------------------------"
echo "Working on unstable packages"
echo "--------------------------------"
# Move the packages to /mirrors/debian
apt-move -d unstable update
# Organize the "main" packages
apt-ftparchive packages pool/main/ | gzip -9c > dists/unstable/main/binary-i386/Packages.gz
# Organize the "multiverse" packages
apt-ftparchive packages pool/multiverse/ | gzip -9c > dists/unstable/multiverse/binary-i386/Packages.gz
# Organize the "contrib" packages
apt-ftparchive packages pool/contrib/ | gzip -9c > dists/unstable/contrib/binary-i386/Packages.gz
# Organize the "non-free" packages
apt-ftparchive packages pool/non-free/ | gzip -9c > dists/unstable/non-free/binary-i386/Packages.gz
clear
################################
# Remove former "Release" files
################################
rm /mirrors/debian/dists/lenny/Release
rm /mirrors/debian/dists/testing/Release
rm /mirrors/debian/dists/sid/Release
rm /mirrors/debian/dists/unstable/Release
################################
# Create modified "Release" files
################################
#apt-ftparchive generate /etc/apt/apt-ftparchive.conf
# Lenny
apt-ftparchive -c /home/workstation/scripts/debian-pool/lenny/lennyapt.conf release dists/lenny/ > /mirrors/debian/dists/lenny/Release
# Testing
apt-ftparchive -c /home/workstation/scripts/debian-pool/testing/testingapt.conf release dists/testing/ > /mirrors/debian/dists/testing/Release
# Sid
apt-ftparchive -c /home/workstation/scripts/debian-pool/sid/sidapt.conf release dists/sid/ > /mirrors/debian/dists/sid/Release
# unstable
apt-ftparchive -c /home/workstation/scripts/debian-pool/unstable/unstableapt.conf release dists/unstable/ > /mirrors/debian/dists/unstable/Release
#################################################
# Remove the unnecessary thing apt-move fsck did
#################################################
rm -r /mirrors/debian/backup
rm -r /mirrors/debian/.apt-move