3 more bugs
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:55:11 +0000 (16:55 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:55:11 +0000 (16:55 +0000)
Author: jgg
Date: 1999-11-16 03:16:34 GMT
3 more bugs

apt-pkg/acquire-method.cc
cmdline/acqprogress.cc
cmdline/apt-get.cc
configure.in
debian/changelog
dselect/install

index 5b7251a..55d2b75 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acquire-method.cc,v 1.21 1999/10/18 00:37:35 jgg Exp $
+// $Id: acquire-method.cc,v 1.22 1999/11/16 03:16:34 jgg Exp $
 /* ######################################################################
 
    Acquire Method
@@ -92,7 +92,7 @@ void pkgAcqMethod::Fail(string Err,bool Transient)
    char S[1024];
    if (Queue != 0)
    {
-      snprintf(S,sizeof(S),"400 URI Failure\nURI: %s\n"
+      snprintf(S,sizeof(S)-50,"400 URI Failure\nURI: %s\n"
               "Message: %s\n",Queue->Uri.c_str(),Err.c_str());
 
       // Dequeue
@@ -103,7 +103,7 @@ void pkgAcqMethod::Fail(string Err,bool Transient)
         QueueBack = Queue;
    }
    else
-      snprintf(S,sizeof(S),"400 URI Failure\nURI: <UNKNOWN>\n"
+      snprintf(S,sizeof(S)-50,"400 URI Failure\nURI: <UNKNOWN>\n"
               "Message: %s\n",Err.c_str());
       
    // Set the transient flag 
@@ -129,14 +129,14 @@ void pkgAcqMethod::URIStart(FetchResult &Res)
    
    End += snprintf(S,sizeof(S),"200 URI Start\nURI: %s\n",Queue->Uri.c_str());
    if (Res.Size != 0)
-      End += snprintf(End,sizeof(S) - (End - S),"Size: %lu\n",Res.Size);
+      End += snprintf(End,sizeof(S)-4 - (End - S),"Size: %lu\n",Res.Size);
    
    if (Res.LastModified != 0)
-      End += snprintf(End,sizeof(S) - (End - S),"Last-Modified: %s\n",
+      End += snprintf(End,sizeof(S)-4 - (End - S),"Last-Modified: %s\n",
                      TimeRFC1123(Res.LastModified).c_str());
    
    if (Res.ResumePoint != 0)
-      End += snprintf(End,sizeof(S) - (End - S),"Resume-Point: %lu\n",
+      End += snprintf(End,sizeof(S)-4 - (End - S),"Resume-Point: %lu\n",
                      Res.ResumePoint);
       
    strcat(End,"\n");
@@ -158,20 +158,20 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt)
    End += snprintf(S,sizeof(S),"201 URI Done\nURI: %s\n",Queue->Uri.c_str());
 
    if (Res.Filename.empty() == false)
-      End += snprintf(End,sizeof(S) - (End - S),"Filename: %s\n",Res.Filename.c_str());
+      End += snprintf(End,sizeof(S)-50 - (End - S),"Filename: %s\n",Res.Filename.c_str());
    
    if (Res.Size != 0)
-      End += snprintf(End,sizeof(S) - (End - S),"Size: %lu\n",Res.Size);
+      End += snprintf(End,sizeof(S)-50 - (End - S),"Size: %lu\n",Res.Size);
    
    if (Res.LastModified != 0)
-      End += snprintf(End,sizeof(S) - (End - S),"Last-Modified: %s\n",
+      End += snprintf(End,sizeof(S)-50 - (End - S),"Last-Modified: %s\n",
                      TimeRFC1123(Res.LastModified).c_str());
 
    if (Res.MD5Sum.empty() == false)
-      End += snprintf(End,sizeof(S) - (End - S),"MD5-Hash: %s\n",Res.MD5Sum.c_str());
+      End += snprintf(End,sizeof(S)-50 - (End - S),"MD5-Hash: %s\n",Res.MD5Sum.c_str());
 
    if (Res.ResumePoint != 0)
-      End += snprintf(End,sizeof(S) - (End - S),"Resume-Point: %lu\n",
+      End += snprintf(End,sizeof(S)-50 - (End - S),"Resume-Point: %lu\n",
                      Res.ResumePoint);
 
    if (Res.IMSHit == true)
@@ -181,17 +181,17 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt)
    if (Alt != 0)
    {
       if (Alt->Filename.empty() == false)
-        End += snprintf(End,sizeof(S) - (End - S),"Alt-Filename: %s\n",Alt->Filename.c_str());
+        End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-Filename: %s\n",Alt->Filename.c_str());
       
       if (Alt->Size != 0)
-        End += snprintf(End,sizeof(S) - (End - S),"Alt-Size: %lu\n",Alt->Size);
+        End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-Size: %lu\n",Alt->Size);
       
       if (Alt->LastModified != 0)
-        End += snprintf(End,sizeof(S) - (End - S),"Alt-Last-Modified: %s\n",
+        End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-Last-Modified: %s\n",
                         TimeRFC1123(Alt->LastModified).c_str());
       
       if (Alt->MD5Sum.empty() == false)
-        End += snprintf(End,sizeof(S) - (End - S),"Alt-MD5-Hash: %s\n",
+        End += snprintf(End,sizeof(S)-50 - (End - S),"Alt-MD5-Hash: %s\n",
                         Alt->MD5Sum.c_str());
       
       if (Alt->IMSHit == true)
@@ -385,10 +385,10 @@ void pkgAcqMethod::Log(const char *Format,...)
 
    // sprintf the description
    char S[1024];
-   unsigned int Len = snprintf(S,sizeof(S),"101 Log\nURI: %s\n"
+   unsigned int Len = snprintf(S,sizeof(S)-4,"101 Log\nURI: %s\n"
                               "Message: ",CurrentURI.c_str());
 
-   vsnprintf(S+Len,sizeof(S)-Len,Format,args);
+   vsnprintf(S+Len,sizeof(S)-4-Len,Format,args);
    strcat(S,"\n\n");
    
    if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S))
@@ -409,10 +409,10 @@ void pkgAcqMethod::Status(const char *Format,...)
 
    // sprintf the description
    char S[1024];
-   unsigned int Len = snprintf(S,sizeof(S),"102 Status\nURI: %s\n"
+   unsigned int Len = snprintf(S,sizeof(S)-4,"102 Status\nURI: %s\n"
                               "Message: ",CurrentURI.c_str());
 
-   vsnprintf(S+Len,sizeof(S)-Len,Format,args);
+   vsnprintf(S+Len,sizeof(S)-4-Len,Format,args);
    strcat(S,"\n\n");
    
    if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S))
@@ -428,4 +428,3 @@ pkgAcqMethod::FetchResult::FetchResult() : LastModified(0),
 {
 }
                                                                        /*}}}*/
-
index 2f7a9c4..0eb8d4b 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acqprogress.cc,v 1.18 1999/10/18 03:18:40 jgg Exp $
+// $Id: acqprogress.cc,v 1.19 1999/11/16 03:16:34 jgg Exp $
 /* ######################################################################
 
    Acquire Progress - Command line progress meter 
@@ -145,10 +145,12 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
    
    enum {Long = 0,Medium,Short} Mode = Long;
    
-   char Buffer[300];
+   char Buffer[1024];
    char *End = Buffer + sizeof(Buffer);
    char *S = Buffer;
-   
+   if (ScreenWidth >= sizeof(Buffer))
+      ScreenWidth = sizeof(Buffer)-1;
+
    // Put in the percent done
    sprintf(S,"%ld%%",long(double((CurrentBytes + CurrentItems)*100.0)/double(TotalBytes+TotalItems)));
 
index 217239b..0dd396a 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-get.cc,v 1.87 1999/10/28 05:54:45 jgg Exp $
+// $Id: apt-get.cc,v 1.88 1999/11/16 03:16:34 jgg Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -1228,6 +1228,13 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
 /* */
 bool DoClean(CommandLine &CmdL)
 {
+   if (_config->FindB("APT::Get::Simulate") == true)
+   {
+      cout << "Del " << _config->FindDir("Dir::Cache::archives") << "* " <<
+        _config->FindDir("Dir::Cache::archives") << "partial/*" << endl;
+      return true;
+   }
+   
    // Lock the archive directory
    FileFd Lock;
    if (_config->FindB("Debug::NoLocking",false) == false)
index 9f12f47..5865e4c 100644 (file)
@@ -17,7 +17,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
 
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.3.14")
+AC_DEFINE_UNQUOTED(VERSION,"0.3.14.1")
 AC_DEFINE_UNQUOTED(PACKAGE,"apt")
 
 dnl Tom's host stuff
index 8df5806..5c5b17c 100644 (file)
@@ -1,3 +1,12 @@
+apt (0.3.14.1) unstable; urgency=low
+
+  * Added DSelect::WaitAfterDownload Closes: #49549
+  * Fixed cast error in byteswap macro and supporting code. Closes: #50093
+  * Fixed buffer overflow for wide terminal sizes. Closes: #50295
+  * Made -s and clean not do anything. Closes: #50238
+  
+ -- Ben Gertzfield <che@debian.org>  Sun,  7 Nov 1999 20:21:25 -0800
+  
 apt (0.3.14) unstable; urgency=low
 
   * Fix Perl or group pre-depends thing Closes: #46091, #46096, #46233, #45901
index 9e43438..0806f7b 100755 (executable)
@@ -8,7 +8,8 @@ DPKG="/usr/bin/dpkg"
 set -e
 RES=`apt-config shell CLEAN DSelect::Clean OPTS DSelect::Options \
                       DPKG Dir::Bin::dpkg APTGET Dir::Bin::apt-get \
-                     ARCHIVES Dir::Cache::Archives/`
+                     ARCHIVES Dir::Cache::Archives/ \
+                     WAIT DSelect::WaitAfterDownload`
 eval $RES
 set +e
 
@@ -38,8 +39,15 @@ yesno() {
        echo $ans | tr YN yn
 }
 
-$APTGET $OPTS dselect-upgrade
-RES=$?
+if [ x$WAIT = "xyes" ]; then
+   $APTGET $OPTS -d dselect-upgrade
+   echo "Press enter to continue." && read RES
+   $APTGET $OPTS dselect-upgrade
+   RES=$?
+else
+   $APTGET $OPTS dselect-upgrade
+   RES=$?
+fi
 
 # 1 means the user choose no at the prompt
 if [ $RES -eq 1 ]; then