diff options
Diffstat (limited to 'unix/hlib/util.csh/pkginit')
-rwxr-xr-x | unix/hlib/util.csh/pkginit | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/unix/hlib/util.csh/pkginit b/unix/hlib/util.csh/pkginit new file mode 100755 index 00000000..b93eb61d --- /dev/null +++ b/unix/hlib/util.csh/pkginit @@ -0,0 +1,43 @@ +#!/bin/csh -f +# +# PKGINIT - Initialize the dynamic package directory by fetching the most +# recent repository definition files. + +unalias grep + +set bindir = "`dirname $0`" # get iraf root directory +set irafdir = $bindir:h + +set REPO = `${irafdir}/util/pkgrepo` # get repo url +set man = ".repo_manifest" +set arch = `${irafdir}/unix/hlib/irafarch.csh -actual` + + +$irafdir/util/pkgget ${REPO}/REPO.MANIFEST .repo_manifest +if ($status == 1) then + echo "Cannot download repository manifest file, quitting." + exit $status +endif + +$irafdir/util/pkgget ${REPO}/REPO.DESC .repo_desc +if ($status == 1) then + echo "Cannot download repository description file, quitting." + exit $status +endif + + +# Create a list of packages available for the current platform. We pull +# out the list from the repository manifest of all packages. If we have +# IRAFARCH defined, assumed we're interested in managing multiple +# architectures so don't filter by the current architecture. + +if ($?IRAFARCH) then + cat $man | egrep -v "^#" | awk '{printf("%s\n", $2)}' | uniq > .repo_pkgs + cat $man > .repo_local +else + cat $man | grep "${arch}\ " | awk '{printf("%s\n", $2)}' > .repo_pkgs + cat $man | grep "${arch}\ " > .repo_local +endif + + +exit 0 |