aboutsummaryrefslogtreecommitdiff
path: root/unix/hlib/util.csh/pkginit
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /unix/hlib/util.csh/pkginit
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/hlib/util.csh/pkginit')
-rwxr-xr-xunix/hlib/util.csh/pkginit43
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