[packages/lftp] - up to 4.4.12

arekm arekm at pld-linux.org
Tue Nov 26 07:14:02 CET 2013


commit 266a4ef0960a9a1dad241e7ed98a37017cee48ce
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Nov 26 07:13:59 2013 +0100

    - up to 4.4.12

 lftp-git.patch | 546 ---------------------------------------------------------
 lftp.spec      |   8 +-
 2 files changed, 3 insertions(+), 551 deletions(-)
---
diff --git a/lftp.spec b/lftp.spec
index e57ffd1..0b96b90 100644
--- a/lftp.spec
+++ b/lftp.spec
@@ -22,17 +22,16 @@ Summary(pl.UTF-8):	Zaawansowany klient FTP/HTTP
 Summary(pt_BR.UTF-8):	Sofisticado programa de transferência de arquivos (cliente FTP/HTTP)
 Summary(zh_CN.UTF-8):	lftp 客户端程序
 Name:		lftp
-Version:	4.4.11
-Release:	3
+Version:	4.4.12
+Release:	1
 License:	GPL v3+
 Group:		Applications/Networking
 Source0:	http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz
-# Source0-md5:	8a77bd831050edf90f5a032d85415532
+# Source0-md5:	54b741ad4ae38d193b127b62f10b56a2
 Source1:	http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-man-pages.tar.bz2
 # Source1-md5:	cdad8fb5342eebd9916eccefc98a855b
 Source2:	%{name}.desktop
 Source3:	%{name}-icon.png
-Patch100:	%{name}-git.patch
 Patch0:		%{name}-makefile.patch
 Patch1:		%{name}-m4.patch
 Patch2:		aliases.patch
@@ -91,7 +90,6 @@ o arquivo FEATURES para uma lista mais detalhada.
 
 %prep
 %setup -q
