* added the Unlicense as valid in misc/share/REGISTER
[t2sde.git] / package / archiver / mine / gasgui-any-archiver.patch
bloba450cce697ad4bd4d50ead8a026d0398d91c2669
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../mine/gasgui-any-archiver.patch
5 # Copyright (C) 2005 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
18 Likewise allow handling of any compressed tarball.
20 - Rene Rebe <rene@exactcode.de>
22 --- mine-0.23/gasgui.c 2005-03-23 09:51:06.000000000 +0100
23 +++ mine-0.23-patched/gasgui.c 2005-12-18 19:17:08.000000000 +0100
24 @@ -39,6 +39,8 @@
25 char * sourcedir = "/mnt/cdrom0";
26 char * sourceopt = "ro";
28 +char * sourcefmt = "tar.bz2";
30 char * mine_command = "mine";
31 char * mine_fopt = "";
33 @@ -68,6 +70,7 @@
34 " -D Read package db and dump the memory DB as tree (debug).\n"
35 " -T Don't really execute 'mine', print commands instead (debug).\n"
36 " -F Start mine with the '-f' option (used by install scripts).\n"
37 +" -S Source format, e.g. tar.bz2, tar.gz or gem\n"
38 "\n"
41 @@ -110,27 +113,27 @@
42 char command[1024];
44 while ( !strncmp(sourcedir, "http://", 7) || !strncmp(sourcedir, "ftp://", 6) ) {
45 - snprintf(gemfile, 1024, "%s/%s-%s.gem",
46 - targetdir, p->name, p->version);
47 + snprintf(gemfile, 1024, "%s/%s-%s.%s",
48 + targetdir, p->name, p->version, sourcefmt);
50 - snprintf(command, 1024, "wget -O '%s' -q '%s/%s/pkgs/%s-%s.gem'",
51 - gemfile, sourcedir, config, p->name, p->version);
52 + snprintf(command, 1024, "wget -O '%s' -q '%s/%s/pkgs/%s-%s.%s'",
53 + gemfile, sourcedir, config, p->name, p->version, sourcefmt);
54 system(command);
55 snprintf(command, 1024, "test -s '%s' || rm -f %s", gemfile, gemfile);
56 system(command);
57 if ( !access(gemfile, F_OK) ) return gemfile;
59 - snprintf(command, 1024, "wget -O '%s' -q '%s/%s/pkgs/%s.gem'",
60 - gemfile, sourcedir, config, p->name);
61 + snprintf(command, 1024, "wget -O '%s' -q '%s/%s/pkgs/%s.%s'",
62 + gemfile, sourcedir, config, p->name, sourcefmt);
63 system(command);
64 snprintf(command, 1024, "test -s '%s' || rm -f %s", gemfile, gemfile);
65 system(command);
66 if ( !access(gemfile, F_OK) ) return gemfile;
68 - printf("Can't find: %s/%s/pkgs/%s-%s.gem\n",
69 - sourcedir, config, p->name, p->version);
70 - printf("Can't find: %s/%s/pkgs/%s.gem\n",
71 - sourcedir, config, p->name);
72 + printf("Can't find: %s/%s/pkgs/%s-%s.%s\n",
73 + sourcedir, config, p->name, p->version, sourcefmt);
74 + printf("Can't find: %s/%s/pkgs/%s.%s\n",
75 + sourcedir, config, p->name, sourcefmt);
76 printf("Not found on webserver: %s\n\n", p->name);
77 while (1) {
78 printf("Skip or Retry (default=Retry) > ");
79 @@ -143,12 +146,12 @@
82 while (1) {
83 - snprintf(gemfile, 1024, "%s/%s/pkgs/%s-%s.gem",
84 - sourcedir, config, p->name, p->version);
85 + snprintf(gemfile, 1024, "%s/%s/pkgs/%s-%s.%s",
86 + sourcedir, config, p->name, p->version, sourcefmt);
87 if ( !access(gemfile, F_OK) ) return gemfile;
89 - snprintf(gemfile, 1024, "%s/%s/pkgs/%s.gem",
90 - sourcedir, config, p->name);
91 + snprintf(gemfile, 1024, "%s/%s/pkgs/%s.%s",
92 + sourcedir, config, p->name, sourcefmt);
93 if ( !access(gemfile, F_OK) ) return gemfile;
95 /* looks like there are sometimes races with asyncrounously running mine subprocesses or something
96 @@ -156,10 +159,10 @@
97 snprintf(command, 1024, "umount -v %s &> /dev/null || { sleep 1; umount -v %s; }", sourcedir, sourcedir);
98 system(command);
100 - printf("Can't find: %s/%s/pkgs/%s-%s.gem\n",
101 - sourcedir, config, p->name, p->version);
102 - printf("Can't find: %s/%s/pkgs/%s.gem\n",
103 - sourcedir, config, p->name);
104 + printf("Can't find: %s/%s/pkgs/%s-%s.%s\n",
105 + sourcedir, config, p->name, p->version, sourcefmt);
106 + printf("Can't find: %s/%s/pkgs/%s.%s\n",
107 + sourcedir, config, p->name, sourcefmt);
108 printf("Not found on current disk: %s\n\n", p->name);
109 printf("Please insert Disk #%d and press ENTER.\n\n",
110 p->disk_number);
111 @@ -174,12 +177,12 @@
112 eject_disk ();
115 - snprintf(gemfile, 1024, "%s/%s/pkgs/%s-%s.gem",
116 - sourcedir, config, p->name, p->version);
117 + snprintf(gemfile, 1024, "%s/%s/pkgs/%s-%s.%s",
118 + sourcedir, config, p->name, p->version, sourcefmt);
119 if ( !access(gemfile, F_OK) ) return gemfile;
121 - snprintf(gemfile, 1024, "%s/%s/pkgs/%s.gem",
122 - sourcedir, config, p->name);
123 + snprintf(gemfile, 1024, "%s/%s/pkgs/%s.%s",
124 + sourcedir, config, p->name, sourcefmt);
125 if ( !access(gemfile, F_OK) ) return gemfile;
127 snprintf(command, 1024, "mount -v -o %s %s %s",
128 @@ -237,7 +240,7 @@
129 struct package *p;
130 int opt, disk;
132 - while ( (opt = getopt(argc, argv, "c:t:d:s:o:DTF")) != -1 ) {
133 + while ( (opt = getopt(argc, argv, "c:t:d:s:o:S:DTF")) != -1 ) {
134 switch (opt) {
135 case 'c':
136 config = optarg;
137 @@ -263,6 +266,9 @@
138 case 'F':
139 mine_fopt = "-f";
140 break;
141 + case 'S':
142 + sourcefmt = optarg;
143 + break;
144 default:
145 help();
146 return 0;