Changeset 30641
- Timestamp:
- 2012-02-19T00:55:02+01:00 (6 years ago)
- Location:
- packages/admin/debootstrap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
packages/admin/debootstrap/Makefile
r26839 r30641 1 1 # 2 2 # Copyright (C) 2010 Gianluigi Tiesi <sherpya@netfarm.it> 3 # Copyright (C) 2011 OpenWrt.org3 # Copyright (C) 2011-2012 OpenWrt.org 4 4 # 5 5 # This is free software, licensed under the GNU General Public License v2. … … 10 10 11 11 PKG_NAME:=debootstrap 12 PKG_VERSION:=1.0.3 012 PKG_VERSION:=1.0.38 13 13 PKG_RELEASE:=1 14 14 15 15 PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb 16 16 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap 17 PKG_MD5SUM:= d87b35670aa735ae5b7d3f8bf1b7624517 PKG_MD5SUM:=9bc9c55504c73bad27105aeed1a94f42 18 18 19 19 UNPACK_CMD=ar -p "$(DL_DIR)/$(PKG_SOURCE)" data.tar.gz | ( cd $(1) && tar -xzf - ) … … 38 38 39 39 define Build/Compile 40 # file pkgdetails.c was imported from debian package base-installer version 1.1 1940 # file pkgdetails.c was imported from debian package base-installer version 1.122 41 41 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) ./files/pkgdetails.c -o $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails 42 42 endef -
packages/admin/debootstrap/files/pkgdetails.c
r26839 r30641 3 3 #include <string.h> 4 4 #include <ctype.h> 5 #include <stdarg.h> 6 #include <errno.h> 5 7 6 8 #define MAX_LINE 1000 … … 8 10 9 11 char *checksum_field=NULL; 12 13 static void oom_die(void) 14 { 15 fprintf(stderr, "Out of memory!\n"); 16 exit(1); 17 } 18 19 static char *xvasprintf(const char *fmt, va_list ap) { 20 char *ret; 21 22 if (vasprintf (&ret, fmt, ap) < 0) { 23 if (errno == ENOMEM) 24 oom_die(); 25 return NULL; 26 } 27 return ret; 28 } 29 30 static char *xasprintf(const char *fmt, ...) { 31 va_list ap; 32 char *ret; 33 34 va_start(ap, fmt); 35 ret = xvasprintf(fmt, ap); 36 va_end(ap); 37 return ret; 38 } 10 39 11 40 static char *fieldcpy(char *dst, char *fld) { … … 18 47 } 19 48 49 static void outputdeps(char *deps) { 50 char *pch = deps; 51 52 while (1) { 53 while (isspace(*pch)) pch++; 54 if (!*pch) break; 55 56 while (*pch && *pch != '(' && *pch != '|' && *pch != ',' 57 && !isspace(*pch)) 58 { 59 fputc(*pch++, stdout); 60 } 61 fputc('\n', stdout); 62 while (*pch && *pch++ != ',') (void)NULL; 63 } 64 } 65 20 66 static void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) { 21 67 char buf[MAX_LINE]; 22 68 char cur_pkg[MAX_LINE]; 23 69 char cur_deps[MAX_LINE]; 70 char cur_predeps[MAX_LINE]; 71 char prev_pkg[MAX_LINE]; 24 72 char *pkgs[MAX_PKGS]; 25 73 int i; 26 74 int skip; 27 75 FILE *f; 28 29 cur_pkg[0] = cur_deps[0] = '\0'; 76 int output_pkg = -1; 77 78 cur_pkg[0] = cur_deps[0] = cur_predeps[0] = prev_pkg[0] = '\0'; 30 79 31 80 for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i]; … … 44 93 skip = 1; 45 94 fieldcpy(cur_pkg, buf); 95 if (strcmp(cur_pkg, prev_pkg) != 0) { 96 if (output_pkg != -1) 97 pkgs[output_pkg] = NULL; 98 if (cur_deps[0]) 99 outputdeps(cur_deps); 100 if (cur_predeps[0]) 101 outputdeps(cur_predeps); 102 strcpy(prev_pkg, cur_pkg); 103 } 104 cur_deps[0] = cur_predeps[0] = '\0'; 105 output_pkg = -1; 46 106 for (i = 0; i < pkgc; i++) { 47 107 if (!pkgs[i]) continue; … … 49 109 if (strcmp(cur_pkg, pkgs[i]) == 0) { 50 110 skip = 0; 51 pkgs[i] = NULL;111 output_pkg = i; 52 112 break; 53 113 } 54 114 } 55 115 if (!any) break; 56 } else if (!skip && 57 (strncasecmp(buf, "Depends:", 8) == 0 || 58 strncasecmp(buf, "Pre-Depends:", 12) == 0)) 59 { 60 char *pch; 116 } else if (!skip && strncasecmp(buf, "Depends:", 8) == 0) 61 117 fieldcpy(cur_deps, buf); 62 pch = cur_deps; 63 while (1) { 64 while (isspace(*pch)) pch++; 65 if (!*pch) break; 66 67 while (*pch && *pch != '(' && *pch != '|' && *pch != ',' 68 && !isspace(*pch)) 69 { 70 fputc(*pch++, stdout); 71 } 72 fputc('\n', stdout); 73 while (*pch && *pch++ != ',') (void)NULL; 74 } 75 } 76 } 118 else if (!skip && strncasecmp(buf, "Pre-Depends:", 12) == 0) 119 fieldcpy(cur_predeps, buf); 120 } 121 if (cur_deps[0]) 122 outputdeps(cur_deps); 123 if (cur_predeps[0]) 124 outputdeps(cur_predeps); 77 125 fclose(f); 78 126 } … … 89 137 char cur_checksum[MAX_LINE]; 90 138 char cur_filename[MAX_LINE]; 139 char prev_pkg[MAX_LINE]; 91 140 char *pkgs[MAX_PKGS]; 92 141 int i; 93 142 FILE *f; 94 95 cur_pkg[0] = cur_ver[0] = cur_arch[0] = cur_filename[0] = '\0'; 143 char *output = NULL; 144 int output_pkg = -1; 145 146 cur_field[0] = cur_pkg[0] = cur_ver[0] = cur_arch[0] = cur_filename[0] = prev_pkg[0] = '\0'; 96 147 97 148 for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i]; … … 109 160 if (strncasecmp(buf, "Package:", 8) == 0) { 110 161 fieldcpy(cur_pkg, buf); 162 if (strcmp(cur_pkg, prev_pkg) != 0) { 163 if (output) 164 fputs(output, stdout); 165 if (uniq && output_pkg != -1) 166 pkgs[output_pkg] = NULL; 167 strcpy(prev_pkg, cur_pkg); 168 } 169 free(output); 170 output = NULL; 171 output_pkg = -1; 111 172 } else if (strncasecmp(buf, "Version:", 8) == 0) { 112 173 fieldcpy(cur_ver, buf); … … 126 187 any = 1; 127 188 if (strcmp(cur_field, pkgs[i]) == 0) { 128 printf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_checksum, cur_size); 129 if (uniq) pkgs[i] = NULL; 189 free(output); 190 output = xasprintf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_checksum, cur_size); 191 output_pkg = i; 130 192 break; 131 193 } 132 194 } 133 195 if (!any) break; 134 } 135 } 196 cur_field[0] = '\0'; 197 } 198 } 199 if (output) 200 fputs(output, stdout); 201 if (uniq && output_pkg != -1) 202 pkgs[output_pkg] = NULL; 136 203 fclose(f); 137 204 … … 144 211 } 145 212 } 146 }147 148 static void oom_die(void)149 {150 fprintf(stderr, "Out of memory!\n");151 exit(1);152 213 } 153 214 -
packages/admin/debootstrap/patches/100-busybox_fix.patch
r26839 r30641 1 Index: debootstrap-1.0.30/usr/share/debootstrap/functions 2 =================================================================== 3 --- debootstrap-1.0.30.orig/usr/share/debootstrap/functions 2011-04-28 15:29:13.595340023 +0200 4 +++ debootstrap-1.0.30/usr/share/debootstrap/functions 2011-04-28 15:29:23.658843887 +0200 5 @@ -800,8 +800,6 @@ 1 --- a/usr/share/debootstrap/functions 2 +++ b/usr/share/debootstrap/functions 3 @@ -839,8 +839,6 @@ choose_extractor () { 6 4 7 5 if [ -n "$EXTRACTOR_OVERRIDE" ]; then
Note: See TracChangeset
for help on using the changeset viewer.