b0VIM 4.2      5®52HÞ   root                                    porky                                   /mnt/intel/misc/src/install/pkgs.c                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  3210#"! U                                                                                                                                                                                                                                                                                                      #endif  int pkgCompare(void * first, void * second); /* upgrade code uses this for bsearch */  void psFreeComponentSet(struct componentSet * csp); 			 struct componentSet * csp); int psReadComponentsFile(char * filespec, struct pkgSet * psp,  			 int goForward, int isUpgrade); int psSelectPackages(struct pkgSet * psp, struct componentSet * csp, int psFromHeaderList(char * file, struct pkgSet * psp); int psUsingDirectory(char * dir, struct pkgSet * psp); int psVerifyDependencies(struct pkgSet * psp, int fixup);  } ;     int numComponents;     struct component * preskel, * base;     struct component * comps; struct componentSet {  };     struct pkgSet ps;     int inmenu;     int selected;     char * name; struct component {  };     int numPackages;     struct packageInfo ** packages; struct pkgSet {  } ; 			/* install methods */     void * data;	/* this points to different things for different */     int size;     char inmenu;     char selected;     char * name, * group;     Header h; struct packageInfo {  #include <rpmlib.h>  #define H_PKGS #ifndef H_PKGS   ¸  1
@1
@l  0ï	\         ¶U (   �  1
@1
@ .        ..       ,    lost+found w  ù  8    var   á  D    etc   Ñ/  P    lib   É7  \    mnt f Á?  h    usr agy‡  t    bin inq�  €    boot  i—  Œ    dev   Q¯  ˜    home  9Ç  ¤    proc 21Ï  °    root e)×  ¼    sbin a!ß  È    tmp re›Ÿ  Ô    ftp   e   à    core  o0  ô    .automount    …       opt   c×     net   ÷‡     junk    Ò  Ñ  Ä  ¸  {  p  A  (    Õ  Í  Ì  §    U  $  å  ä  ¤  o  V  %    ð  ï  Ñ  ¥  š  n  m  .           			&count)) { 		    if (!getEntry(h, RPMTAG_GROUP, &type, (void **) &group,   			ps.packages[ps.numPackages]->inmenu = 1; 		    else 			ps.packages[ps.numPackages]->inmenu = 0; 		    if (skipPackage(name))   			ps.packages[ps.numPackages]->size = 0; 		    else 			ps.packages[ps.numPackages]->size = *sizeptr; 				  &sizeptr, &count)) 		    if (getEntry(h, RPMTAG_SIZE, &type, (void **)  		    getEntry(h, RPMTAG_NAME, &type, (void **) &name, &count);  		    ps.packages[ps.numPackages]->data = strdup(ent->d_name); 		    ps.packages[ps.numPackages]->selected = 0; 		    ps.packages[ps.numPackages]->h = h; 				malloc(sizeof(struct packageInfo)); 		    ps.packages[ps.numPackages] =   		    } 				sizeof(*ps.packages) * packagesAlloced); 			ps.packages = realloc(ps.packages, 			packagesAlloced += 5; 		    if (ps.numPackages == packagesAlloced) { 		} else { 		    logMessage("failed to pkgReadHeaer %s:", ent->d_name); 		if (rc) { 		close(fd);  		rc = pkgReadHeader(fd, &h, &isSource, NULL, NULL); 	    } else { 			   strerror(errno)); 		logMessage("failed to open %s: %s", ent->d_name,  	    if (fd < 0) {  	    fd8  1
@1
@>d_name, O_RDONLY); 	    ((ent->tp
 ÿ 
@               h            ™   ‚         „           š   Ÿ        k   9           ¡     	   ‘   ¸     
   |   I           Å     );      } 	return INST_ERROR; 	closedir(dir); 	errorWindow("error reading from directory"); 	free(ps.packages);     if (errno) {     ent = readdir(dir);     errno = 0;      } 	return INST_ERROR; 	errorWindow("error opening directory");     if (!dir) {     dir = opendir(dirname);     logMessage("scanning %s for packages", dirname);      ps.packages = malloc(sizeof(*ps.packages) * packagesAlloced);     packagesAlloced = 5;     ps.numPackages = 0;      char * name, * group;     unsigned int * sizeptr;     int count, type;     struct pkgSet ps;     int packagesAlloced;     Header h;     int fd, rc, isSource;     struct dirent * ent;     DIR * dir; int psUsingDirectory(char * dirname, struct pkgSet * psp) {  };     return strcmp((*a)->name, (*b)->name);      if (!(*b)->name) return -1;     if (!(*a)->name) return 1;     /* put packages w/o names at the end */      struct packageInfo ** b = second;     struct packageInfo ** a = first; int pkgCompare(void * first, void * second) {  }     return strcmp(*one, *two);      const char * const * two = b;     const char * const * one = a; static int strptrCmp(const void * a, const void * b) {  		      NULL }; 		      "XFree86-SVGA", "XFree86-VGA16", "XFree86-W32", 		      "XFree86-P9000", "XFree86-S3", "XFree86-S3", 		      "XFree86-Mach64", "XFree86-Mach8", "XFree86-Mono", char * skipList[] = { "XFree86-8514", "XFree86-AGX", "XFree86-Mach32",  static int queryIndividual(int * result); static void showPackageInfo(Header h, unsigned int * kSelected); static int strptrCmp(const void * a, const void * b); static int selectComponents(struct componentSet * csp, int * doIndividual); static int skipPackage(char * name); 				unsigned int * kSelected); static int selectPackagesWindow(struct pkgSet * psp, char * group, static int selectPackagesByGroup(struct pkgSet * psp);  #define FILENAME_TAG 1000000  #include "windows.h" #include "pkgs.h" #include "log.h" #include "install.h" #include "hash.h"  #include <unistd.h> #include <sys/types.h> #include <string.h> #include <stdlib.h> #include <rpmlib.h> #include <newt.h> #include <fcntl.h> #include <errno.h> #include <dirent.h> #include <ctype.h> #include <alloca.h>     °  1
@1
@ÿ	D   l
 if (states[i] !ˆ  1
@1
@rything != ' ')    \
val,  #ið       Ä 
T 
‰  8                                                                                                                                                                                                                      defi        ˆ  Š      t 
   tic    € 
ctPaD       checkbox = newtCheckbox(6, 3 + row++, "Everything", val,  w(ð   dÿ	
´
                                                                                                                                                                                                                         tic         Ÿ  ¡      Ô
   h, u   à
int 4   	    if (states[i] != ' ' || everything != ' ') ð   Ä 
P

                                                                                                                                                                                                                         6-W3        Ÿ  ¡      $
   int    0
p(co    	    if (states[i] != ' ' { ð   
`
@
©                                                                                                                                                                                                                        pack        ©  ­      e en        ð   P
Œ
P
«                                                                                                                                                                                                                          He        «  ­      ages    ced;   À
}  (   À
ng) {  ið   `
ø
|
«                                                                    ad
@  �        ì  Ù  Å  ²  Ÿ  �  y  e  Q  :  &  %    þ  í  Û  Æ  Å  ¨  §  p  -    é  �  �  H  G     Å  �  X  H  G    î  Ì  Ë  ¬  ª  ©  {  V  0  /    ä
  Ä
  Ã
  ˜
  •
  ”
  X
  I
  0
  
  
  ï	  Ù	  Ä	  ¨	  Ž	  �	  u	  \	  	  	  ä  È  ¸  �  {  u  t  e  M  <  (  ú  ê  Ö  Ð  Ï  »  º  w  v  d  (  è  Á  À  ­  y  a  S          Ç  ¼  �  t  N  !      ó  Ë  ¡  p  1  0  ð  »  ¢  q  f  <  ;    ñ  æ  º  ¹  z  l       wtF 			&count)) { 		    if (!getEntry(h, RPMTAG_GROUP, &type, (void **) &group, 			&count)) { 		    if (!getEntry(h, RPMTAG_GROUP, &type, (void **) &group,   			ps.packages[ps.numPackages]->inmenu = 1; 		    else 			ps.packages[ps.numPackages]->inmenu = 0; 		    if (skipPackage(name))   			ps.packages[ps.numPackages]->size = 0; 		    else 			ps.packages[ps.numPackages]->size = *sizeptr; 				  &sizeptr, &count)) 		    if (getEntry(h, RPMTAG_SIZE, &type, (void **)  		    getEntry(h, RPMTAG_NAME, &type, (void **) &name, &count);  		    ps.packages[ps.numPackages]->data = strdup(ent->d_name); 		    ps.packages[ps.numPackages]->selected = 0; 		    ps.packages[ps.numPackages]->h = h; 				malloc(sizeof(struct packageInfo)); 		    ps.packages[ps.numPackages] =   		    } 				sizeof(*ps.packages) * packagesAlloced); 			ps.packages = realloc(ps.packages, 			packagesAlloced += 5; 		    if (ps.numPackages == packagesAlloced) { 		} else { 		    logMessage("failed to pkgReadHeaer %s:", ent->d_name); 		if (rc) { 		close(fd);  		rc = pkgReadHeader(fd, &h, &isSource, NULL, NULL); 	    } else { 			   strerror(errno)); 		logMessage("failed to open %s: %s", ent->d_name,  	    if (fd < 0) {  	    fd = open(ent->d_name, O_RDONLY); 	    ((ent->d_name[1] == '.') && (ent->d_name[2] == '\0'))))) { 	if (!(ent->d_name[0] == '.' && (ent->d_name[1] == '\0' ||      while (ent) {      winStatus(33, 3, "Running", "Scanning available packages...");      chdir(dirname);      } 	return INST_ERROR; 	closedir(dir); 	errorWindow("error reading from directory"); 	free(ps.packages);     if (errno) {     ent = readdir(dir);     errno = 0;      } 	return INST_ERROR; 	errorWindow("error opening directory");     if (!dir) {     dir = opendir(dirname);     logMessage("scanning %s for packages", dirname);      ps.packages = malloc(sizeof(*ps.packages) * packagesAlloced);     packagesAlloced = 5;     ps.numPackages = 0;      char * name, * group;     unsigned int * sizeptr;     int count, type;     struct pkgSet ps;     int packagesAlloced;     Header h;     int fd, rc, isSource;     struct dirent * ent;     DIR * dir; int psUsingDirectory(char * dirname, struct pkgSet * psp) {  };     return strcmp((*a)->name, (*b)->name);      if (!(*b)->name) return -1;     if (!(*a)->name) return 1;     /* put packages w/o names at the end */      struct packageInfo ** b = second;     struct packageInfo ** a = first; int pkgCompare(void * first, void * second) {  }     return strcmp(*one, *two);      const char * const * two = b;     const char * const * one = a; static int strptrCmp(const void * a, const void * b) {  		      NULL }; 		      "XFree86-SVGA", "XFree86-VGA16", "XFree86-W32", 		      "XFree86-P9000", "XFree86-S3", "XFree86-S3", 		      "XFree86-Mach64", "XFree86-Mach8", "XFree86-Mono", char * skipList[] = { "XFree86-8514", "XFree86-AGX", "XFree86-Mach32",  static int queryIndividual(int * result); stint * doIndiv			    int * doIndividual); static int selectComponents(struct componentSet * csp, struct pkgSet * psp, static int skipPackage(char * name); 				unsigned int * kSelected); static int selectPackagesWindow(struct pkgSet * psp, char * group, static int selectPackagesByGroup(struct pkgSet * psp);  #define FILENAME_TAG 1000000  #include "windows.h" #include "pkgs.h" #include "log.h" #include "install.h" #include "hash.h"  #include <unistd.h> #include <sys/types.h> #include <string.h> #include <stdlib.h> #include <rpmlib.h> #include <newt.h> #include <fcntl.h> #include <errno.h> #include <dirent.h> #include <ctype.h> #include <alloca.h> ad    Ë        å  Ð  Ï  ‚  t  =       õ  ã  Ý  Ü  Í  Ë  Ê                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             }     return rc;      } 	    *result = 1; 	else if (answer.u.co == yes) 	    rc = 1; 	if (answer.u.co == cancel)      } else if (answer.reason == NEWT_EXIT_COMPONENT) { 	*result = 1;     if (answer.reason == NEWT_EXIT_HOTKEY && answer.u.key == NEWT_KEY_F12) {      newtPopWindow();     newtFormDestroy(form); ad  *  ê     k   È  ª  l  2  û  ú  ¿  š  o  9  ü  Ô  ´  n  N  
  æ  å  Å  Ä  ©  ”  “  w  e  P  J  I  (    Ô  «  ¨  ¢  ¡  Œ  ‡  y  u  t  (    ý
  ¶
  ˆ
  u
  h
  g
  3
  2
  ÷	  ö	  º	  ¹	  •	  ”	  d	  =	   	  â  á  °  ‰  d  &  ý  ü  Ä  §  †  y  o  b  a      Ñ  È  ²  ¬  «  m  R  #  "  ß  «  ª  …  Z  Y      î  í  Ò  ½  ¼  Ž  �  \  [  >    ñ  ë  ê  ž  —  u  t  ?    ï  è  å  ß  Þ  Ð  Î  Í  ˜  �  l  k  P           for (i = 0; i < csp->numComponents; i++, currcomp++) {     currcomp = csp->comps;      struct component * currcomp;     int i; void psFreeComponentSet(struct componentSet * csp) {  }     return 0;      } 	} 	    } 			    csp->comps[i].selected; 		    csp->comps[i].ps.packages[j]->selected |=  		for (j = 0; j < csp->comps[i].ps.numPackages; j++)  		    csp->comps[i].selected = 0; 		else 		    csp->comps[i].selected = 1; 		if (states[i] != ' ') 	         } 	    p     } 	    psp->packages[i]->selected = 1; 	for (i = 0; i < psp->numPackages; i++)     if (everything != ' ') {      *doIndividual = (individualPackages != ' ');      if (answer == cancel) return INST_CANCEL;      newtPopWindow();     newtFormDestroy(form);      answer = newtRunForm(form);      newtFormAddComponents(form, checklist, checkbox, okay, cancel, NULL);      cancel = newtButton(30, 15, "Cancel");     okay = newtButton(10, 15, "Ok");  				individualPackages, NULL, &individualPackages);     checkbox = newtCheckbox(10, 13, "Select individual packages",       newtFormAddComponent(checklist, checkbox); 			    NULL, &everything);     checkbox = newtCheckbox(6, 3 + row++, "Everything", ' ',       } 	    states[i] = ' '; 	} else  	    newtFormAddComponent(checklist, checkbox); 				    NULL, &states[i]); 	    checkbox = newtCheckbox(6, 3 + row++, csp->comps[i].name, val,   		val = ' '; 	    else 		val = '*'; 	    if (csp->comps[i].selected) 	if (csp->comps[i].inmenu) {     for (i = 0, row = 0; i < csp->numComponents; i++) {      newtFormAddComponent(checklist, sb);     newtFormSetBackground(checklist, NEWT_COLORSET_CHECKBOX);     newtFormSetHeight(checklist, 9);     checklist = newtForm(sb, NULL, 0);     sb = newtVerticalScrollbar(47, 3, 9, 9, 10);      size = newtLabel(1, 42,*/     /*newtFormAddComponent(form, newtLabel(36, 1, "Size:")); 				"Choose components to install:"));     newtFormAddComponent(form, newtLabel(1, 1,       form = newtForm(NULL, NULL, 0);      newtOpenWindow(15, 2, 50, 19, "Components to Install");      states = alloca(sizeof(*states) * csp->numComponents);      individualPackages = *doIndividual ? '*' : ' ';      int row;     char * states;     char val, individualPackages, everything;     newtComponent okay, form, checklist, checkbox, sb, cancel, answer;     int i, j; 			    int * doIndividual) { static int selectComponents(struct componentSet * csp, struct pkgSet * psp,  } ;     return 0;          free(conflicts);      } 	} 	    if (package) package->selected = 1; 	    package = conflicts[i].suggestedPackage; 	for (i = 0; i < numConflicts; i++) {     if (selectPackages != ' ') {      } 	return INST_CANCEL; 	free(conflicts);     if (answer == cancel) {      newtPopWindow();     newtFormDestroy(form);      answer = newtRunForm(form);      newtFormSetCurrent(form, okay);     newtFormAddComponents(form, info, textbox, okay, cancel, NULL); 		     NULL, &selectPackages)); 	newtCheckbox(3, 13, "Install packages to satisfy dependencies", '*',     newtFormAddComponent(form,      newtTextboxSetText(textbox, text);      textbox = newtTextbox(3, 7, 45, 5, NEWT_TEXTBOX_SCROLL);     newtFormAddComponent(form, newtLabel(3, 6, buf));     cancel = newtButton(30, 15, "Cancel");     okay = newtButton(10, 15, "Ok");     sprintf(buf, "%-20s %-20s", "Package", "Requirement");  	"all of those required packages will be installed."); 	"packages you have not selected. If you just select Ok " 	"Some of the packages you have selected to install require "     newtTextboxSetText(info,      info = newtTextbox(1, 1, 45, 4, NEWT_TEXTBOX_WRAP); ad
@“  ÿ        Ñ  ´  ™  {  q  S  R    í  Ò  Ï  É  È  º  ¸  ·  ‚  w  V  U  :  ÿ  ù  ã  include <rpmlib.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <unistd.h>  #include "hash.h" #include "install.h" #include "log.h" #include "pkgs.h" #include "windows.h"  #define FILENAME_TAG 1000000  static int selectPackagesByGroup(struct pkgSet * psp); static int selectPackagesWindow(struct pkgSet * psp, char * group, 				unsigned int * kSelected); static int skipPackage(char * name); static int selectComponents(struct componentSet * csp, int * doIndividual); static int strptrCmp(const void * a, const void * b); static void showPackageInfo(Header h, unsigned int * kSelected); static int queryIndividual(int * result);  char * skipList[] = { "XFree86-8514", "XFree86-AGX", "XFree86-Mach32", 		      "XFree86-Mach64", "XFree86-Mach8", "XFree86-Mono", 		      "XFree86-P9000", "XFree86-S3", "XFree86-S3", 		      "XFree86-SVGA", "XFree86-VGA16", "XFree86-W32", 		      NULL };  static int strptrCmp(const void * a, const void * b) {     const char * const * one = a;     const char * const * two = b;      return strcmp(*one, *two); }  int pkgCompare(void * first, void * second) {     struct packageInfo ** a = first;     struct packageInfo ** b = second;      /* put packages w/o names at the end */     if (!(*a)->name) return 1;     if (!(*b)->name) return -1;      return strcmp((*a)->name, (*b)->name); };  int psUsingDirectory(char * dirname, struct pkgSet * psp) {     DIR * dir;     struct dirent * ent;     int fd, rc, isSource;     Header h;     int packagesAlloced;     struct pkgSet ps;     int count, type;     unsigned int * sizeptr;     char * name, * group;      ps.numPackages = 0;     packagesAlloced = 5;     ps.packages = malloc(sizeof(*ps.packages) * packagesAlloced);      logMessage("scanning %s for packages", dirname);     dir = opendir(dirname);     if (!dir) { 	errorWindow("error opening directory"); 	return INST_ERROR;     }      errno = 0;     ent = readdir(dir);     if (errno) { 	free(ps.packages); 	errorWindow("error reading from directory"); 	closedir(dir); 	return INST_ERROR;     }      chdir(dirname);      winStatus(33, 3, "Running", "Scanning available packages...");      while (ent) { 	if (!(ent->d_name[0] == '.' && (ent->d_name[1] == '\0' ||  	    ((ent->d_name[1] == '.') && (ent->d_name[2] == '\0'))))) { 	    fd = open(ent->d_name, O_RDONLY);  	    if (fd < 0) { 		logMessage("failed to open %s: %s", ent->d_name,  			   strerror(errno)); 	    } else { 		rc = pkgReadHeader(fd, &h, &isSource, NULL, NULL);  		close(fd); 		if (rc) { 		    logMessage("failed to pkgReadHeaer %s:", ent->d_name); 		} else { 		    if (ps.numPackages == packagesAlloced) { 			packagesAlloced += 5; 			ps.packages = realloc(ps.packages, 				sizeof(*ps.packages) * packagesAlloced); 		    }  		    ps.packages[ps.numPackages] =  				malloc(sizeof(struct packageInfo)); 		    ps.packages[ps.numPackages]->h = h; 		    ps.packages[ps.numPackages]->selected = 0; 		    ps.packages[ps.numPackages]->data = strdup(ent->d_name);  		    getEntry(h, RPMTAG_NAME, &type, (void **) &name, &count); 		    if (getEntry(h, RPMTAG_SIZE, &type, (void **)  				  &sizeptr, &count)) 			ps.packages[ps.numPackages]->size = *sizeptr; 		    else 			ps.packages[ps.numPackages]->size = 0;  		    if (skipPackage(name))  			ps.packages[ps.numPackages]->inmenu = 0; 		    else 			ps.packages[ps.numPackages]->inmenu = 1;  		    if (!getEntry(h, RPMTAG_GROUP, &type, (void **) &group,  			&count)) { 			    for (i                fo    for (i = 0; i < csp->numComponents; i++, currcomp++) {     currcomp = csp->comps;      struct component * currcomp;     int i; void psFreeComponentSet(struct componentSet * csp) {  }     return 0;      } 	} 			csp->comps[i].selected; 		csp->comps[i].ps.packages[j]->selected |=  	    for (j = 0; j < csp->comps[i].ps.numPackages; j++)  		csp->comps[i].selected = 0; 	    else 		csp->comps[i].selected = 1; 	    if (states[i] != ' ') 	if (csp->comps[i].inmenu) {     for (i = 0; i < csp->numComponents; i++) { ad
@,   ¤     ™   â  ¿  ¡  ™  ˜  h  6  4              ì  Þ  È  Ž  v  b  J  G  @  ?  0  /  ñ  Ø  Ó  À  ¿  ª  ©  ›  ™  ˜  X  7  )      ô  â  Ð  º  �  �  Y  0    ø  à  Ë  Ê  ¬  ž  m  Y  S  P  /  #  ü
  Ë
  ¿
  «
  ¥
  ¤
  †
  B
  6
  "
  
  
  
  ë	  ²	  ›	  ‡	  †	  v	  M	  D	  C	  ý  Ý  Ç  ³  ­  Ÿ  ž  ‚  t  H  G  3      
  ì  ë  Û  ¬  �  D  8  1  0    î  ¬  ¥  ¤  w  L  1  0  "  ò  ñ  Ý  ½  �  �  z  y  T  S  0    ñ  À  ¯  ¥  ƒ  u  t  A    ì  Ê  É  ³  ¥  �  Q      ì  ¹  ©  ¥  ¤  £                                           		} 		    continue; 				    "package %s at line %d dne", start, line); 		    messageWindow("comps Error",  		if (!pack) { 				sizeof(*psp->packages), (void *) pkgCompare); 		pack = bsearch(&keyaddr, psp->packages, psp->numPackages, 		packkey.name = start; 	    } else { 		cs.numComponents++;  		    baseNum = cs.numComponents; 		else if (!strcasecmp(currcomp->name, "Base")) 		    preskelNum = cs.numComponents; 		if (!strcasecmp(currcomp->name, "*beforeskel*"))  		inComp = 0; 	    if (!strcmp(start, "end")) { 	} else { 	    inComp = 1; 		sizeof(struct packageInfo) * packagesAlloced); 	    currcomp->ps.packages = malloc( 	    packagesAlloced = 5; 	    currcomp->ps.numPackages = 0;  	    currcomp->name = strdup(start);  	    } 		continue; 				"missing component name at line %d", line); 		messageWindow("comps Error",  	    if (!*start) {  	    while (*start && isspace(*start)) start++; 	    start++;  	    currcomp->inmenu = 1; 	    currcomp->selected = (*start == '1'); 	    currcomp = cs.comps + cs.numComponents;  	    } 		cs.comps = realloc(cs.comps, sizeof(*cs.comps) * compsAlloced); 		compsAlloced += 5; 	    if (compsAlloced == cs.numComponents) {  	    } 		continue; 		messageWindow("Error", "bad comps file at line %d", line); 	    if (*start != '0' && *start != '1') { 	    /* first digit must be a zero or a one */ 	if (!inComp) {  	if (*start == '#') continue; 	/* comment */ 	 	if (!*start) continue; 	/* empty string */  	while (*start && isspace(*start)) start++; 	start = buf; 	/* strip leading spaces */  	    chptr++; 	else 	    *chptr = '\0'; 	if (*chptr == '\n')  	chptr = buf + strlen(buf) - 1; 	/* remove any trailing '\n', leave chptr at the end of the string */  	line++;     while (fgets(buf, sizeof(buf), f)) {     inComp = 0;      cs.base = NULL;     cs.preskel = NULL;     cs.comps = malloc(sizeof(*cs.comps) * compsAlloced);     cs.numComponents = 0;     compsAlloced = 5;      } 	return INST_ERROR; 	fclose(f); 	messageWindow("Error", "Comps file is not version 0 as expected");     if (strcmp(buf, "0\n")) {      } 	return INST_ERROR; 	fclose(f); 	errorWindow("Cannot read components file: %s");     if (!fgets(buf, sizeof(buf), f)) {     line++;     /* get the version number */        } 	return INST_ERROR; 	errorWindow("Cannot open components file: %s");     if (!f) {     f = fopen(filespec, "r");      int baseNum = 0;     int preskelNum = 0;     int i;     struct packageInfo * keyaddr = &packkey;     struct packageInfo packkey, ** pack;     struct component * currcomp = NULL;     struct componentSet cs;     int packagesAlloced = 0;     int compsAlloced;     char * chptr;     char * start;     int line = 0;     int inComp;     char buf[255];     FILE * f; 			 struct componentSet * csp) { int psReadComponentsFile(char * filespec, struct pkgSet * psp,   }     return 0;      newtPopWindow();      closedir(dir);      	  (void *) pkgCompare);     qsort(ps.packages, ps.numPackages, sizeof(*ps.packages),       *psp = ps;      }  	} 	    return INST_ERROR; 	    closedir(dir); 	    free(ps.packages); 	    errorWindow("error reading from directory (2): %s"); 	    newtPopWindow(); 	if (errno) { 	ent = readdir(dir); 	errno = 0;  	} 	    } 		} 		    ps.numPackages++; 	 		    ps.packages[ps.numPackages]->group = group; 		    ps.packages[ps.numPackages]->name = name;  		    } 			group = "(unknown group)"; 		    } else if (!strlen(group)) { 			group = "(unknown group)"; ad     *     „   Ë  ¯  r  @  <  ;     â  Û  Ø  Ò  Ñ  Â  Á  Ÿ  w  v  ]  A  &      Ó  ­  …    ~  G    ó  í  ì  Ý  Ü  Î  Ì  Ë  ²  ‘  s  \  A  >  =  ò  Ü  Û  ³  š  p  j  @  "  !  ï
  Ã
  ³
  ­
  «
  ª
  g
  G
  
  á	  À	  ²	  �	  ~	  h	  g	  U	  H	  6	  +	  	  	  Ù  Ø  ¢  R  Q  -  	  Þ  Ý  ­  ‚  Q  *  ú  Ó  ­  ¬  {  T      ß  ¾  ‡  I  $         ÿ  µ  –  L  .    ×  ´  ƒ  y  `  I  F  @  ?  ,  
  ä  Ù  ·  ¶  v  u  K  J  >  *  )        while (!done) {     rc = 0;      newtFormAddHotKey(form, NEWT_KEY_F1);      newtFormAddComponents(form, checkList, okay, cancel, NULL);  	newtFormSetWidth(checkList, 27);     } else 	newtFormAddComponent(checkList, sb); 	newtFormSetHeight(checkList, 6);     if (row > 6) {      } 	} 	    cbs[i].cb = NULL; 	    cbs[i].state = ' '; 	} else { 	    newtFormAddComponent(checkList, cbs[i].cb); 	    cbs[i].kSelected = kSelected; 	    cbs[i].size = psp->packages[i]->size; 	    cbs[i].lastState = cbs[i].state = val; 	    cbs[i].sizeLabel = size; 	    newtComponentAddCallback(cbs[i].cb, (void *) sizeCallback, cbs + i); 				     NULL, &cbs[i].state); 	    cbs[i].cb = newtCheckbox(6, 3 + row++, psp->packages[i]->name, val,   		val = ' '; 	    else 		val = '*'; 	    if (psp->packages[i]->selected) 	    !strncmp(psp->packages[i]->group, group, groupLength)) { 	    strlen(psp->packages[i]->group) >= groupLength && 	if (psp->packages[i]->inmenu &&     for (i = 0, row = 0; i < psp->numPackages; i++) {      newtFormSetBackground(checkList, NEWT_COLORSET_CHECKBOX);     checkList = newtForm(sb, NULL, 0);     sb = newtVerticalScrollbar(32, 3, 6, 9, 10);      newtFormAddComponent(form, size);     size = newtLabel(32, 10, sizeBuf);     sprintf(sizeBuf, "%dM", *kSelected / 1024); 			"Size of all selected packages:"));     newtFormAddComponent(form, newtLabel(1, 10,  			"What packages should be installed?"));     newtFormAddComponent(form, newtLabel(1, 1,       cancel = newtButton(21, 12, "Cancel");     okay = newtButton(6, 12, "Ok");     form = newtForm(NULL, NULL, 0);      newtPushHelpLine("<F1> will show you a size and description of a package");     newtOpenWindow(22, 4, 40, 16, "Select Packages");      cbs = alloca(sizeof(*cbs) * psp->numPackages);  	groupLength = strlen(group);     } else 	groupLength = 0; 	group = "";     if (!group) {      char sizeBuf[20];     int done = 0;     struct newtExitStruct answer;     char val;     int i, row, groupLength, rc;     struct packageCheckbox * cbs;     newtComponent okay, form, checkList, sb, cancel, current, size; 				unsigned int * kSelected) { static int selectPackagesWindow(struct pkgSet * psp, char * group,  }     } 	newtRefresh(); 	newtLabelSetText(cbi->sizeLabel, sizeBuf); 	sprintf(sizeBuf, "%dM", *cbi->kSelected / 1024);  	cbi->lastState = cbi->state; 	    *cbi->kSelected += cbi->size / 1024; 	else 	    *cbi->kSelected -= cbi->size / 1024; 	if (cbi->state == ' ')      if (cbi->state != cbi->lastState) {      char sizeBuf[20]; static void sizeCallback(newtComponent co, struct packageCheckbox * cbi) {  };     char state, lastState;     unsigned int size;     unsigned int * kSelected;     newtComponent cb, sizeLabel; struct packageCheckbox {  }     return 0;      *csp = cs;      } 	cs.preskel->ps.packages[i]->selected = 1; 	cs.preskel->ps.packages[i]->inmenu = 0;     for (i = 0; i < cs.preskel->ps.numPackages; i++) {      } 	cs.base->ps.packages[i]->selected = 1; 	cs.base->ps.packages[i]->inmenu = 0;     for (i = 0; i < cs.base->ps.numPackages; i++) {      cs.preskel->selected = 1;     cs.base->selected = 1;     cs.preskel->inmenu = 0;     cs.base->inmenu = 0;      cs.preskel = cs.comps + preskelNum;     cs.base = cs.comps + baseNum;      fclose(f);      } 	} 	    } 		currcomp->ps.numPackages++; 		currcomp->ps.packages[currcomp->ps.numPackages] = *pack;  		} 			sizeof(struct packageInfo) * packagesAlloced); 		    currcomp->ps.packages = realloc(currcomp->ps.packages, 		    packagesAlloced += 5; 		if (currcomp->ps.numPackages == packagesAlloced) { ad  
   †     š   ã  â  ¸  �  „  W  ,    ß  «  ¡  ™  •  Ž  Z  K  +          ò  Ý  Æ  Å  ®  ­  �  q  S  +  !  ù  ø  ê  è  ç  Ë  °  —  ~  }  8      ù  Ø  ×  ³  ™  �  t  s  P  >  #    è
  Þ
  ¬
  ”
  }
  b
  X
  ?
  3
  2
  
  ó	  Ö	  ¹	  ¦	  ™	  �	  v	  j	  i	  R	  *	  	  	  ï  Ô  Ê  ³  °  ©  ¨  š  ˜  —  \  G  *    ñ  Ï  ¹  |  b  I  H    Û  Ë  Ê  ¤  £  v  U       ß  Å  ¿  ¾  ‰  ˆ  o  S  R  9  .  (  '    ð  Â  ™  –  •  f  e  Z  T  S  -    ò  È  º  ƒ  m  g  &  %  	  õ  ï  î  °  «  ‡  †  Š             form = newtForm(NULL, NULL, 0);          newtOpenWindow(15, 2, 50, 19, "Unresolved Dependencies");      } 	strcat(text, buf); 	if (i) strcat(text, "\n");  	    sprintf(buf, "%-20s (no suggestion)", conflicts[i].byName); 	else 		    package->name); 	    sprintf(buf, "%-20s %-20s", conflicts[i].byName,  	if (package) 	package = conflicts[i].suggestedPackage;     for (i = 0; i < numConflicts; i++) {     *text = '\0';     text = malloc(80 * numConflicts);      } 	return 0;  	rpmdepFreeConflicts(conflicts, numConflicts);  	} 	    if (package) package->selected = 1; 	    package = conflicts[i].suggestedPackage; 	for (i = 0; i < numConflicts; i++) {     if (fixup) {      } 	return 0;     if (!numConflicts) {      if (db) rpmdbClose(db);     rpmdepDone(rpmdeps);      rpmdepCheck(rpmdeps, &conflicts, &numConflicts);      } 				   psp->packages[i]); 	    rpmdepAvailablePackage(rpmdeps, psp->packages[i]->h,  	else 	    rpmdepAddPackage(rpmdeps, psp->packages[i]->h); 	if (psp->packages[i]->selected)     for (i = 0; i < psp->numPackages; i++) {      rpmdeps = rpmdepDependencies(db);  	    db = NULL; 	if (rpmdbOpen("/mnt", &db, O_RDWR | O_CREAT, 0644))     if (!access("/mnt/var/lib/rpm/packages.rpm", R_OK))      char selectPackages;     char * text, buf[80];     newtComponent okay, form, textbox, info, cancel, answer;     int numConflicts;     struct packageInfo * package;     struct rpmDependencyConflict * conflicts;     int i;     rpmDependencies rpmdeps;     rpmdb db = NULL; int psVerifyDependencies(struct pkgSet * psp, int fixup) {  }     return 0;      }  	} 		stage = SELECT_DONE; 	    else 		stage = SELECT_PACKAGES; 	    else if (rc) 		return rc; 	    if (rc == INST_ERROR)  	    rc = psVerifyDependencies(psp, 0); 	  case SELECT_VERIFY:  	    break; 		stage = SELECT_VERIFY; 	    else 		return rc; 	    else if (rc)  		stage = SELECT_COMPONENTS; 	    if (rc == INST_CANCEL)  	    rc = selectPackagesByGroup(psp); 	  case SELECT_PACKAGES:  	    break; 		stage = SELECT_VERIFY; 	    else 		stage = SELECT_PACKAGES; 	    if (doIndividual) 	    if (rc) return rc; 		rc = selectComponents(csp, psp, &doIndividual); 	    else 		rc = queryIndividual(&doIndividual); 	    if (isUpgrade) 	  case SELECT_COMPONENTS: 	switch (stage) {     while (stage != SELECT_DONE) {  	stage = SELECT_COMPONENTS;     else 	stage = SELECT_PACKAGES;     if (!goForward && doIndividual)      static int doIndividual = 0;     int stage;     int rc; 			 int goForward, int isUpgrade) { int psSelectPackages(struct pkgSet * psp, struct componentSet * csp,  #define SELECT_DONE		100 #define SELECT_VERIFY		3 #define SELECT_PACKAGES		2 #define SELECT_COMPONENTS	1  }     return 0;  	       psp->packages[i]->selected = 0; 	    else 	       psp->packages[i]->selected = 1; 	    if (cbs[i].state != ' ') 	if (cbs[i].cb)     for (i = 0; i < psp->numPackages; i++)       if (rc) return rc;      newtPopHelpLine();     newtPopWindow();     newtFormDestroy(form);      } 	} 		rc = INST_CANCEL; 	    if (answer.u.co == cancel) 	    done = 1; 	} else if (answer.reason == NEWT_EXIT_COMPONENT) { 	    } 		} 		    } 			break; 			showPackageInfo(psp->packages[i]->h, kSelected); 		    if (cbs[i].cb == current) { 		for (i = 0; i < psp->numPackages; i++) { 		current = newtFormGetCurrent(checkList); 	    else if (answer.u.key == NEWT_KEY_F1) { 		done = 1; 	    if (answer.u.key == NEWT_KEY_F12)  	if (answer.reason == NEWT_EXIT_HOTKEY) {  	newtFormRun(form, &answer); ad     f     ‘   â  Ü  Û  Å  Ã  Â  ‰  s  U  9  +    ø  ÷  Ò  À  ‘  }  w  v  ^  E      à  Ä  Ã  ˜  €  u  8    û  ã  à  ß  ¤  £  _  ?  #      Ø  ½  •  f  c  b  B    ó
  Ç
  Æ
  „
  Q
  K
  
  
  
  ×	  Ñ	  £	  ¢	  w	  J	  (	  ö  ê  é  Ö  Ð  Ï  À  ¿  °  ¯  q  X  S  E  C  B    
  	  Þ  ¹  ³  ²  ¤  ¢  ¡  i  2    ú  Ú  Ê  ¸  £  ‡  u  ^  ]  6     Þ  Î  ¤  Ž  €  R  8    õ  æ  ß  Ü  Û  Á  À  Ÿ  l  f  e  C    ó  è  ¹  Ž  p  j  d  c  '      Û  Ú  ¶  ’  g  f  e                 cancel = newtButton(23, 10, "Cancel");     okay = newtButton(7, 10, "Ok");     form = newtForm(NULL, NULL, 0);      newtOpenWindow(4, 2, 45, 14, "Select Group");      htFreeHashTable(ht);     qsort(groupList, numGroups, sizeof(char *), strptrCmp);      } 	i++; 	strcpy(groupList[i], group); 	groupList[i] = alloca(strlen(group) + 1);     while (htIterGetNext(ht, &iter, &group)) {     i = 0;     htIterStart(&iter);     groupList = alloca(sizeof(*groupList) * numGroups);     numGroups = htNumEntries(ht);      } 	    kSelected += (psp->packages[i]->size / 1024); 	if (psp->packages[i]->selected)  	htAddToTable(ht, group);  	} 	    } 		group = buf; 		buf[chptr - group] = '\0'; 		strncpy(buf, group, chptr - group); 	    if (*chptr == '/') { 	    while (*chptr && *chptr != '/') chptr++; 	    chptr++; 	if (*chptr == '/') { 	while (*chptr && *chptr != '/') chptr++; 	chptr = group; 	group = psp->packages[i]->group;     for (i = 0, row = 0; i < psp->numPackages; i++) {     ht = htNewTable(psp->numPackages);      char ** groupList;     char * group;     char buf[200], * chptr;     htIterator iter;     hashTable ht;     int rc = 0;     unsigned int kSelected = 0;     int i, row, numGroups;     newtComponent sizeLabel;     newtComponent okay, form, listbox, cancel, answer; static int selectPackagesByGroup(struct pkgSet * psp) {  }     return 0;      } 	if (!strcmp(*item, name)) return 1;     for (item = skipList; *item; item++) {      char ** item; static int skipPackage(char * name) {  }     return 0;      	  (void *) pkgCompare);     qsort(ps.packages, ps.numPackages, sizeof(*ps.packages),       *psp = ps;      close(fd);      } 	ps.numPackages++;  		 &count); 		 (void **) &ps.packages[ps.numPackages]->data,  	getEntry(h, FILENAME_TAG, &type, 	ps.packages[ps.numPackages]->group = group; 	ps.packages[ps.numPackages]->name = name;  	    ps.packages[ps.numPackages]->inmenu = 1; 	else 	    ps.packages[ps.numPackages]->inmenu = 0; 	if (skipPackage(name))   	    ps.packages[ps.numPackages]->size = 0; 	else 	    ps.packages[ps.numPackages]->size = *sizeptr; 	if (getEntry(h, RPMTAG_SIZE, &type, (void **) &sizeptr, &count))  	ps.packages[ps.numPackages]->selected = 0; 	ps.packages[ps.numPackages]->h = h; 		    malloc(sizeof(struct packageInfo)); 	ps.packages[ps.numPackages] =   	} 		    sizeof(*ps.packages) * packagesAlloced); 	    ps.packages = realloc(ps.packages, 	    packagesAlloced += 5; 	if (ps.numPackages == packagesAlloced) {  	    group = "(unknown group)"; 	} else if (!strlen(group)) 	    group = "(unknown group)"; 	if (!getEntry(h, RPMTAG_GROUP, &type, (void **) &group, &count)) {  	getEntry(h, RPMTAG_NAME, &type, (void **) &name, &count);  	} 	    return INST_ERROR; 	    free(ps.packages); 		    (int) lseek(fd, 0, SEEK_CUR)); 	    messageWindow("Error", "error reading header at %d\n",  	if (!h) { 	h = readHeader(fd, 1);     while (end > lseek(fd, 0, SEEK_CUR)) {      lseek(fd, 0, SEEK_SET);     end = lseek(fd, 0, SEEK_END);      ps.packages = malloc(sizeof(*ps.packages) * packagesAlloced);     packagesAlloced = 5;     ps.numPackages = 0;      } 	return INST_ERROR; 	errorWindow("error opening header file: %s");     if (fd < 0) {     fd = open(file, O_RDONLY, 0644);      char * name, * group;     int packagesAlloced;     Header h;     unsigned int * sizeptr;     int fd, end, type, count;     struct pkgSet ps; int psFromHeaderList(char * file, struct pkgSet * psp) {  }     free(csp->comps);      } 	free(currcomp->ps.packages); ad          |   Ð  ­  }  o  D    ò  ñ  ´  ³  �  R  L  K        æ  Ì  Ÿ  g  f  :      Û  Ú  ¿  ª  ©  „  ƒ  U  T  F  D  C    Ú  ¤  �  {  d  F  E    Ã
  
  ~
  ;
  0
  /
  æ	  Ù	  —	  Š	  c	  `	  Z	  Y	  0	  /	  	  Î  ‘  �  V    ø  ½  ¼  Œ  s  8  $    Ü  ­  �  “  „  |  h  _  Y  I  H    ò  Ì  Ë  ¦  p  o  X  W  <  '  %  $  ù  Ê  ¨  ˜  —  †  …  N    ø  ²  q  *      î  Ë     Ÿ  {  =  8                            newtFormRun(form, &answer);          newtFormAddComponents(form, text, yes, no, cancel, NULL);     form = newtForm(NULL, NULL, 0);      cancel = newtButton(32, 10, "Cancel");     no = newtButton(18, 10, "No");     yes = newtButton(4, 10, "Yes");  	"will be upgraded?"); 	"installation. Would you like to customize the set of packages that " 	"needed to satisfy their dependencies, have been selected for " 	"The packages you have installed, and any other packages which are "     newtTextboxSetText(text,     text = newtTextbox(1, 1, 40, 10, NEWT_TEXTBOX_WRAP);     newtOpenWindow(17, 4, 45, 15, "Upgrade Packages");      *result = 0;      int rc = 0;     struct newtExitStruct answer;     newtComponent text, yes, no, cancel, form; static int queryIndividual(int * result) {  }     newtPopWindow();     newtFormDestroy(form);      newtRunForm(form);      newtFormAddComponents(form, textbox, okay, NULL);     okay = newtButton(20, 11, "Ok");      newtTextboxSetText(textbox, buf); 				NEWT_TEXTBOX_SCROLL);     textbox = newtTextbox(1, 4, 43, 6, NEWT_TEXTBOX_WRAP |       *to = '\0';     } 	from++; 	    *to++ = *from; 	} else 		*to++ = ' '; 	    else 		*to++ = '\n'; 		(from > description && *(from - 1) == '\n')) 	    if ((*(from + 1) && isspace(*(from + 1))) || 	if (*from == '\n') {     while (*from) {     /* Rip out all '\n' that don't start new paragraphs */     from = description;      to = buf = alloca(strlen(description) + 1);      newtFormAddComponent(form, newtLabel(10, 2, infostr));     sprintf(infostr, "%d", *size);     newtFormAddComponent(form, newtLabel(10, 1, infostr));     sprintf(infostr, "%s-%s-%s", name, version, release);      newtFormAddComponent(form, newtLabel(1, 2, "Size   :"));     newtFormAddComponent(form, newtLabel(1, 1, "Package:"));     form = newtForm(NULL, NULL, 0);      newtOpenWindow(31, 6, 45, 15, name);      } 	} 	    description = "(none available)"; 		&count)) { 	if (!getEntry(h, RPMTAG_SUMMARY, &type, (void **) &description,  		&count)) {     if (!getEntry(h, RPMTAG_DESCRIPTION, &type, (void **) &description,   	size = 0;     if (!getEntry(h, RPMTAG_SIZE, &type, (void **) &size, &count))      getEntry(h, RPMTAG_RELEASE, &type, (void **) &release, &count);     getEntry(h, RPMTAG_VERSION, &type, (void **) &version, &count);     getEntry(h, RPMTAG_NAME, &type, (void **) &name, &count);      char * buf, * from, * to;     char infostr[255];     int type, count;     uint_32 * size;     char * name, * version, * description, * release;     newtComponent form, textbox, okay; static void showPackageInfo(Header h, unsigned int * kSelected) {  }     return 0;      if (answer == cancel) return INST_CANCEL;      if (rc == INST_ERROR) return rc;      newtPopWindow();     newtFormDestroy(form);      } while (answer == listbox && rc != INST_ERROR); 	} 	    newtLabelSetText(sizeLabel, buf); 	    sprintf(buf, "%dM", kSelected / 1024);  	    rc = selectPackagesWindow(psp, group, &kSelected); 	    group = newtListboxGetCurrent(listbox); 	if (answer == listbox) { 	answer = newtRunForm(form);     do {      newtFormAddComponents(form, listbox, okay, cancel, NULL);      } 	newtListboxAddEntry(listbox, groupList[i], groupList[i]);     for (i = 0; i < numGroups; i++) {      listbox = newtListbox(3, 3, 6, NEWT_LISTBOX_RETURNEXIT);      newtFormAddComponent(form, sizeLabel);     sizeLabel = newtLabel(39, 1, buf);     sprintf(buf, "%dM", kSelected / 1024); 			"Size:"));     newtFormAddComponent(form, newtLabel(33, 1, 			"Choose a group to examine:"));     newtFormAddComponent(form, newtLabel(1, 1,  ad
@Ï  ƒ     h   Ê  ‰  _  ^    Ü  §  o  _  ^  '    ã  â  Ã  Á  À  ’  m  G  F    û  Û  Ú  ¯  ¬  «  o  `  G  -      ð  Û  ¿  ¥  ¤  Œ  s  1  0  û
  ß
  Ï
  ¦
  ’
  Œ
  ‹
  |
  d
  S
  ?
  
  
  í	  ç	  æ	  Ò	  Ñ	  Ž	  �	  {	  ?	  ÿ  Ø  ×  Ä  �  x  j  5  4  '    Þ  Ó  ¤  ‹  e  8  0  /  
  â  ¸  ‡  H  G    Ò  ¹  ˆ  }  S  R  4    ý  Ñ  Ð  ‘  ƒ   struct component * currcomp;

    currcomp = csp->comps;
    for (i = 0; i < csp->numComponents; i++, currcomp++) {
	free(currcomp->ps.packages);
    }

    free(csp->comps);
}

int psFromHeaderList(char * file, struct pkgSet * psp) {
    struct pkgSet ps;
    int fd, end, type, count;
    unsigned int * sizeptr;
    Header h;
    int packagesAlloced;
    char * name, * group;

    fd = open(file, O_RDONLY, 0644);
    if (fd < 0) {
	errorWindow("error opening header file: %s");
	return INST_ERROR;
    }

    ps.numPackages = 0;
    packagesAlloced = 5;
    ps.packages = malloc(sizeof(*ps.packages) * packagesAlloced);

    end = lseek(fd, 0, SEEK_END);
    lseek(fd, 0, SEEK_SET);

    while (end > lseek(fd, 0,			&count)) { 		    if (!getEntry(h, RPMTAG_GROUP, &type, (void **) &group,   			ps.packages[ps.numPackages]->inmenu = 1; 		    else 			ps.packages[ps.numPackages]->inmenu = 0; 		    if (skipPackage(name))   			ps.packages[ps.numPackages]->size = 0; 		    else 			ps.packages[ps.numPackages]->size = *sizeptr; 				  &sizeptr, &count)) 		    if (getEntry(h, RPMTAG_SIZE, &type, (void **)  		    getEntry(h, RPMTAG_NAME, &type, (void **) &name, &count);  		    ps.packages[ps.numPackages]->data = strdup(ent->d_name); 		    ps.packages[ps.numPackages]->selected = 0; 		    ps.packages[ps.numPackages]->h = h; 				malloc(sizeof(struct packageInfo)); 		    ps.packages[ps.numPackages] =   		    } 				sizeof(*ps.packages) * packagesAlloced); 			ps.packages = realloc(ps.packages, 			packagesAlloced += 5; 		    if (ps.numPackages == packagesAlloced) { 		} else { 		    logMessage("failed to pkgReadHeaer %s:", ent->d_name); 		if (rc) { 		close(fd);  		rc = pkgReadHeader(fd, &h, &isSource, NULL, NULL); 	    } else { 			   strerror(errno)); 		logMessage("failed to open %s: %s", ent->d_name,  	    if (fd < 0) {  	    fd = open(ent->d_name, O_RDONLY); 	    ((ent->d_name[1] == '.') && (ent->d_name[2] == '\0'))))) { 	if (!(ent->d_name[0] == '.' && (ent->d_name[1] == '\0' ||      while (ent) {      winStatus(33, 3, "Running", "Scanning available packages...");      chdir(dirname);      } 	return INST_ERROR; 	closedir(dir); 	errorWindow("error reading from directory"); 	free(ps.packages);     if (errno) {     ent = readdir(dir);     errno = 0;      } 	return INST_ERROR; 	errorWindow("error opening directory");     if (!dir) {     dir = opendir(dirname);     logMessage("scanning %s for packages", dirname);      ps.packages = malloc(sizeof(*ps.packages) * packagesAlloced);     packagesAlloced = 5;     ps.numPackages = 0;      char * name, * group;     unsigned int * sizeptr;     int count, type;     struct pkgSet ps;     int packagesAlloced;     Header h;     int fd, rc, isSource;     struct dirent * ent;     DIR * dir; int psUsingDirectory(char * dirname, struct pkgSet * psp) {  };     return strcmp((*a)->name, (*b)->name);      if (!(*b)->name) return -1;     if (!(*a)->name) return 1;     /* put packages w/o names at the end */      struct packageInfo ** b = second;     struct packageInfo ** a = first; int pkgCompare(void * first, void * second) {  }     return strcmp(*one, *two);      const char * const * two = b;     const char * const * one = a; static int strptrCmp(const void * a, const void * b) {  		      NULL }; 		      "XFree86-SVGA", "XFree86-VGA16", "XFree86-W32", 		      "XFree86-P9000", "XFree86-S3", "XFree86-S3", 		      "XFree86-Mach64", "XFree86-Mach8", "XFree86-Mono", char * skipList[] = { "XFree86-8514", "XFree86-AGX", "XFree86-Mach32",  static int queryIndividual(int * result); static void showPackageInfo(Header h, unsigned int * kSelected); static int strptrCmp(const void * a, const void * b); 