This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: About the spec of cygwin's setup.ini file.


On Tue, 23 Dec 2008 06:03:26 -0700, Eric Blake <ebb9@byu.net> wrote:
>> 2- Furthermore, if I want make a local repository based on the
>> setup.ini file, where should I put these pakcages?  More specifically,
>> should I use the  field value of _install:_ or the field value of
>> _source:_ to construct the local directory tree for my cygwin's
>> repository?
>
>Depends on whether you want to install the binaries or the sources used to
>generate those binaries.  But why not use setup.exe, and let it do the
>work for you?

Let me describe the things in my case and the things I've done in more
detail:

1-  If I use the setup.exe to install the cygwin directly from a
remote mirror, it will take me more time to do this thing.
Furthermore, due to the  poor quality of my internet connection speed,
the installation process mabe be interrupted. 

2- In light of the actual situation of my case, I write some bash
scripts to extract the partial content of the _source_ field in the
setup.ini file, than I incombinate it with a cygwin mirror to get the
real url addresses list for all of the cygwin packages like this:  

------------------
#! /bin/sh
# This script. use to generate a download script. for cygwin !
#
# Usage : ./cyg_scratch.sh setup.ini
DEFAULT_SETUP_INI=setup.ini
BASE_MIRROR_SITE=http://cygwin.internet.bs/

## If the setup.ini specified ?
if [ -z $1 ] ; then
    SETUP_INI=$DEFAULT_SETUP_INI
else
    SETUP_INI=$1
fi

## If the SETUP_INI exists ?
if [ ! -f $SETUP_INI ] ; then
    echo "$SETUP_INI does not exists !"
    exit 0
fi

## Scratch the package file names in the setup.ini
for fname in `gawk '/^install:|^source:/ {print $2}' $SETUP_INI`
do
  echo $BASE_MIRROR_SITE$fname
#    wget -P `dirname $fname` $BASE_MIRROR_SITE$fname
## You can change to any statements to download the file you want.
#  `dirname $fname` : the directory prefix
#  
done
------------------

3- Based on the above script, I'll get all of the cygwin's packges
list into a file, say, file.lst files.  But considering that the
duplicate issues I've posted here, I must then delete the duplicate
lines in this file firstly in order for the furer use of it to build
my own repository.

4- Then I use other multi-thread downloading tool to load the file.lst
in order to obtain all of the packages quickly and safely.

5- Once the above step completed successfully, I then the other script
to re-put these packages into the right directories as they are like
this:

---------------------
#!/bin/sh
if [ $# -ne 1 ]
then
cat << EOF
Usage: `basename $0` Path/to/packages/of/cygwin
Path/to/packages/of/cygwin: Is the path of the Cygwin's packages
downloaded by multithread tools, such as thunder.
An example: `basename $0` /cygdrive/e/OS_and_Manage/cygwin/downoaded
EOF
exit 1
fi

DOWNLOAD_DIR=$1
chmod +r ./files.lst
if [ -f ./move-packages.lst ];then  rm -f ./move-packages.lst; fi
cp ./files.lst ./move-packages.lst
sed -i 's/^.*\/release\///g' ./move-packages.lst

if [ -f ./move-packages.lst.temp ];then  rm -f
./move-packages.lst.temp; fi
sort -k2n ./move-packages.lst | uniq >> ./move-packages.lst.temp
mv -f ./move-packages.lst.temp ./move-packages.lst

FILELIST=`cat move-packages.lst`
for thefile in $FILELIST; do
	PACKAGE_DIR="release/"`dirname $thefile`
	mkdir -p $PACKAGE_DIR
	chmod +rw $DOWNLOAD_DIR"/"`basename $thefile`
	cp -f $DOWNLOAD_DIR"/"`basename $thefile` $PACKAGE_DIR
done
---------------------- 

These are the case of mine.

-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]