Re: [OpenWrt-Devel] update and optimize git package

2010-11-28 Thread Florian Fainelli

Le 17/11/2010 13:09, Bastian Pranzas a écrit :

Hi,

this patch updates the git package to 1.7.3.2 and does two
optimizations to shrink the package size from 45MB to 590KB:

- create symlinks instead of hardlinks when installing (hardlinks get
lost when copying)
- convert the last six non built in tools to built ins

Regards,
Bastian Pranzas

Applied in r24175, thanks!
--
Florian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] update and optimize git package

2010-11-27 Thread Luka Perkov
On Wed, Nov 17, 2010 at 01:09:12PM +0100, Bastian Pranzas wrote:
> this patch updates the git package to 1.7.3.2 and does two
> optimizations to shrink the package size from 45MB to 590KB:
> 
> - create symlinks instead of hardlinks when installing (hardlinks get
> lost when copying)
> - convert the last six non built in tools to built ins

I have no problems with git after applying this patch... This patch
should be applied because it reduces size significantly!

Luka

> Index: net/git/patches/001-convert_builtin.patch
> ===
> --- net/git/patches/001-convert_builtin.patch (Revision 0)
> +++ net/git/patches/001-convert_builtin.patch (Revision 0)
> @@ -0,0 +1,235 @@
> +diff -Nur git-1.7.3.2-orig/builtin/daemon.c git-1.7.3.2/builtin/daemon.c
> +--- git-1.7.3.2-orig/builtin/daemon.c1970-01-01 01:00:00.0 
> +0100
>  git-1.7.3.2/builtin/daemon.c 2010-11-17 12:30:47.977921001 +0100
> +@@ -0,0 +1 @@
> ++#include "../daemon.c"
> +diff -Nur git-1.7.3.2-orig/builtin/fast-import.c 
> git-1.7.3.2/builtin/fast-import.c
> +--- git-1.7.3.2-orig/builtin/fast-import.c   1970-01-01 01:00:00.0 
> +0100
>  git-1.7.3.2/builtin/fast-import.c2010-11-17 12:30:47.977921001 
> +0100
> +@@ -0,0 +1 @@
> ++#include "../fast-import.c"
> +diff -Nur git-1.7.3.2-orig/builtin/http-backend.c 
> git-1.7.3.2/builtin/http-backend.c
> +--- git-1.7.3.2-orig/builtin/http-backend.c  1970-01-01 01:00:00.0 
> +0100
>  git-1.7.3.2/builtin/http-backend.c   2010-11-17 12:30:47.977921001 
> +0100
> +@@ -0,0 +1 @@
> ++#include "../http-backend.c"
> +diff -Nur git-1.7.3.2-orig/builtin/imap-send.c 
> git-1.7.3.2/builtin/imap-send.c
> +--- git-1.7.3.2-orig/builtin/imap-send.c 1970-01-01 01:00:00.0 
> +0100
>  git-1.7.3.2/builtin/imap-send.c  2010-11-17 12:30:47.977921001 +0100
> +@@ -0,0 +1 @@
> ++#include "../imap-send.c"
> +diff -Nur git-1.7.3.2-orig/builtin/shell.c git-1.7.3.2/builtin/shell.c
> +--- git-1.7.3.2-orig/builtin/shell.c 1970-01-01 01:00:00.0 +0100
>  git-1.7.3.2/builtin/shell.c  2010-11-17 12:30:47.977921001 +0100
> +@@ -0,0 +1 @@
> ++#include "../shell.c"
> +diff -Nur git-1.7.3.2-orig/builtin/upload-pack.c 
> git-1.7.3.2/builtin/upload-pack.c
> +--- git-1.7.3.2-orig/builtin/upload-pack.c   1970-01-01 01:00:00.0 
> +0100
>  git-1.7.3.2/builtin/upload-pack.c2010-11-17 12:30:47.977921001 
> +0100
> +@@ -0,0 +1 @@
> ++#include "../upload-pack.c"
> +diff -Nur git-1.7.3.2-orig/builtin.h git-1.7.3.2/builtin.h
> +--- git-1.7.3.2-orig/builtin.h   2010-10-22 05:49:16.0 +0200
>  git-1.7.3.2/builtin.h2010-11-17 12:30:47.977921001 +0100
> +@@ -139,5 +139,11 @@
> + extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
> + extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
> + extern int cmd_replace(int argc, const char **argv, const char *prefix);
> ++extern int cmd_shell(int argc, char **argv, const char *prefix);
> ++extern int cmd_upload_pack(int argc, char **argv, const char *prefix);
> ++extern int cmd_http_backend(int argc, char **argv, const char *prefix);
> ++extern int cmd_daemon(int argc, char **argv, const char *prefix);
> ++extern int cmd_imap_send(int argc, char **argv, const char *prefix);
> ++extern int cmd_fast_import(int argc, const char **argv, const char *prefix);
> + 
> + #endif
> +diff -Nur git-1.7.3.2-orig/daemon.c git-1.7.3.2/daemon.c
> +--- git-1.7.3.2-orig/daemon.c2010-10-22 05:49:16.0 +0200
>  git-1.7.3.2/daemon.c 2010-11-17 12:30:47.977921001 +0100
> +@@ -963,7 +963,7 @@
> + return service_loop(socknum, socklist);
> + }
> + 
> +-int main(int argc, char **argv)
> ++int cmd_daemon(int argc, char **argv, const char *prefix)
> + {
> + int listen_port = 0;
> + char *listen_addr = NULL;
> +diff -Nur git-1.7.3.2-orig/fast-import.c git-1.7.3.2/fast-import.c
> +--- git-1.7.3.2-orig/fast-import.c   2010-10-22 05:49:16.0 +0200
>  git-1.7.3.2/fast-import.c2010-11-17 12:30:47.977921001 +0100
> +@@ -2912,7 +2912,7 @@
> + read_marks();
> + }
> + 
> +-int main(int argc, const char **argv)
> ++int cmd_fast_import(int argc, const char **argv, const char *prefix)
> + {
> + unsigned int i;
> + 
> +diff -Nur git-1.7.3.2-orig/git.c git-1.7.3.2/git.c
> +--- git-1.7.3.2-orig/git.c   2010-10-22 05:49:16.0 +0200
>  git-1.7.3.2/git.c2010-11-17 12:30:47.977921001 +0100
> +@@ -240,11 +240,11 @@
> + 
> + struct cmd_struct {
> + const char *cmd;
> +-int (*fn)(int, const char **, const char *);
> ++int (*fn)(int, char **, const char *);
> + int option;
> + };
> + 
> +-static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
> ++static int run_builtin(struct cmd_struct *p, int argc, char **argv)
> + {
> + int status, help;
> + struct stat st;
> +@@ -293,7 +293,7 @@
> + return 0;
> + }
> + 
>

Re: [OpenWrt-Devel] update and optimize git package

2010-11-17 Thread Bastian Pranzas

On -10.01.-28163 20:59, Geert Uytterhoeven wrote:

On Wed, Nov 17, 2010 at 13:09, Bastian Pranzas  wrote:

- create symlinks instead of hardlinks when installing (hardlinks get
lost when copying)

Isn't that a bug in the copying code?
I guess it is. Didn't know until now that cp can preserve hard links 
also. I thought when the man page says "links" it was about soft links.


Well it doesn't matter so much, because the makefile creates most of the 
tools with links, but not all of them. It uses install for some, which 
doesn't preserve links and has no option to do so (just checked to be 
sure). So even if we could teach every tool involved to preserve links, 
we would end up with a blown up package again.


