Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: pws-22: large integers without --enable-lfs, missing bits



Compilation with no --enable-lfs but with large off_t and ino_t still
wouldn't work because it thought $enable_lfs was set to the type to try
when it was empty.

The zftpcompsys.yo, zfmark and zfgoto files didn't copied copied into the
distribution properly, so are empty.  Sorry.

Also, Oliver Kiddle pointed out that the server at IfH seems to be
returning text/plain for .bz2 files which are therefore likely to be
destroyed by your browser tinkering with them (I believe HTTP should send a
raw byte stream anyway).  So I've made the same files available with an
additional .bin suffix which seems to come out as application/octet-stream.

--- configure.in.lfs	Mon Jun 14 17:20:20 1999
+++ configure.in	Tue Jun 15 13:33:46 1999
@@ -598,7 +598,8 @@
   if test "x$enable_lfs" != xno -o $zsh_cv_off_t_is_64_bit = yes \
   -o $zsh_cv_ino_t_is_64_bit = yes; then
     AC_CACHE_CHECK(if compiler has a 64 bit type, zsh_cv_64_bit_type,
-    [if test "x$enable_lfs" != xyes -a "x$enable_lfs" != xno; then
+    [if test "x$enable_lfs" != x -a "x$enable_lfs" != xyes \
+     -a "x$enable_lfs" != xno; then
       zsh_64_BIT_TYPE(${enable_lfs}, zsh_cv_64_bit_type, force)
      else
        zsh_64_BIT_TYPE(long long, zsh_cv_64_bit_type)
--- Doc/zshzftpsys.yo.empty	Tue Jun 15 14:19:59 1999
+++ Doc/zshzftpsys.yo	Mon Apr 19 16:48:42 1999
@@ -0,0 +1,3 @@
+manpage(ZSHZFTPSYS)(1)(date())(zsh version())
+manpagename(zshzftpsys)(zftp function front-end)
+includefile(Zsh/zftpsys.yo)
--- Functions/Zftp/zfgoto.empty	Tue Jun 15 14:19:59 1999
+++ Functions/Zftp/zfgoto	Fri Jun 11 17:55:19 1999
@@ -0,0 +1,86 @@
+# zfgoto bname
+# Go to bookmark bname, a location on a remote FTP host.  Unless
+# this was the last session or is for anonymous FTP, prompt for
+# the user's password.
+
+emulate -L zsh
+setopt extendedglob
+
+# Set ZFTP_BMFILE if not already set.  This should agree with
+# the corresponding line in zfmark.
+: ${ZFTP_BMFILE:=${ZFDOTDIR:-$HOME}/.zfbkmarks}
+
+typeset -A bkmarks
+local line ncftp opt optlist
+
+while [[ $1 == -* ]]; do
+  if [[ $1 == - || $1 == -- ]]; then
+    shift;
+    break;
+  fi
+  optlist=${1#-}
+  for (( i = 1; i <= $#optlist; i++)); do
+    opt=$optlist[$i]
+    case $opt in
+      n) ncftp=1
+	 ;;
+      *) print option $opt not recognised >&2
+	 return 1
+	 ;;
+    esac
+  done
+  shift
+done
+
+if (( $# != 1 )); then
+  print "Usage: zfgoto bookmark" >&2
+  return 1
+fi
+
+if [[ -n $ncftp && -f ~/.ncftp/bookmarks ]]; then
+  local oldifs=$IFS
+  IFS=,
+  while read -rA line; do
+    bkmarks[$line[1]]="${line[3]:-anonymous}@${line[2]}:${line[6]}"
+  done < ~/.ncftp/bookmarks
+  IFS=$oldifs
+elif [[ -f $ZFTP_BMFILE ]]; then
+  # read in file:  could optimise this by recording last read time
+  # comparing with file
+  while read -r line; do
+    # ignore blank and comment lines
+    [[ $line = [[:blank:]]# || $line = [[:blank:]]#'#'* ]] && continue
+    bkmarks[${line%% *}]="${line#* }"
+  done <$ZFTP_BMFILE
+fi
+
+line=${bkmarks[$1]}
+
+if [[ -z $line ]]; then
+  print "Bookmark \`$1' not found" >&2
+  return 1
+fi
+
+local user host dir
+user=${line%%@*}
+line=${line#*@}
+host=${line%%:*}
+dir=${line#*:}
+
+if [[ $user = ftp || $user = anonymous ]]; then
+  # Anonymous ftp, so we don't need password etc.
+  zfanon $host && [[ -n $dir ]] && zfcd $dir
+elif [[ $zflastsession = ${host}:* && $user = $zflastuser ]]; then
+  # This was the last session, so assume it's still setup in the
+  # open parameters
+  zfopen && [[ -n $dir ]] && zfcd $dir
+else
+  # Last try: see if it's in the parameters.
+  local params
+  params=($(zftp params))
+  if [[ $host = $params[1] && $user = $params[2] ]]; then
+    zfopen && [[ -n $dir ]] && zfcd $dir
+  else
+    zfopen $host $user && [[ -n $dir ]] && zfcd $dir
+  fi
+fi
--- Functions/Zftp/zfmark.empty	Tue Jun 15 14:19:59 1999
+++ Functions/Zftp/zfmark	Fri Jun 11 17:21:31 1999
@@ -0,0 +1,49 @@
+# zfmark [bname]
+# Set a bookmark for the current zftp connection, or use the
+# information about the last session if there isn't one.
+# A bookmark includes both the host *and* the directory on that host.
+#
+# Without bname, list the current bookmarks and their locations.
+
+emulate -L zsh
+setopt extendedglob
+
+# Set ZFTP_BMFILE if not already set.  This should agree with
+# the corresponding line in zfgoto.
+: ${ZFTP_BMFILE:=${ZDOTDIR:-$HOME}/.zfbkmarks}
+
+typeset -A bkmarks
+local line
+
+if [[ -f $ZFTP_BMFILE ]]; then
+  # read in file:  could optimise this by recording last read time
+  # comparing with file
+  while read -r line; do
+    # ignore blank and comment lines
+    [[ $line = [[:blank:]]# || $line = [[:blank:]]#'#'* ]] && continue
+    bkmarks[${line%% *}]="${line#* }"
+  done <$ZFTP_BMFILE
+fi
+
+if (( $# == 0 )); then
+  for line in ${(ko)bkmarks}; do
+    print -r- "$line ${bkmarks[$line]}"
+  done
+  return 0
+elif (( $# > 1 )); then
+  print "Usage: zfmark [bookmark]" >&2
+  return 1
+fi
+
+if [[ -n $ZFTP_HOST ]]; then
+  bkmarks[$1]="${ZFTP_USER}@${ZFTP_HOST}:${ZFTP_PWD}"
+elif [[ -n $zflastsession ]]; then
+  bkmarks[$1]="${zflastuser}@${zflastsession}"
+else
+  print "No current or recent ZFTP session to bookmark." >&2
+  return 1
+fi
+
+for line in ${(ko)bkmarks}; do
+  print -r- "$line ${bkmarks[$line]}"
+done >$ZFTP_BMFILE

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author