Annotation of home/as/.csh/cshrcupdate.csh, revision 1.1
1.1 ! as 1: # $Paefchen$
! 2:
! 3: # CSHRC_RELOAD: NO
! 4: # CSHRC_PROMPTONLY: YES
! 5:
! 6: if (! $?AS_CSHRC_UPDATE_PKG_PATH) then
! 7: set AS_CSHRC_UPDATE_PKG_PATH = "~/.csh"
! 8: endif
! 9:
! 10: if (! $?AS_CSHRC_UPDATE_PKG_URL) then
! 11: set AS_CSHRC_UPDATE_PKG_URL = 'http://as.hl.domino.sh/projekte/cshrc/'
! 12: endif
! 13:
! 14: if (`alias cshrcupdate` == '') then
! 15: aliass cshrcupdate ~/.csh/cshrcupdate.csh
! 16: else
! 17:
! 18: set _pkg_name = "cshrc-$AS_CSHRC_VERSION.tar.bz2"
! 19:
! 20: switch ($1)
! 21: case package:
! 22: if (! -d $AS_CSHRC_UPDATE_PKG_PATH) then
! 23: echo "Fehler: $AS_CSHRC_UPDATE_PKG_PATH existiert nicht"
! 24: breaksw
! 25: endif
! 26: echo "erstell Pakett:"
! 27: csh -c "cd ~; tar cvjf $AS_CSHRC_UPDATE_PKG_PATH/$_pkg_name .cshrc .csh/*.csh .csh/*.tcsh"
! 28: printf "%-8s%-20s%s\n" "$AS_CSHRC_VERSION" "$_pkg_name" "`date`" > $AS_CSHRC_UPDATE_PKG_PATH/VERSION
! 29: breaksw
! 30:
! 31: case update:
! 32: echo "Version laden..."
! 33: cp_remote_file $AS_CSHRC_UPDATE_PKG_URL/VERSION /tmp/cshrc.install.version
! 34: if (! -f /tmp/cshrc.install.version) then
! 35: echo "Fehler: konnte $AS_CSHRC_UPDATE_PKG_URL/VERSION nicht laden."
! 36: breaksw
! 37: endif
! 38: set _new_version = `awk '{print $1}' /tmp/cshrc.install.version`
! 39: set _new_pkg = "$AS_CSHRC_UPDATE_PKG_URL"`awk '{print $2}' /tmp/cshrc.install.version`
! 40: echo "alte Version: $AS_CSHRC_VERSION"
! 41: echo "neue Version: $_new_version"
! 42: echo "PKG laden..."
! 43: cp_remote_file $_new_pkg /tmp/cshrc.install.pkg
! 44: if (! -f /tmp/cshrc.install.pkg) then
! 45: echo "Fehler: PKG konnte nicht geladen werden."
! 46: breaksw
! 47: endif
! 48: echo "alte Version loeschen..."
! 49: rm -v ~/.cshrc ~/.csh/*.csh ~/.csh/*.tcsh
! 50: echo "PKG installieren..."
! 51: csh -c "cd ~; tar xvjf /tmp/cshrc.install.pkg"
! 52: echo "temporaere Files loeschen..."
! 53: rm -v /tmp/cshrc.install.version /tmp/cshrc.install.pkg
! 54: breaksw
! 55:
! 56: case install2host:
! 57: if ($2 == "") then
! 58: echo "Fehler: kein Host angegeben."
! 59: breaksw
! 60: endif
! 61: scp -r ~/.csh* "${2}:"
! 62: breaksw
! 63:
! 64: case version:
! 65: echo $AS_CSHRC_VERSION
! 66: breaksw
! 67:
! 68: case version-new:
! 69: echo "Version laden..."
! 70: cp_remote_file $AS_CSHRC_UPDATE_PKG_URL/VERSION /tmp/cshrc.install.version >& /dev/null
! 71: if (! -f /tmp/cshrc.install.version) then
! 72: echo "Fehler: konnte $AS_CSHRC_UPDATE_PKG_URL/VERSION nicht laden."
! 73: breaksw
! 74: endif
! 75: echo `awk '{print $1}' /tmp/cshrc.install.version`
! 76: rm /tmp/cshrc.install.version
! 77: breaksw
! 78:
! 79: default:
! 80: echo "Hilfe cshrcupdate: [package|update|version|version-new|install2host]"
! 81: endsw
! 82:
! 83: unset _pkg_name _proc_get _new_version _new_pkg
! 84:
! 85: endif