G,
Bastian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] update and optimize git package

2010-11-17 Thread Geert Uytterhoeven
On Wed, Nov 17, 2010 at 13:09, Bastian Pranzas  wrote:
> - create symlinks instead of hardlinks when installing (hardlinks get
> lost when copying)

Isn't that a bug in the copying code?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] update and optimize git package

2010-11-17 Thread Bastian Pranzas
Hi,

this patch updates the git package to 1.7.3.2 and does two
optimizations to shrink the package size from 45MB to 590KB:

- create symlinks instead of hardlinks when installing (hardlinks get
lost when copying)
- convert the last six non built in tools to built ins

Regards,
Bastian Pranzas
Index: net/git/patches/001-convert_builtin.patch
===
--- net/git/patches/001-convert_builtin.patch	(Revision 0)
+++ net/git/patches/001-convert_builtin.patch	(Revision 0)
@@ -0,0 +1,235 @@
+diff -Nur git-1.7.3.2-orig/builtin/daemon.c git-1.7.3.2/builtin/daemon.c
+--- git-1.7.3.2-orig/builtin/daemon.c	1970-01-01 01:00:00.0 +0100
 git-1.7.3.2/builtin/daemon.c	2010-11-17 12:30:47.977921001 +0100
+@@ -0,0 +1 @@
++#include "../daemon.c"
+diff -Nur git-1.7.3.2-orig/builtin/fast-import.c git-1.7.3.2/builtin/fast-import.c
+--- git-1.7.3.2-orig/builtin/fast-import.c	1970-01-01 01:00:00.0 +0100
 git-1.7.3.2/builtin/fast-import.c	2010-11-17 12:30:47.977921001 +0100
+@@ -0,0 +1 @@
++#include "../fast-import.c"
+diff -Nur git-1.7.3.2-orig/builtin/http-backend.c git-1.7.3.2/builtin/http-backend.c
+--- git-1.7.3.2-orig/builtin/http-backend.c	1970-01-01 01:00:00.0 +0100
 git-1.7.3.2/builtin/http-backend.c	2010-11-17 12:30:47.977921001 +0100
