一个可以生成精简源的脚本。

软件源讨论区
回复
头像
oneleaf
论坛管理员
帖子: 10229
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04
送出感谢: 7 次
接收感谢: 103 次

一个可以生成精简源的脚本。

#1

帖子 oneleaf » 2006-09-14 22:39

#!/bin/bash
MAINDISTS="dapper"
OTHERDISTS="dapper-backports dapper-proposed dapper-security dapper-updates"
#SECTIONS="main universe multiverse restricted"
SECTIONS="main multiverse restricted"
#BINARY_ARCH="binary-i386 binary-powerpc binary-amd64"
BINARY_ARCH="binary-i386"
ROOT="/share/ubuntu"
CNROOT="/share/ubuntu-cn"
mkdir -p temp
mkdir -p iso
rm *.iso
rm -fr iso/*
for a in $MAINDISTS; do
for b in $SECTIONS; do
for c in $BINARY_ARCH; do
echo $a/$b/$c
cp -a $ROOT/dists/$a/$b/$c/Packages.gz temp/Packages.gz
gunzip temp/Packages.gz
mkdir -p iso/ubuntu/dists/$a/$b/$c/
ln -s $ROOT/dists/$a/$b/$c/* iso/ubuntu/dists/$a/$b/$c/
for d in `grep Filename: temp/Packages |awk '{print $2}' `; do
dir=`dirname $d`
mkdir -p iso/ubuntu/$dir
ln -s $ROOT/$d iso/ubuntu/$dir
done
rm temp/Packages
done
done
done
rm -r temp
mkisofs -r -J -l -f -o ubuntu_dapper_i386_main.iso iso

rm -fr iso/*
for a in $OTHERDISTS; do
for b in $SECTIONS; do
for c in $BINARY_ARCH; do
echo $a/$b/$c
cp -a $ROOT/dists/$a/$b/$c/Packages.gz temp/Packages.gz
gunzip temp/Packages.gz
mkdir -p iso/ubuntu/dists/$a/$b/$c/
ln -s $ROOT/dists/$a/$b/$c/* iso/ubuntu/dists/$a/$b/$c/
for d in `grep Filename: temp/Packages |awk '{print $2}' `; do
dir=`dirname $d`
mkdir -p iso/ubuntu/$dir
ln -s $ROOT/$d iso/ubuntu/$dir
done
rm temp/Packages
done
done
done
rm -r temp
mkisofs -r -J -l -f -o ubuntu_dapper_i386_other.iso iso


rm -fr iso/*
mkdir -p iso/ubuntu-cn/dists/
for a in $DISTS; do
cp -a $CNROOT/dists/dapper iso/ubuntu-cn/dists/
done
mkisofs -r -J -l -f -o ubuntu_cn_dapper.iso iso
头像
ulixer
帖子: 231
注册时间: 2006-03-02 23:51
送出感谢: 0
接收感谢: 1 次

#2

帖子 ulixer » 2006-09-18 16:52

怎么没有注释?
回复

回到 “新立得和软件源”