From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- unix/hlib/util.csh/pkginit | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 unix/hlib/util.csh/pkginit (limited to 'unix/hlib/util.csh/pkginit') 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 -- cgit