ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/cms-apt-migration.file
Revision: 1.2
Committed: Thu Jul 12 13:53:17 2007 UTC (17 years, 9 months ago) by eulisse
Branch: MAIN
Changes since 1.1: +43 -16 lines
Log Message:
* More fixes to get the migration script to actually work.

File Contents

# User Rev Content
1 eulisse 1.1 #!/bin/sh
2     if [ X"$(id -u)" = X0 ]; then
3     echo "*** CMS SOFTWARE INSTALLATION ABORTED ***" 1>&2
4     echo "CMS software cannot be installed as the super-user." 1>&2
5     echo "(We recommend reading any standard unix security guide.)" 1>&2
6     exit 1
7     fi
8    
9 eulisse 1.2 repository=cms
10     rootdir=$PWD
11    
12 eulisse 1.1 while [ $# -gt 0 ]
13     do
14     arg=$1
15     shift
16     case $arg in
17     -path)
18     [ $# -gt 0 ] || { echo "Option \`$arg' requires an argument" 1>&2; exit 1; }
19     if [ "`echo $1 | cut -b 1`" != "/" ]; then
20     rootdir="$PWD/$1"
21     else
22     rootdir="$1"
23     fi
24     ;;
25 eulisse 1.2 -repository)
26     [ $# -gt 0 ] || { echo "Option \`$arg' requires an argument" 1>&2; exit 1; }
27     echo "WARNING: the repository option should be used only for testing!!"
28     repository=$1
29     ;;
30 eulisse 1.1 *)
31     echo "Unrecognized option: $1."
32     exit 1
33     ;;
34     esac
35     shift
36     done
37    
38 eulisse 1.2 cd $rootdir
39 eulisse 1.1
40     # Install the new apt/rpm packages.
41 eulisse 1.2 rpmOptions="-r $rootdir --prefix $rootdir --dbpath $rootdir/@CMSPLATF@/var/lib/rpm --ignoreos --ignorearch"
42     rpmlock=$rootdir/@CMSPLATF@/var/lib/rpm/__db.0
43     url=http://cmsrep.cern.ch/cmssw/$repository/RPMS/@CMSPLATF@
44     downloadDir=$VO_CMS_SW_DIR/tmp/apt-migration
45     mkdir -p $downloadDir
46     old=$PWD
47     cd $downloadDir
48     wget -N $url/external+gcc+@GCC_VERSION@-1-@GCC_REVISION@.@CMSPLATF@.rpm
49     wget -N $url/external+elfutils+@ELFUTILS_VERSION@-1-@ELFUTILS_REVISION@.@CMSPLATF@.rpm
50     wget -N $url/external+expat+@EXPAT_VERSION@-1-@EXPAT_REVISION@.@CMSPLATF@.rpm
51     wget -N $url/external+db4+@DB4_VERSION@-1-@DB4_REVISION@.@CMSPLATF@.rpm
52     wget -N $url/external+beecrypt+@BEECRYPT_VERSION@-1-@BEECRYPT_REVISION@.@CMSPLATF@.rpm
53     wget -N $url/external+zlib+@ZLIB_VERSION@-1-@ZLIB_REVISION@.@CMSPLATF@.rpm
54     wget -N $url/external+bz2lib+@BZ2LIB_VERSION@-1-@BZ2LIB_REVISION@.@CMSPLATF@.rpm
55     wget -N $url/external+openssl+@OPENSSL_VERSION@-1-@OPENSSL_REVISION@.@CMSPLATF@.rpm
56     wget -N $url/external+neon+@NEON_VERSION@-1-@NEON_REVISION@.@CMSPLATF@.rpm
57     wget -N $url/external+rpm+@RPM_VERSION@-1-@RPM_REVISION@.@CMSPLATF@.rpm
58     wget -N $url/external+libxml2+@LIBXML2_VERSION@-1-@LIBXML2_REVISION@.@CMSPLATF@.rpm
59     wget -N $url/external+apt+@APT_VERSION@-1-@APT_REVISION@.@CMSPLATF@.rpm
60     cd $old
61    
62     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+gcc+@GCC_VERSION@-1-@GCC_REVISION@.@CMSPLATF@.rpm
63     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+elfutils+@ELFUTILS_VERSION@-1-@ELFUTILS_REVISION@.@CMSPLATF@.rpm
64     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+expat+@EXPAT_VERSION@-1-@EXPAT_REVISION@.@CMSPLATF@.rpm
65     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+db4+@DB4_VERSION@-1-@DB4_REVISION@.@CMSPLATF@.rpm
66     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+beecrypt+@BEECRYPT_VERSION@-1-@BEECRYPT_REVISION@.@CMSPLATF@.rpm
67     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+zlib+@ZLIB_VERSION@-1-@ZLIB_REVISION@.@CMSPLATF@.rpm
68     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+bz2lib+@BZ2LIB_VERSION@-1-@BZ2LIB_REVISION@.@CMSPLATF@.rpm
69     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+openssl+@OPENSSL_VERSION@-1-@OPENSSL_REVISION@.@CMSPLATF@.rpm
70     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+neon+@NEON_VERSION@-1-@NEON_REVISION@.@CMSPLATF@.rpm
71     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+rpm+@RPM_VERSION@-1-@RPM_REVISION@.@CMSPLATF@.rpm
72     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+libxml2+@LIBXML2_VERSION@-1-@LIBXML2_REVISION@.@CMSPLATF@.rpm
73     rpm -Uvh --define "_rpmlock_path $rpmlock" $rpmOptions $downloadDir/external+apt+@APT_VERSION@-1-@APT_REVISION@.@CMSPLATF@.rpm
74 eulisse 1.1
75     # Remove the old indexes for the rpmdb.
76     indexes="Basenames Dirnames Group Name Providename Pubkeys Requireversion Sigmd5 __db.001 __db.003
77     Conflictname Filemd5s Installtid Provideversion Requirename Sha1header Triggername __db.002
78     lock"
79     for olddbfile in $indexes
80     do
81     rm @CMSPLATF@/var/lib/rpm/$olddbfile
82     done
83    
84     # Rebuild the db using the new rpm.
85     source $rootdir/@CMSPLATF@/external/rpm/@RPM_VERSION@/etc/profile.d/init.sh
86 eulisse 1.2 rpmdb -r $rootdir --dbpath @CMSPLATF@/var/lib/rpm --rebuilddb