From ed126b8d14c987d8653169d039de74a513626489 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 21 Sep 2004 14:16:40 +0000 Subject: [PATCH] Clifford Wolf: Better copy-cache.sh which knows about split packages Added new desc tag [CD] for *.cache related metadata [2004092114021313794] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@4348 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- Documentation/Developers/PKG-DESC-FORMAT | 7 ++++++ misc/tools-source/copy-cache.sh | 28 ++++++++++++++++++++++++ package/base/automake/automake.desc | 2 ++ package/base/bash/bash.desc | 2 ++ package/base/bdb/bdb.desc | 2 ++ package/base/gcc/gcc.desc | 2 ++ package/base/glibc/glibc.desc | 2 ++ package/base/linux/linux.desc | 2 ++ package/import/cpan/cpan.desc | 3 +++ package/jsaw/flexlm/flexlm.desc | 3 +++ target/reference/build.sh | 7 +----- 11 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 misc/tools-source/copy-cache.sh diff --git a/Documentation/Developers/PKG-DESC-FORMAT b/Documentation/Developers/PKG-DESC-FORMAT index 75997f122..164c03484 100644 --- a/Documentation/Developers/PKG-DESC-FORMAT +++ b/Documentation/Developers/PKG-DESC-FORMAT @@ -160,3 +160,10 @@ file. This would run the whole build cycle with mypkg-version1.tar.bz2 and mypkg-gfx-version2.tbz2 but not with mypkg-data-version3.tar.bz2. +-- + +[CD] [CHECKDEPS] + + This flag is used to tell Check-Deps-2 and copy-cache.sh how to handle split + packages. + diff --git a/misc/tools-source/copy-cache.sh b/misc/tools-source/copy-cache.sh new file mode 100644 index 000000000..0155f9cde --- /dev/null +++ b/misc/tools-source/copy-cache.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# find package -type f -name '*.cache' | while read fn +# do [ -f $1/${fn%.cache}.desc ] && cp -v $fn $1/$fn; done +# cd $1; ./scripts/Create-DepDB > scripts/dep_db.txt + +if [ ! -d "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +find package -type f -name '*.cache' | \ +cut -f2,3 -d/ | sort -u | tr / ' ' | \ +while read rep pkg; do + confdir="$1/package/$rep/$pkg" + cachedir="package/$rep/$pkg" + descfile="$confdir/$pkg.desc" + [ -f "$descfile" ] || continue + + if egrep '^\[(CD|CHECKDEPS)\] ' -q $descfile + then + eval "$( egrep '^\[(CD|CHECKDEPS)\] ' $descfile | sed 's,.*>,,' )" + else + rm -rf $confdir/*.cache + cp $cachedir/$pkg.cache $confdir/ + fi +done + diff --git a/package/base/automake/automake.desc b/package/base/automake/automake.desc index 0a05c8002..853e9b1a3 100644 --- a/package/base/automake/automake.desc +++ b/package/base/automake/automake.desc @@ -54,3 +54,5 @@ [D] 619690407 automake-1.8.5.tar.bz2 ftp://ftp.gnu.org/pub/gnu/automake/ #endif +[CD] cp $cachedir/automake18.cache $confdir/$pkg.cache + diff --git a/package/base/bash/bash.desc b/package/base/bash/bash.desc index 14631661c..44ae2cc15 100644 --- a/package/base/bash/bash.desc +++ b/package/base/bash/bash.desc @@ -59,3 +59,5 @@ [D] 2834434668 bash-doc-3.0.tar.gz ftp://ftp.gnu.org/pub/gnu/bash/ #endif +[CD] cp $cachedir/bash2.cache $confdir/$pkg.cache + diff --git a/package/base/bdb/bdb.desc b/package/base/bdb/bdb.desc index 8be4aca3f..ff76eedbb 100644 --- a/package/base/bdb/bdb.desc +++ b/package/base/bdb/bdb.desc @@ -74,3 +74,5 @@ [D] 4159179082 db-4.2.52.tar.gz http://www.sleepycat.com/update/snapshot/ #endif +[CD] for x in $cachedir/*.cache; do cp $x $confdir/$pkg.cache; done + diff --git a/package/base/gcc/gcc.desc b/package/base/gcc/gcc.desc index df0bb4ced..497177652 100644 --- a/package/base/gcc/gcc.desc +++ b/package/base/gcc/gcc.desc @@ -69,3 +69,5 @@ [D] 870641564 protector-3.4-2.tar.gz http://www.research.ibm.com/trl/projects/security/ssp/gcc3_4/ #endif +[CD] for x in $cachedir/*.cache; do cp $x $confdir/$pkg.cache; done + diff --git a/package/base/glibc/glibc.desc b/package/base/glibc/glibc.desc index 7cabc3bfe..24742bfd2 100644 --- a/package/base/glibc/glibc.desc +++ b/package/base/glibc/glibc.desc @@ -56,3 +56,5 @@ [D] 3614008728 glibc-hppa-patches-2004-05-01.tar.gz http://parisc-linux.org/~carlos/glibc-work/ #endif +[CD] cp $cachedir/glibc2[23].cache $confdir/$pkg.cache + diff --git a/package/base/linux/linux.desc b/package/base/linux/linux.desc index 45e3c5ad3..67ccbcfdc 100644 --- a/package/base/linux/linux.desc +++ b/package/base/linux/linux.desc @@ -54,3 +54,5 @@ [D] 2989845998 patch-2.6.7-pa15.gz http://cvs.parisc-linux.org/download/linux-2.6/ #endif +[CD] for x in $cachedir/linux2[46].cache; do cp $x $confdir/$pkg.cache; done + diff --git a/package/import/cpan/cpan.desc b/package/import/cpan/cpan.desc index a04394980..91961e8ef 100644 --- a/package/import/cpan/cpan.desc +++ b/package/import/cpan/cpan.desc @@ -38,5 +38,8 @@ [D] X 02packages.details.txt.gz http://www.cpan.org/modules/ +[CD] rm $confdir/*.cache +[CD] cp $cachedir/*.cache $confdir/ + #include package/import/cpan/hosted_cpan.desc diff --git a/package/jsaw/flexlm/flexlm.desc b/package/jsaw/flexlm/flexlm.desc index b2820cd70..f7f25430a 100644 --- a/package/jsaw/flexlm/flexlm.desc +++ b/package/jsaw/flexlm/flexlm.desc @@ -48,3 +48,6 @@ [D] X lmgrd-x86.Z !ftp://ftp.globes.com/flexlm/unix/v9.2.1/i86_r6/lmgrd.Z NODIST [D] X lmutil-x86.Z !ftp://ftp.globes.com/flexlm/unix/v9.2.1/i86_r6/lmutil.Z NODIST #endif + +[CD] true + diff --git a/target/reference/build.sh b/target/reference/build.sh index 6bfb57c37..9f7950723 100644 --- a/target/reference/build.sh +++ b/target/reference/build.sh @@ -57,12 +57,7 @@ EOT echo_header "Reference build finished." -cat <<- EOT > build/${ROCKCFG_ID}/ROCK/result/copy-cache.sh - #!/bin/sh - find package -type f -name '*.cache' | while read fn - do [ -f \$1/\${fn%.cache}.desc ] && cp -v \$fn \$1/\$fn; done - cd \$1; ./scripts/Create-DepDB > scripts/dep_db.txt -EOT +cp misc/tools-source/copy-cache.sh build/${ROCKCFG_ID}/ROCK/result/copy-cache.sh chmod +x build/${ROCKCFG_ID}/ROCK/result/copy-cache.sh echo_status "Results are stored in the directory"