+@@ -0,0 +1 @@
++#include "../http-backend.c"
+diff -Nur git-1.7.3.2-orig/builtin/imap-send.c git-1.7.3.2/builtin/imap-send.c
+--- git-1.7.3.2-orig/builtin/imap-send.c	1970-01-01 01:00:00.0 +0100
 git-1.7.3.2/builtin/imap-send.c	2010-11-17 12:30:47.977921001 +0100
+@@ -0,0 +1 @@
++#include "../imap-send.c"
+diff -Nur git-1.7.3.2-orig/builtin/shell.c git-1.7.3.2/builtin/shell.c
+--- git-1.7.3.2-orig/builtin/shell.c	1970-01-01 01:00:00.0 +0100
 git-1.7.3.2/builtin/shell.c	2010-11-17 12:30:47.977921001 +0100
+@@ -0,0 +1 @@
++#include "../shell.c"
+diff -Nur git-1.7.3.2-orig/builtin/upload-pack.c git-1.7.3.2/builtin/upload-pack.c
+--- git-1.7.3.2-orig/builtin/upload-pack.c	1970-01-01 01:00:00.0 +0100
 git-1.7.3.2/builtin/upload-pack.c	2010-11-17 12:30:47.977921001 +0100
+@@ -0,0 +1 @@
++#include "../upload-pack.c"
+diff -Nur git-1.7.3.2-orig/builtin.h git-1.7.3.2/builtin.h
+--- git-1.7.3.2-orig/builtin.h	2010-10-22 05:49:16.0 +0200
 git-1.7.3.2/builtin.h	2010-11-17 12:30:47.977921001 +0100
+@@ -139,5 +139,11 @@
+ extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
+ extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
+ extern int cmd_replace(int argc, const char **argv, const char *prefix);
++extern int cmd_shell(int argc, char **argv, const char *prefix);
++extern int cmd_upload_pack(int argc, char **argv, const char *prefix);
++extern int cmd_http_backend(int argc, char **argv, const char *prefix);
++extern int cmd_daemon(int argc, char **argv, const char *prefix);
++extern int cmd_imap_send(int argc, char **argv, const char *prefix);
++extern int cmd_fast_import(int argc, const char **argv, const char *prefix);
+ 
+ #endif
+diff -Nur git-1.7.3.2-orig/daemon.c git-1.7.3.2/daemon.c
+--- git-1.7.3.2-orig/daemon.c	2010-10-22 05:49:16.0 +0200
 git-1.7.3.2/daemon.c	2010-11-17 12:30:47.977921001 +0100
+@@ -963,7 +963,7 @@
+ 	return service_loop(socknum, socklist);
+ }
+ 
+-int main(int argc, char **argv)
++int cmd_daemon(int argc, char **argv, const char *prefix)
+ {
+ 	int listen_port = 0;
+ 	char *listen_addr = NULL;
+diff -Nur git-1.7.3.2-orig/fast-import.c git-1.7.3.2/fast-import.c
+--- git-1.7.3.2-orig/fast-import.c	2010-10-22 05:49:16.0 +0200
 git-1.7.3.2/fast-import.c	2010-11-17 12:30:47.977921001 +0100
+@@ -2912,7 +2912,7 @@
+ 		read_marks();
+ }
+ 
+-int main(int argc, const char **argv)
++int cmd_fast_import(int argc, const char **argv, const char *prefix)
+ {
+ 	unsigned int i;
+ 
+diff -Nur git-1.7.3.2-orig/git.c git-1.7.3.2/git.c
+--- git-1.7.3.2-orig/git.c	2010-10-22 05:49:16.0 +0200
 git-1.7.3.2/git.c	2010-11-17 12:30:47.977921001 +0100
+@@ -240,11 +240,11 @@
+ 
+ struct cmd_struct {
+ 	const char *cmd;
+-	int (*fn)(int, const char **, const char *);
++	int (*fn)(int, char **, const char *);
+ 	int option;
+ };
+ 
+-static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
++static int run_builtin(struct cmd_struct *p, int argc, char **argv)
+ {
+ 	int status, help;
+ 	struct stat st;
+@@ -293,7 +293,7 @@
+ 	return 0;
+ }
+ 
+-static void handle_internal_command(int argc, const char **argv)
++static void handle_internal_command(int argc, char **argv)
+ {
+ 	const char *cmd = argv[0];
+ 	static struct cmd_struct commands[] = {
+@@ -405,6 +405,12 @@
+ 		{ "verify-pack", cmd_verify_pack },
+ 		{ "show-ref", cmd_show_ref, RUN_SETUP },
+ 		{ "pack-refs", cmd_pack_refs, RUN_SETUP },
++		{ "shell", cmd_shell },
++		{ "upload-pack", cmd_upload_pack },
++		{ "http-backend", cmd_http_backend },
++		{ "daemon", cmd_daemon },
++		{ "imap-send", cmd_imap_send }