This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] setup.exe & different archives for the same version of the app


<grumpy old-man voice>
1. I believe this problem is a non-issue.  If setup.ini doesn't match the 
actual file layout, it's a maintainer error.  Pkg. maintainer should fix it.

2. If somebody changed packaging from .gz to .bz2 without bumping the 
release number, it was a mistake.  Easily fixable -- maintainer should 
release new version.

3. didn;t we already have a huge discussion about this whole 
.tar.gz/.tar.bz2/.tgz/.tbz file-extension auto-recognize issue?  Doesn't 
the patch below implement *exactly* the thing we decided *NOT* to do? 
Whatever happened to the "stream-based processing" idea?
</grumpy old-man voice>

--Chuck


Pavel Tsekov wrote:

> Robert Collins wrote:
> 
>>On Fri, 2001-11-02 at 20:32, Ronald Landheer wrote:
>>
>>
>>>I agree that it's bad practice on the maintainers behalf, but I think
>>>Setup should be able to handle it anyway: either it should not offer a
>>>package it won't be able to unpack, or it should be able to unpack
>>>anything it offers (regardless of whether it's .gz or .bz2, and
>>>regardless of where it happens to live: if found & offered, make good
>>>the offer).
>>>
>>Granted. I just have no motivation to fix it, but if you have the time,
>>or someone else does, I won't object to patches that address this
>>cleanly.
>>
>  
> See the applied patch :) Hope this will fix the problem :)
> 
> * install.cc (install_one): Checks for the existence of the tarball
> based on a set
> of well-known package extensions.
> * filemanip.h (known_file_types): Declaration of a new global variable,
> containing
> a set of known file extensions for packages handled by setup.exe.
> * choose.cc (known_file_types): A new global variable, containing a set
> of known
> file extensions for packages handled by setup.exe
> 
> 
> ------------------------------------------------------------------------
> 
> --- /tmp/choose.cc	Fri Nov  2 15:13:20 2001
> +++ choose.cc	Fri Nov  2 15:15:37 2001
> @@ -71,6 +71,12 @@ static HDC bitmap_dc;
>  static view *chooser = NULL;
>  static trusts deftrust = TRUST_UNKNOWN;
>  
> +char *known_file_types[] = {
> +  "tar.gz",
> +  "tar.bz2",
> +  0
> +};
> +
>  static struct _header pkg_headers[] = {
>    {"Current", 7, 0, 0},
>    {"New", 3, 0, 0},
> 
> 
> ------------------------------------------------------------------------
> 
> --- /tmp/install.cc	Fri Nov  2 15:01:21 2001
> +++ install.cc	Fri Nov  2 15:06:24 2001
> @@ -300,17 +300,27 @@ install_one (Package *pkg, bool isSrc)
>  
>    char name[strlen (pkg->name) + strlen (extra) + 1];
>    strcat (strcpy (name, pkg->name), extra);
> -  
> -  char *basef = base (file);
> -  SetWindowText (ins_pkgname, basef);
>  
> -  if (!exists (file))
> -    file = basef;
> -  if (!exists (file))
> +  char file_buf[MAX_PATH + 1];
> +  int file_exists = 0;
> +  int ext = find_tar_ext(file) + 1;
> +  strncpy (file_buf, file, ext);
> +  filebuf[ext] = '\0';
> +  file = (char *) &file_buf;
> +  char *basef = base (file);
> +  
> +  for (int c = 0; !file_exists && known_file_types[c]; c++)
> +    {
> +      strcpy ((char *) &file_buf[ext], known_file_types[c]);
> +      file_exists = exists (file) || exists (basef);
> +    }
> +  if (!file_exists)
>      {
>        note (IDS_ERR_OPEN_READ, file, "No such file");
>        return 1;
>      }
> +  else
> +    SetWindowText (ins_pkgname, basef);
>  
>    gzFile lst = gzopen (cygpath ("/etc/setup/", name, ".lst.gz", 0),
>  		       "wb9");
> 
> 
> ------------------------------------------------------------------------
> 
> --- /tmp/filemanip.h	Fri Nov  2 15:11:50 2001
> +++ filemanip.h	Fri Nov  2 14:42:53 2001
> @@ -13,6 +13,8 @@
>   *
>   */
>  
> +extern char *known_file_types[];
> +
>  extern int find_tar_ext (const char *path);
>  
>  typedef struct
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
> choose.cc.diff
> 
> Content-Type:
> 
> text/plain
> Content-Encoding:
> 
> 7bit
> 
> 
> ------------------------------------------------------------------------
> install.cc.diff
> 
> Content-Type:
> 
> text/plain
> Content-Encoding:
> 
> 7bit
> 
> 
> ------------------------------------------------------------------------
> filemanip.h.diff
> 
> Content-Type:
> 
> text/plain
> Content-Encoding:
> 
> 7bit
> 
> 
> ------------------------------------------------------------------------
> Part 1.5
> 
> Content-Type:
> 
> text/plain
> 
> 



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]