debootstrap: upgrade to version 1.0.38
git-svn-id: svn://svn.openwrt.org/openwrt/packages@30641 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
08c4bae554
commit
2cb1c511ad
@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2010 Gianluigi Tiesi <sherpya@netfarm.it>
|
# Copyright (C) 2010 Gianluigi Tiesi <sherpya@netfarm.it>
|
||||||
# Copyright (C) 2011 OpenWrt.org
|
# Copyright (C) 2011-2012 OpenWrt.org
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -9,12 +9,12 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=debootstrap
|
PKG_NAME:=debootstrap
|
||||||
PKG_VERSION:=1.0.30
|
PKG_VERSION:=1.0.38
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
|
PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
|
||||||
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
|
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 - )
|
UNPACK_CMD=ar -p "$(DL_DIR)/$(PKG_SOURCE)" data.tar.gz | ( cd $(1) && tar -xzf - )
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ define Package/debootstrap/description
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/Compile
|
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
|
$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) ./files/pkgdetails.c -o $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -2,12 +2,41 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#define MAX_LINE 1000
|
#define MAX_LINE 1000
|
||||||
#define MAX_PKGS 100
|
#define MAX_PKGS 100
|
||||||
|
|
||||||
char *checksum_field=NULL;
|
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) {
|
static char *fieldcpy(char *dst, char *fld) {
|
||||||
while (*fld && *fld != ':')
|
while (*fld && *fld != ':')
|
||||||
fld++;
|
fld++;
|
||||||
@ -17,16 +46,36 @@ static char *fieldcpy(char *dst, char *fld) {
|
|||||||
return strcpy(dst, 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) {
|
static void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) {
|
||||||
char buf[MAX_LINE];
|
char buf[MAX_LINE];
|
||||||
char cur_pkg[MAX_LINE];
|
char cur_pkg[MAX_LINE];
|
||||||
char cur_deps[MAX_LINE];
|
char cur_deps[MAX_LINE];
|
||||||
|
char cur_predeps[MAX_LINE];
|
||||||
|
char prev_pkg[MAX_LINE];
|
||||||
char *pkgs[MAX_PKGS];
|
char *pkgs[MAX_PKGS];
|
||||||
int i;
|
int i;
|
||||||
int skip;
|
int skip;
|
||||||
FILE *f;
|
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];
|
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;
|
int any = 0;
|
||||||
skip = 1;
|
skip = 1;
|
||||||
fieldcpy(cur_pkg, buf);
|
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++) {
|
for (i = 0; i < pkgc; i++) {
|
||||||
if (!pkgs[i]) continue;
|
if (!pkgs[i]) continue;
|
||||||
any = 1;
|
any = 1;
|
||||||
if (strcmp(cur_pkg, pkgs[i]) == 0) {
|
if (strcmp(cur_pkg, pkgs[i]) == 0) {
|
||||||
skip = 0;
|
skip = 0;
|
||||||
pkgs[i] = NULL;
|
output_pkg = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!any) break;
|
if (!any) break;
|
||||||
} else if (!skip &&
|
} else if (!skip && strncasecmp(buf, "Depends:", 8) == 0)
|
||||||
(strncasecmp(buf, "Depends:", 8) == 0 ||
|
|
||||||
strncasecmp(buf, "Pre-Depends:", 12) == 0))
|
|
||||||
{
|
|
||||||
char *pch;
|
|
||||||
fieldcpy(cur_deps, buf);
|
fieldcpy(cur_deps, buf);
|
||||||
pch = cur_deps;
|
else if (!skip && strncasecmp(buf, "Pre-Depends:", 12) == 0)
|
||||||
while (1) {
|
fieldcpy(cur_predeps, buf);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (cur_deps[0])
|
||||||
|
outputdeps(cur_deps);
|
||||||
|
if (cur_predeps[0])
|
||||||
|
outputdeps(cur_predeps);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,11 +136,14 @@ static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile,
|
|||||||
char cur_size[MAX_LINE];
|
char cur_size[MAX_LINE];
|
||||||
char cur_checksum[MAX_LINE];
|
char cur_checksum[MAX_LINE];
|
||||||
char cur_filename[MAX_LINE];
|
char cur_filename[MAX_LINE];
|
||||||
|
char prev_pkg[MAX_LINE];
|
||||||
char *pkgs[MAX_PKGS];
|
char *pkgs[MAX_PKGS];
|
||||||
int i;
|
int i;
|
||||||
FILE *f;
|
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];
|
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) {
|
if (strncasecmp(buf, "Package:", 8) == 0) {
|
||||||
fieldcpy(cur_pkg, buf);
|
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) {
|
} else if (strncasecmp(buf, "Version:", 8) == 0) {
|
||||||
fieldcpy(cur_ver, buf);
|
fieldcpy(cur_ver, buf);
|
||||||
} else if (strncasecmp(buf, "Architecture:", 13) == 0) {
|
} else if (strncasecmp(buf, "Architecture:", 13) == 0) {
|
||||||
@ -125,14 +186,20 @@ static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile,
|
|||||||
if (!pkgs[i]) continue;
|
if (!pkgs[i]) continue;
|
||||||
any = 1;
|
any = 1;
|
||||||
if (strcmp(cur_field, pkgs[i]) == 0) {
|
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);
|
free(output);
|
||||||
if (uniq) pkgs[i] = NULL;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!any) break;
|
if (!any) break;
|
||||||
|
cur_field[0] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (output)
|
||||||
|
fputs(output, stdout);
|
||||||
|
if (uniq && output_pkg != -1)
|
||||||
|
pkgs[output_pkg] = NULL;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
/* any that weren't found are returned as "pkg -" */
|
/* 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)
|
static void dopkgstanzas(char *pkgsfile, char **pkgs, int pkgc)
|
||||||
{
|
{
|
||||||
char buf[MAX_LINE];
|
char buf[MAX_LINE];
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
Index: debootstrap-1.0.30/usr/share/debootstrap/functions
|
--- a/usr/share/debootstrap/functions
|
||||||
===================================================================
|
+++ b/usr/share/debootstrap/functions
|
||||||
--- debootstrap-1.0.30.orig/usr/share/debootstrap/functions 2011-04-28 15:29:13.595340023 +0200
|
@@ -839,8 +839,6 @@ choose_extractor () {
|
||||||
+++ debootstrap-1.0.30/usr/share/debootstrap/functions 2011-04-28 15:29:23.658843887 +0200
|
|
||||||
@@ -800,8 +800,6 @@
|
|
||||||
|
|
||||||
if [ -n "$EXTRACTOR_OVERRIDE" ]; then
|
if [ -n "$EXTRACTOR_OVERRIDE" ]; then
|
||||||
extractor="$EXTRACTOR_OVERRIDE"
|
extractor="$EXTRACTOR_OVERRIDE"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user