From: Luka Perkov Date: Sat, 18 Feb 2012 23:55:02 +0000 (+0000) Subject: debootstrap: upgrade to version 1.0.38 X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;hb=5da7fbedc57237f2c56ac1c047054c887ea57c06 debootstrap: upgrade to version 1.0.38 SVN-Revision: 30641 --- diff --git a/admin/debootstrap/Makefile b/admin/debootstrap/Makefile index bbf24a663a..82c81e95d1 100644 --- a/admin/debootstrap/Makefile +++ b/admin/debootstrap/Makefile @@ -1,6 +1,6 @@ # # Copyright (C) 2010 Gianluigi Tiesi -# Copyright (C) 2011 OpenWrt.org +# Copyright (C) 2011-2012 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=debootstrap -PKG_VERSION:=1.0.30 +PKG_VERSION:=1.0.38 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap -PKG_MD5SUM:=d87b35670aa735ae5b7d3f8bf1b76245 +PKG_MD5SUM:=9bc9c55504c73bad27105aeed1a94f42 UNPACK_CMD=ar -p "$(DL_DIR)/$(PKG_SOURCE)" data.tar.gz | ( cd $(1) && tar -xzf - ) @@ -37,7 +37,7 @@ define Package/debootstrap/description endef define Build/Compile -# file pkgdetails.c was imported from debian package base-installer version 1.119 +# file pkgdetails.c was imported from debian package base-installer version 1.122 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) ./files/pkgdetails.c -o $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails endef diff --git a/admin/debootstrap/files/pkgdetails.c b/admin/debootstrap/files/pkgdetails.c index 1154089eaa..359807badc 100644 --- a/admin/debootstrap/files/pkgdetails.c +++ b/admin/debootstrap/files/pkgdetails.c @@ -2,12 +2,41 @@ #include #include #include +#include +#include #define MAX_LINE 1000 #define MAX_PKGS 100 char *checksum_field=NULL; +static void oom_die(void) +{ + fprintf(stderr, "Out of memory!\n"); + exit(1); +} + +static char *xvasprintf(const char *fmt, va_list ap) { + char *ret; + + if (vasprintf (&ret, fmt, ap) < 0) { + if (errno == ENOMEM) + oom_die(); + return NULL; + } + return ret; +} + +static char *xasprintf(const char *fmt, ...) { + va_list ap; + char *ret; + + va_start(ap, fmt); + ret = xvasprintf(fmt, ap); + va_end(ap); + return ret; +} + static char *fieldcpy(char *dst, char *fld) { while (*fld && *fld != ':') fld++; @@ -17,16 +46,36 @@ static char *fieldcpy(char *dst, char *fld) { return strcpy(dst, fld); } +static void outputdeps(char *deps) { + char *pch = deps; + + while (1) { + while (isspace(*pch)) pch++; + if (!*pch) break; + + while (*pch && *pch != '(' && *pch != '|' && *pch != ',' + && !isspace(*pch)) + { + fputc(*pch++, stdout); + } + fputc('\n', stdout); + while (*pch && *pch++ != ',') (void)NULL; + } +} + static void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) { char buf[MAX_LINE]; char cur_pkg[MAX_LINE]; char cur_deps[MAX_LINE]; + char cur_predeps[MAX_LINE]; + char prev_pkg[MAX_LINE]; char *pkgs[MAX_PKGS]; int i; int skip; FILE *f; + int output_pkg = -1; - cur_pkg[0] = cur_deps[0] = '\0'; + cur_pkg[0] = cur_deps[0] = cur_predeps[0] = prev_pkg[0] = '\0'; for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i]; @@ -43,37 +92,36 @@ static void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) { int any = 0; skip = 1; fieldcpy(cur_pkg, buf); + if (strcmp(cur_pkg, prev_pkg) != 0) { + if (output_pkg != -1) + pkgs[output_pkg] = NULL; + if (cur_deps[0]) + outputdeps(cur_deps); + if (cur_predeps[0]) + outputdeps(cur_predeps); + strcpy(prev_pkg, cur_pkg); + } + cur_deps[0] = cur_predeps[0] = '\0'; + output_pkg = -1; for (i = 0; i < pkgc; i++) { if (!pkgs[i]) continue; any = 1; if (strcmp(cur_pkg, pkgs[i]) == 0) { skip = 0; - pkgs[i] = NULL; + output_pkg = i; break; } } if (!any) break; - } else if (!skip && - (strncasecmp(buf, "Depends:", 8) == 0 || - strncasecmp(buf, "Pre-Depends:", 12) == 0)) - { - char *pch; + } else if (!skip && strncasecmp(buf, "Depends:", 8) == 0) fieldcpy(cur_deps, buf); - pch = cur_deps; - while (1) { - while (isspace(*pch)) pch++; - if (!*pch) break; - - while (*pch && *pch != '(' && *pch != '|' && *pch != ',' - && !isspace(*pch)) - { - fputc(*pch++, stdout); - } - fputc('\n', stdout); - while (*pch && *pch++ != ',') (void)NULL; - } - } + else if (!skip && strncasecmp(buf, "Pre-Depends:", 12) == 0) + fieldcpy(cur_predeps, buf); } + if (cur_deps[0]) + outputdeps(cur_deps); + if (cur_predeps[0]) + outputdeps(cur_predeps); fclose(f); } @@ -88,11 +136,14 @@ static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile, char cur_size[MAX_LINE]; char cur_checksum[MAX_LINE]; char cur_filename[MAX_LINE]; + char prev_pkg[MAX_LINE]; char *pkgs[MAX_PKGS]; int i; FILE *f; + char *output = NULL; + int output_pkg = -1; - cur_pkg[0] = cur_ver[0] = cur_arch[0] = cur_filename[0] = '\0'; + cur_field[0] = cur_pkg[0] = cur_ver[0] = cur_arch[0] = cur_filename[0] = prev_pkg[0] = '\0'; for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i]; @@ -108,6 +159,16 @@ static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile, } if (strncasecmp(buf, "Package:", 8) == 0) { fieldcpy(cur_pkg, buf); + if (strcmp(cur_pkg, prev_pkg) != 0) { + if (output) + fputs(output, stdout); + if (uniq && output_pkg != -1) + pkgs[output_pkg] = NULL; + strcpy(prev_pkg, cur_pkg); + } + free(output); + output = NULL; + output_pkg = -1; } else if (strncasecmp(buf, "Version:", 8) == 0) { fieldcpy(cur_ver, buf); } else if (strncasecmp(buf, "Architecture:", 13) == 0) { @@ -125,14 +186,20 @@ static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile, if (!pkgs[i]) continue; any = 1; if (strcmp(cur_field, pkgs[i]) == 0) { - printf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_checksum, cur_size); - if (uniq) pkgs[i] = NULL; + free(output); + output = xasprintf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_checksum, cur_size); + output_pkg = i; break; } } if (!any) break; + cur_field[0] = '\0'; } } + if (output) + fputs(output, stdout); + if (uniq && output_pkg != -1) + pkgs[output_pkg] = NULL; fclose(f); /* any that weren't found are returned as "pkg -" */ @@ -145,12 +212,6 @@ static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile, } } -static void oom_die(void) -{ - fprintf(stderr, "Out of memory!\n"); - exit(1); -} - static void dopkgstanzas(char *pkgsfile, char **pkgs, int pkgc) { char buf[MAX_LINE]; diff --git a/admin/debootstrap/patches/100-busybox_fix.patch b/admin/debootstrap/patches/100-busybox_fix.patch index cf0e9af0f7..124d7a4259 100644 --- a/admin/debootstrap/patches/100-busybox_fix.patch +++ b/admin/debootstrap/patches/100-busybox_fix.patch @@ -1,8 +1,6 @@ -Index: debootstrap-1.0.30/usr/share/debootstrap/functions -=================================================================== ---- debootstrap-1.0.30.orig/usr/share/debootstrap/functions 2011-04-28 15:29:13.595340023 +0200 -+++ debootstrap-1.0.30/usr/share/debootstrap/functions 2011-04-28 15:29:23.658843887 +0200 -@@ -800,8 +800,6 @@ +--- a/usr/share/debootstrap/functions ++++ b/usr/share/debootstrap/functions +@@ -839,8 +839,6 @@ choose_extractor () { if [ -n "$EXTRACTOR_OVERRIDE" ]; then extractor="$EXTRACTOR_OVERRIDE"