-%patch100 -p1
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
diff --git a/lftp-git.patch b/lftp-git.patch
deleted file mode 100644
index b5621c3..0000000
--- a/lftp-git.patch
+++ /dev/null
@@ -1,546 +0,0 @@
-diff --git a/doc/lftp.1 b/doc/lftp.1
-index f81ad01..0ad75be 100644
---- a/doc/lftp.1
-+++ b/doc/lftp.1
-@@ -41,7 +41,7 @@
- .fi
- .in
- ..
--.TH lftp 1 "08 Oct 2013"
-+.TH lftp 1 "15 Nov 2013"
- .SH NAME
- lftp \- Sophisticated file transfer program
- .SH SYNTAX
-@@ -58,7 +58,7 @@ lftp \- Sophisticated file transfer program
- .B lftp \-\-help
- 
- .SH VERSION
--This man page documents lftp version 4.4.10.
-+This man page documents lftp version 4.4.12.
- 
- .SH "DESCRIPTION"
- \fBlftp\fR is a file transfer program that allows sophisticated ftp, http
-@@ -261,12 +261,19 @@ command is used.
- .PP
- Alias for `wait'.
- 
--.B find
--.RI " [" directory "] "
-+.BR find " [" OPTS "] " \fIdirectory...\fP
- .PP
- List files in the directory (current directory by default) recursively.
- This can help with servers lacking ls \-R support. You can redirect output
--of this command.
-+of this command. Options:
-+.Sp
-+.in +0.5i
-+.TS
-+l1	l	lx	.
-+\-d \fIMD\fP,	\-\-max\-depth=\fIMD\fP	specify maximum scan depth
-+\-l,	\-\-list 	use long listing format
-+.TE
-+.PP
- 
- .BR ftpcopy
- .PP
-diff --git a/src/ChangeLog b/src/ChangeLog
-index dbd6879..dde2382 100644
---- a/src/ChangeLog
-+++ b/src/ChangeLog
-@@ -1,3 +1,18 @@
-+2013-11-25  Alexander V. Lukyanov <lavv17f at gmail.com>
-+
-+	* Http.cc: add debug message on chunk sizes; handle 400/501 codes
-+	  to turn off PROPFIND in ARRAY_INFO mode.
-+	* FileCopy.cc: clean up GetArrayInfo call condition, don't call it
-+	  if not needed.
-+	* OutputJob.cc: free input and output in PrepareToDie.
-+	* FileCopy.cc, FileCopy.h: add check for file size at EOF.
-+
-+2013-11-15  Alexander V. Lukyanov <lav at yars.free.net>
-+
-+	* FileCopy.cc: fixed spinning when GetArrayInfo gives an error.
-+	* commands.cc, FindJob.cc, FindJob.h, FileSet.h: add find -l (--ls)
-+	  option to show long listing.
-+
- 2013-11-11  Alexander V. Lukyanov <lav at yars.free.net>
- 
- 	* Torrent.cc: don't show verbose 100% peer completeness.
-diff --git a/src/FileCopy.cc b/src/FileCopy.cc
-index f195b95..8c0b977 100644
---- a/src/FileCopy.cc
-+++ b/src/FileCopy.cc
-@@ -345,6 +345,11 @@ int FileCopy::Do()
-       put_eof_pos=put->GetRealPos();
-       debug((10,"copy: waiting for put confirmation\n"));
-       set_state(CONFIRM_WAIT);
-+      if(!CheckFileSizeAtEOF())
-+      {
-+	 SetError(_("file size decreased during transfer"));
-+	 return MOVED;
-+      }
-       m=MOVED;
-    case(CONFIRM_WAIT):
-       if(put->Error())
-@@ -475,7 +480,7 @@ void FileCopy::LineBuffered(int s)
-    line_buffer_max=s;
- }
- 
--off_t FileCopy::GetPos()
-+off_t FileCopy::GetPos() const
- {
-    if(put)
-       return put->GetRealPos() - put->Buffered();
-@@ -484,14 +489,14 @@ off_t FileCopy::GetPos()
-    return 0;
- }
- 
--off_t FileCopy::GetSize()
-+off_t FileCopy::GetSize() const
- {
-    if(get)
-       return get->GetSize();
-    return NO_SIZE;
- }
- 
--int FileCopy::GetPercentDone()
-+int FileCopy::GetPercentDone() const
- {
-    if(!get || !put)
-       return 100;
-@@ -512,7 +517,7 @@ int FileCopy::GetPercentDone()
-       return -1;
-    return percent(ppos,psize);
- }
--const char *FileCopy::GetPercentDoneStr()
-+const char *FileCopy::GetPercentDoneStr() const
- {
-    int pct=GetPercentDone();
-    if(pct==-1)
-@@ -532,19 +537,19 @@ void FileCopy::RateReset()
-    rate->Reset();
-    rate_for_eta->Reset();
- }
--float FileCopy::GetRate()
-+float FileCopy::GetRate() const
- {
-    if(!rate->Valid() || !put)
-       return 0;
-    return rate->Get();
- }
--const char *FileCopy::GetRateStr()
-+const char *FileCopy::GetRateStr() const
- {
-    if(!rate->Valid() || !put)
-       return "";
-    return rate->GetStrS();
- }
--off_t FileCopy::GetBytesRemaining()
-+off_t FileCopy::GetBytesRemaining() const
- {
-    if(!get)
-       return 0;
-@@ -557,14 +562,14 @@ off_t FileCopy::GetBytesRemaining()
-    }
-    return get->range_limit-GetPos();
- }
--const char *FileCopy::GetETAStr()
-+const char *FileCopy::GetETAStr() const
- {
-    off_t b=GetBytesRemaining();
-    if(b<0 || !put)
-       return "";
-    return rate_for_eta->GetETAStrSFromSize(b);
- }
--long FileCopy::GetETA(off_t b)
-+long FileCopy::GetETA(off_t b) const
- {
-    if(b<0 || !rate_for_eta->Valid())
-       return -1;
-@@ -658,6 +663,23 @@ void FileCopy::SetRange(off_t s,off_t lim)
-    put->SetRange(s,lim);
- }
- 
-+bool FileCopy::CheckFileSizeAtEOF() const
-+{
-+   const long long size=GetSize();
-+   if(size==NO_SIZE || size==NO_SIZE_YET)
-+      return true;   // nothing to compare with.
-+
-+   long long range_limit=GetRangeLimit();
-+   if(range_limit==FILE_END)
-+      range_limit=size;
-+
-+   const long long pos=put_eof_pos;
-+   if(pos>=range_limit)
-+      return true;
-+
-+   debug((0,"expected pos=%lld, actual pos=%lld\n",range_limit,pos));
-+   return false;
-+}
- 
- // FileCopyPeer implementation
- #undef super
-@@ -786,21 +808,23 @@ int FileCopyPeerFA::Do()
-       return m;
-    }
- 
--   if((want_size && size==NO_SIZE_YET && (mode==PUT || !start_transfer))
--   || (want_date && date==NO_DATE_YET))
-+   // if we need some info and cannot start the transfer (yet),
-+   // then use ARRAY_INFO to fetch the file information.
-+   if(((want_size && size==NO_SIZE_YET) || (want_date && date==NO_DATE_YET))
-+   && (mode==PUT || !start_transfer) && session->IsClosed())
-+   {
-+      FileInfo *fi=new FileInfo(file);
-+      if(want_size)
-+	 fi->Need(fi->SIZE);
-+      if(want_date)
-+	 fi->Need(fi->DATE);
-+      info.Empty();
-+      info.Add(fi);
-+      session->GetInfoArray(&info);
-+      m=MOVED;
-+   }
-+   if(session->OpenMode()==FA::ARRAY_INFO)
-    {
--      if(session->IsClosed())
--      {
--	 FileInfo *fi=new FileInfo(file);
--	 if(want_size)
--	    fi->Need(fi->SIZE);
--	 if(want_date)
--	    fi->Need(fi->DATE);
--	 info.Empty();
--	 info.Add(fi);
--	 session->GetInfoArray(&info);
--	 m=MOVED;
--      }
-       res=session->Done();
-       if(res==FA::IN_PROGRESS)
- 	 return m;
-@@ -808,6 +832,7 @@ int FileCopyPeerFA::Do()
-       {
- 	 session->Close();
- 	 SetSize(NO_SIZE);
-+	 SetDate(NO_DATE);
- 	 return MOVED;
-       }
-       FileInfo *fi=info[0];
-diff --git a/src/FileCopy.h b/src/FileCopy.h
-index 3304365..86e80fd 100644
---- a/src/FileCopy.h
-+++ b/src/FileCopy.h
-@@ -187,23 +187,25 @@ private:
-    Ref<Buffer> line_buffer;
-    int  line_buffer_max;
- 
-+   bool CheckFileSizeAtEOF() const;
-+
- protected:
-    void RateAdd(int a);
-    void RateReset();
-    off_t bytes_count;
- 
- public:
--   off_t GetPos();
--   off_t GetSize();
--   int  GetPercentDone();
--   const char *GetPercentDoneStr();
--   float GetRate();
--   const char *GetRateStr();
--   off_t GetBytesRemaining();
--   long GetETA() { return GetETA(GetBytesRemaining()); }
--   long GetETA(off_t b);
--   const char *GetETAStr();
--   const char *GetETAStrSFromTime(time_t t) { return rate_for_eta->GetETAStrSFromTime(t); }
-+   off_t GetPos() const;
-+   off_t GetSize() const;
-+   int  GetPercentDone() const;
-+   const char *GetPercentDoneStr() const;
-+   float GetRate() const;
-+   const char *GetRateStr() const;
-+   off_t GetBytesRemaining() const;
-+   long GetETA() const { return GetETA(GetBytesRemaining()); }
-+   long GetETA(off_t b) const;
-+   const char *GetETAStr() const;
-+   const char *GetETAStrSFromTime(time_t t) const { return rate_for_eta->GetETAStrSFromTime(t); }
-    const char *GetStatus();
-    FgData *GetFgData(bool fg);
-    pid_t GetProcGroup();
-@@ -229,8 +231,8 @@ public:
-    void FailIfCannotSeek() { fail_if_cannot_seek=true; }
-    void SetRange(off_t s,off_t lim);
-    void SetRangeLimit(off_t lim) { get->range_limit=lim; }
--   off_t GetRangeStart() { return get->range_start; }
--   off_t GetRangeLimit() { return get->range_limit; }
-+   off_t GetRangeStart() const { return get->range_start; }
-+   off_t GetRangeLimit() const { return get->range_limit; }
-    void RemoveSourceLater() { remove_source_later=true; }
-    void RemoveTargetFirst() { remove_target_first=true; put->Resume(); put->RemoveFile(); }
-    void LineBuffered(int size=0x1000);
-diff --git a/src/FileSet.h b/src/FileSet.h
-index 51ccdf1..a2d69ae 100644
---- a/src/FileSet.h
-+++ b/src/FileSet.h
-@@ -89,6 +89,7 @@ public:
-    ~FileInfo();
- 
-    void SetName(const char *n) { name.set(n); def(NAME); }
-+   void SetName(const xstring& n) { name.set(n); def(NAME); }
-    void SetUser(const char *n);
-    void SetGroup(const char *n);
-    void LocalFile(const char *name, bool follow_symlinks);
-diff --git a/src/FindJob.cc b/src/FindJob.cc
-index b42f0b0..8275b0d 100644
---- a/src/FindJob.cc
-+++ b/src/FindJob.cc
-@@ -360,24 +360,36 @@ FinderJob::prf_res FinderJob_List::ProcessFile(const char *d,const FileInfo *fi)
-       fg_data=buf->GetFgData(fg);
-    if(buf->Size()>0x10000)
-       return PRF_LATER;
-+
-+   xstring path_to_show;
-    if(ProcessingURL())
-    {
-       FileAccess::Path old_cwd=session->GetCwd();
-       session->SetCwd(init_dir);
-       session->Chdir(dir_file(d,fi->name),false);
--      buf->Put(session->GetConnectURL());
-+      path_to_show.set(session->GetConnectURL());
-       session->SetCwd(old_cwd);
-    }
-    else
--      buf->Put(dir_file(d,fi->name));
-+      path_to_show.set(dir_file(d,fi->name));
-    if((fi->defined&fi->TYPE) && fi->filetype==fi->DIRECTORY && strcmp(fi->name,"/"))
--      buf->Put("/");
-+      path_to_show.append('/');
-+
-+   if(long_listing) {
-+      FileInfo n(*fi);
-+      n.SetName(path_to_show);
-+      n.MakeLongName();
-+      buf->Put(n.longname);
-+   } else {
-+      buf->Put(path_to_show);
-+   }
-+
-    buf->Put("\n");
-    return FinderJob::ProcessFile(d,fi);
- }
- 
- FinderJob_List::FinderJob_List(FileAccess *s,ArgV *a,FDStream *o)
--   : FinderJob(s), args(a)
-+   : FinderJob(s), args(a), long_listing(false)
- {
-    if(o)
-       buf=new IOBufferFDStream(o,IOBuffer::PUT);
-diff --git a/src/FindJob.h b/src/FindJob.h
-index a6767a3..6d88b49 100644
---- a/src/FindJob.h
-+++ b/src/FindJob.h
-@@ -117,12 +117,14 @@ class FinderJob_List : public FinderJob
- {
-    SMTaskRef<IOBuffer> buf;
-    Ref<ArgV> args;
-+   bool long_listing;
- protected:
-    prf_res ProcessFile(const char *d,const FileInfo *fi);
-    void Finish();
- 
- public:
-    FinderJob_List(FileAccess *s,ArgV *a,FDStream *o);
-+   void DoLongListing(bool yes=true) { long_listing=yes; }
- 
-    int Done() { return FinderJob::Done() && buf->Done(); }
- };
-diff --git a/src/Http.cc b/src/Http.cc
-index 1b6495d..d0eb857 100644
---- a/src/Http.cc
-+++ b/src/Http.cc
-@@ -64,6 +64,8 @@ CDECL char *strptime(const char *buf, const char *format, struct tm *tm);
- #define EINPROGRESS -1
- #endif
- 
-+enum { CHUNK_SIZE_UNKNOWN=-1 };
-+
- Http::Connection::Connection(int s,const char *c)
-    : closure(c), sock(s)
- {
-@@ -103,7 +105,7 @@ void Http::Init()
-    array_send=0;
- 
-    chunked=false;
--   chunk_size=-1;
-+   chunk_size=CHUNK_SIZE_UNKNOWN;
-    chunk_pos=0;
-    chunked_trailer=false;
- 
-@@ -190,7 +192,7 @@ void Http::ResetRequestData()
-    keep_alive_max=-1;
-    array_send=fileset_for_info?fileset_for_info->curr_index():0;
-    chunked=false;
--   chunk_size=-1;
-+   chunk_size=CHUNK_SIZE_UNKNOWN;
-    chunk_pos=0;
-    chunked_trailer=false;
-    propfind=0;
-@@ -688,7 +690,7 @@ void Http::SendRequest(const char *connection,const char *f)
- 
-    keep_alive=false;
-    chunked=false;
--   chunk_size=-1;
-+   chunk_size=CHUNK_SIZE_UNKNOWN;
-    chunk_pos=0;
-    chunked_trailer=false;
-    inflate=0;
-@@ -864,7 +866,7 @@ void Http::HandleHeaderLine(const char *name,const char *value)
-       if(!strcasecmp(value,"chunked"));
-       {
- 	 chunked=true;
--	 chunk_size=-1;	// to indicate "before first chunk"
-+	 chunk_size=CHUNK_SIZE_UNKNOWN;	  // expecting first chunk
- 	 chunk_pos=0;
- 	 chunked_trailer=false;
-       }
-@@ -1337,6 +1339,15 @@ int Http::Do()
- 	       }
- 	       if(mode==ARRAY_INFO)
- 	       {
-+		  if((status_code==400 || status_code==501)
-+		  && !xstrcmp(last_method,"PROPFIND"))
-+		  {
-+		     ResMgr::Set("http:use-propfind",hostname,"no");
-+		     use_propfind_now=false;
-+		     try_time=0;
-+		     Disconnect();
-+		     return MOVED;
-+		  }
- 		  // we'll have to receive next header
- 		  status.set(0);
- 		  status_code=0;
-@@ -1566,8 +1577,7 @@ int Http::Do()
- 		  if(!xstrcmp(last_method,"MKCOL"))
- 		     ResMgr::Set("http:use-mkcol",hostname,"no");
- 	       }
--	       if((mode==CHANGE_DIR || mode==ARRAY_INFO)
--	       && !xstrcmp(last_method,"PROPFIND"))
-+	       if(mode==CHANGE_DIR && !xstrcmp(last_method,"PROPFIND"))
- 	       {
- 		  use_propfind_now=false;
- 		  try_time=0;
-@@ -1776,7 +1786,7 @@ get_again:
-       if(chunked_trailer && state==RECEIVING_HEADER)
- 	 return DO_AGAIN;
-       const char *nl;
--      if(chunk_size==-1) // expecting first/next chunk
-+      if(chunk_size==CHUNK_SIZE_UNKNOWN) // expecting first/next chunk
-       {
- 	 nl=(const char*)memchr(buf1,'\n',size1);
- 	 if(nl==0)  // not yet
-@@ -1794,6 +1804,7 @@ get_again:
- 	 }
- 	 conn->recv_buf->Skip(nl-buf1+1);
- 	 chunk_pos=0;
-+	 LogNote(9,"next chunk size: %ld",chunk_size);
- 	 goto get_again;
-       }
-       if(chunk_size==0) // eof
-@@ -1815,7 +1826,7 @@ get_again:
- 	    return FATAL;
- 	 }
- 	 conn->recv_buf->Skip(2);
--	 chunk_size=-1;
-+	 chunk_size=CHUNK_SIZE_UNKNOWN;
- 	 goto get_again;
-       }
-       // ok, now we may get portion of data
-diff --git a/src/OutputJob.cc b/src/OutputJob.cc
-index fc09524..ebaa090 100644
---- a/src/OutputJob.cc
-+++ b/src/OutputJob.cc
-@@ -228,7 +228,7 @@ OutputJob::OutputJob(const char *path, const char *a0, FileAccess *fa0)
-    Init(a0);
- }
- 
--OutputJob::~OutputJob()
-+void OutputJob::PrepareToDie()
- {
-    Bg();
-    AcceptSig(SIGTERM);
-@@ -236,6 +236,10 @@ OutputJob::~OutputJob()
-    Delete(input);
-    if(input != output)
-       Delete(output);
-+   input=0;
-+   output=0;
-+
-+   super::PrepareToDie();
- }
- 
- /* This is called to ask us "permission" to display a status line. */
-diff --git a/src/OutputJob.h b/src/OutputJob.h
-index f925b01..99e3292 100644
---- a/src/OutputJob.h
-+++ b/src/OutputJob.h
-@@ -71,7 +71,7 @@ class OutputJob : public Job
- public:
-    OutputJob(FDStream *output, const char *a0);
-    OutputJob(const char *path, const char *a0, FA *fa=0);
--   ~OutputJob();
-+   void PrepareToDie();
- 
-    /* Set the main filter: */
-    void SetFilter(const char *f) { filter.set(f); }
-diff --git a/src/commands.cc b/src/commands.cc
-index 6c24185..d70a7bc 100644
---- a/src/commands.cc
-+++ b/src/commands.cc
-@@ -2850,13 +2850,15 @@ CMD(find)
-    static struct option find_options[]=
-    {
-       {"maxdepth",required_argument,0,'d'},
-+      {"ls",no_argument,0,'l'},
-       {0,0,0,0}
-    };
-    int opt;
-    int maxdepth = -1;
-+   bool long_listing=false;
-    const char *op=args->a0();
- 
--   while((opt=args->getopt_long("+d:",find_options))!=EOF)
-+   while((opt=args->getopt_long("+d:l",find_options))!=EOF)
-    {
-       switch(opt)
-       {
-@@ -2868,6 +2870,9 @@ CMD(find)
- 	 }
- 	 maxdepth = atoi(optarg);
- 	 break;
-+      case 'l':
-+	 long_listing=true;
-+	 break;
-       case '?':
- 	 eprintf(_("Usage: %s [-d #] dir\n"),op);
- 	 return 0;
-@@ -2878,6 +2883,7 @@ CMD(find)
-       args->Append(".");
-    FinderJob_List *j=new class FinderJob_List(session->Clone(),args.borrow(),output.borrow());
-    j->set_maxdepth(maxdepth);
-+   j->DoLongListing(long_listing);
-    return j;
- }
- 
-diff --git a/src/ftpclass.cc b/src/ftpclass.cc
-index 72cc04e..09d39ad 100644
---- a/src/ftpclass.cc
-+++ b/src/ftpclass.cc
-@@ -2743,6 +2743,7 @@ int Ftp::ReceiveOneLine()
-       if(nl==resp+resp_size-1 && now-conn->control_recv->EventTime()>5)
-       {
- 	 LogError(1,"server bug: single <NL>");
-+	 nl=find_char(resp,resp_size,'\n');
- 	 line_len=nl-resp;
- 	 skip_len=nl-resp+1;
- 	 break;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lftp.git/commitdiff/266a4ef0960a9a1dad241e7ed98a37017cee48ce



More information about the pld-cvs-commit mailing list