upgrade debootstrap package
git-svn-id: svn://svn.openwrt.org/openwrt/packages@26839 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
ce37621aee
commit
26d64dc100
@ -1,5 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2010 Gianluigi Tiesi <sherpya@netfarm.it>
|
# Copyright (C) 2010 Gianluigi Tiesi <sherpya@netfarm.it>
|
||||||
|
# Copyright (C) 2011 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.
|
||||||
@ -8,40 +9,46 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=debootstrap
|
PKG_NAME:=debootstrap
|
||||||
PKG_VERSION:=1.0.28
|
PKG_VERSION:=1.0.30
|
||||||
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:=dee0dc77573d88af80b225d8810ab7a1
|
PKG_MD5SUM:=d87b35670aa735ae5b7d3f8bf1b76245
|
||||||
|
|
||||||
#UNPACK_CMD=dpkg-deb --fsys-tarfile $(DL_DIR)/$(PKG_SOURCE) | ( cd $(1) && tar -xf - )
|
|
||||||
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 - )
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/debootstrap
|
define Package/debootstrap
|
||||||
SECTION:=admin
|
SECTION:=admin
|
||||||
CATEGORY:=Administration
|
CATEGORY:=Administration
|
||||||
TITLE:=Bootstrap a basic Debian system
|
TITLE:=Bootstrap a basic Debian system
|
||||||
URL:=http://wiki.debian.org/Debootstrap
|
URL:=http://wiki.debian.org/Debootstrap
|
||||||
DEPENDS:=+coreutils-chroot
|
DEPENDS:=+coreutils-chroot +coreutils-sha1sum
|
||||||
MAINTAINER:=Gianluigi Tiesi <sherpya@netfarm.it>
|
MAINTAINER:=Luka Perkov <openwrt@lukaperkov.net>
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/debootstrap/description
|
define Package/debootstrap/description
|
||||||
debootstrap is used to create a Debian base system from scratch,
|
debootstrap is used to create a Debian base system from scratch, without
|
||||||
without requiring the availability of dpkg or apt. It does this by
|
requiring the availability of dpkg or apt. It does this by downloading .deb
|
||||||
downloading .deb files from a mirror site, and carefully unpacking them
|
files from a mirror site, and carefully unpacking them into a directory which
|
||||||
into a directory which can eventually be chrooted into.
|
can eventually be chrooted into.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
|
# file pkgdetails.c was imported from debian package base-installer version 1.119
|
||||||
$(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
|
||||||
|
|
||||||
define Package/debootstrap/install
|
define Package/debootstrap/install
|
||||||
cd $(PKG_BUILD_DIR) && ( $(FIND) usr | cpio -pd $(1) )
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/sbin/$(PKG_NAME) $(1)/usr/sbin
|
||||||
|
$(INSTALL_DIR) $(1)/usr/share/debootstrap
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails $(1)/usr/share/debootstrap
|
||||||
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/functions $(1)/usr/share/debootstrap
|
||||||
|
$(INSTALL_DIR) $(1)/usr/share/debootstrap/scripts
|
||||||
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/scripts/* $(1)/usr/share/debootstrap/scripts
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,debootstrap))
|
$(eval $(call BuildPackage,debootstrap))
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#define MAX_LINE 1000
|
#define MAX_LINE 1000
|
||||||
#define MAX_PKGS 100
|
#define MAX_PKGS 100
|
||||||
|
|
||||||
|
char *checksum_field=NULL;
|
||||||
|
|
||||||
static char *fieldcpy(char *dst, char *fld) {
|
static char *fieldcpy(char *dst, char *fld) {
|
||||||
while (*fld && *fld != ':')
|
while (*fld && *fld != ':')
|
||||||
fld++;
|
fld++;
|
||||||
@ -84,7 +86,7 @@ static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile,
|
|||||||
char cur_ver[MAX_LINE];
|
char cur_ver[MAX_LINE];
|
||||||
char cur_arch[MAX_LINE];
|
char cur_arch[MAX_LINE];
|
||||||
char cur_size[MAX_LINE];
|
char cur_size[MAX_LINE];
|
||||||
char cur_md5[MAX_LINE];
|
char cur_checksum[MAX_LINE];
|
||||||
char cur_filename[MAX_LINE];
|
char cur_filename[MAX_LINE];
|
||||||
char *pkgs[MAX_PKGS];
|
char *pkgs[MAX_PKGS];
|
||||||
int i;
|
int i;
|
||||||
@ -112,8 +114,9 @@ static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile,
|
|||||||
fieldcpy(cur_arch, buf);
|
fieldcpy(cur_arch, buf);
|
||||||
} else if (strncasecmp(buf, "Size:", 5) == 0) {
|
} else if (strncasecmp(buf, "Size:", 5) == 0) {
|
||||||
fieldcpy(cur_size, buf);
|
fieldcpy(cur_size, buf);
|
||||||
} else if (strncasecmp(buf, "MD5sum:", 7) == 0) {
|
} else if (strncasecmp(buf, checksum_field, strlen(checksum_field)) == 0
|
||||||
fieldcpy(cur_md5, buf);
|
&& buf[strlen(checksum_field)] == ':') {
|
||||||
|
fieldcpy(cur_checksum, buf);
|
||||||
} else if (strncasecmp(buf, "Filename:", 9) == 0) {
|
} else if (strncasecmp(buf, "Filename:", 9) == 0) {
|
||||||
fieldcpy(cur_filename, buf);
|
fieldcpy(cur_filename, buf);
|
||||||
} else if (!*buf) {
|
} else if (!*buf) {
|
||||||
@ -122,7 +125,7 @@ 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_md5, cur_size);
|
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;
|
if (uniq) pkgs[i] = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -230,6 +233,11 @@ static int dotranslatewgetpercent(int low, int high, int end, char *str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
checksum_field=getenv("DEBOOTSTRAP_CHECKSUM_FIELD");
|
||||||
|
if (checksum_field == NULL) {
|
||||||
|
checksum_field="MD5sum";
|
||||||
|
}
|
||||||
|
|
||||||
if ((argc == 6 || argc == 5) && strcmp(argv[1], "WGET%") == 0) {
|
if ((argc == 6 || argc == 5) && strcmp(argv[1], "WGET%") == 0) {
|
||||||
if (dotranslatewgetpercent(atoi(argv[2]), atoi(argv[3]),
|
if (dotranslatewgetpercent(atoi(argv[2]), atoi(argv[3]),
|
||||||
atoi(argv[4]), argc == 6 ? argv[5] : NULL))
|
atoi(argv[4]), argc == 6 ? argv[5] : NULL))
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
--- debootstrap-1.0.26/usr/share/debootstrap/functions 2010-11-12 13:07:47.000000000 +0100
|
|
||||||
+++ debootstrap-1.0.26/usr/share/debootstrap/functions 2010-11-26 21:55:06.440000562 +0100
|
|
||||||
@@ -800,8 +800,9 @@
|
|
||||||
|
|
||||||
if [ -n "$EXTRACTOR_OVERRIDE" ]; then
|
|
||||||
extractor="$EXTRACTOR_OVERRIDE"
|
|
||||||
- elif type dpkg-deb >/dev/null 2>&1; then
|
|
||||||
- extractor="dpkg-deb"
|
|
||||||
+# busybox's dpkg-deb is not suitable for this script
|
|
||||||
+# elif type dpkg-deb >/dev/null 2>&1; then
|
|
||||||
+# extractor="dpkg-deb"
|
|
||||||
else
|
|
||||||
extractor="ar"
|
|
||||||
fi
|
|
13
admin/debootstrap/patches/100-busybox_fix.patch
Normal file
13
admin/debootstrap/patches/100-busybox_fix.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
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 @@
|
||||||
|
|
||||||
|
if [ -n "$EXTRACTOR_OVERRIDE" ]; then
|
||||||
|
extractor="$EXTRACTOR_OVERRIDE"
|
||||||
|
- elif type dpkg-deb >/dev/null 2>&1; then
|
||||||
|
- extractor="dpkg-deb"
|
||||||
|
else
|
||||||
|
extractor="ar"
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user