View | Details | Raw Unified | Return to bug 210374 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/ports/net-p2p/mktorrent/Makefile (+1 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	mktorrent
4
PORTNAME=	mktorrent
5
PORTVERSION=	1.0
5
PORTVERSION=	1.0
6
PORTREVISION=	1
6
CATEGORIES=	net-p2p
7
CATEGORIES=	net-p2p
7
MASTER_SITES=	SF
8
MASTER_SITES=	SF
8
9
(-)/usr/ports/net-p2p/mktorrent/files/patch-init.c (+54 lines)
Line 0 Link Here
1
--- init.c.orig	2009-08-25 18:53:22 UTC
2
+++ init.c
3
@@ -277,7 +277,7 @@ static void print_help()
4
 	  "Options:\n"
5
 #ifdef USE_LONG_OPTIONS
6
 	  "-a, --announce=<url>[,<url>]* : specify the full announce URLs\n"
7
-	  "                                at least one is required\n"
8
+	  "                                at least one is required on private torrent\n"
9
 	  "                                additional -a adds backup trackers\n"
10
 	  "-c, --comment=<comment>       : add a comment to the metainfo\n"
11
 	  "-d, --no-date                 : don't write the creation date\n"
12
@@ -298,7 +298,7 @@ static void print_help()
13
 	  "                                additional -w adds more URLs\n"
14
 #else
15
 	  "-a <url>[,<url>]* : specify the full announce URLs\n"
16
-	  "                    at least one is required\n"
17
+	  "                    at least one is required on private torrent\n"
18
 	  "                    additional -a adds backup trackers\n"
19
 	  "-c <comment>      : add a comment to the metainfo\n"
20
 	  "-d                : don't write the creation date\n"
21
@@ -495,22 +495,25 @@ EXPORT void init(metafile_t *m, int argc
22
 
23
 	/* set the correct piece length.
24
 	   default is 2^18 = 256kb. */
25
-	if (m->piece_length < 15 || m->piece_length > 28) {
26
+	if (m->piece_length < 15 || m->piece_length > 30) {
27
 		fprintf(stderr,
28
 			"The piece length must be a number between "
29
-			"15 and 28.\n");
30
+			"15 and 30.\n");
31
 		exit(EXIT_FAILURE);
32
 	}
33
 	m->piece_length = 1 << m->piece_length;
34
 
35
-	/* user must specify at least one announce URL as it wouldn't make
36
-	 * any sense to have a default for this */
37
+	/* user must specify at least one announce URL when private flag set
38
+	   as it wouldn't make any sense to have a default for this */
39
 	if (m->announce_list == NULL) {
40
-		fprintf(stderr, "Must specify an announce URL. "
41
-			"Use -h for help.\n");
42
-		exit(EXIT_FAILURE);
43
+		if (m->private == 1) {
44
+			fprintf(stderr, "Must specify an announce URL. "
45
+					"Use -h for help.\n");
46
+			exit(EXIT_FAILURE);
47
+		}
48
+	} else {
49
+		announce_last->next = NULL;
50
 	}
51
-	announce_last->next = NULL;
52
 
53
 	/* ..and a file or directory from which to create the torrent */
54
 	if (optind >= argc) {
(-)/usr/ports/net-p2p/mktorrent/files/patch-output.c (+32 lines)
Line 0 Link Here
1
--- output.c.orig	2016-06-18 14:52:41 UTC
2
+++ output.c
3
@@ -119,15 +119,20 @@ EXPORT void write_metainfo(FILE *f, meta
4
 	printf("Writing metainfo file... ");
5
 	fflush(stdout);
6
 
7
-	/* every metainfo file is one big dictonary
8
-	   and the first entry is the announce URL */
9
-	fprintf(f, "d8:announce%lu:%s",
10
-		(unsigned long)strlen(m->announce_list->l->s),
11
-		m->announce_list->l->s);
12
-	/* write the announce-list entry if we have
13
-	   more than one announce URL */
14
-	if (m->announce_list->next || m->announce_list->l->next)
15
-		write_announce_list(f, m->announce_list);
16
+	/* every metainfo file is one big dictonary */
17
+	fprintf(f, "d");
18
+
19
+	/* first entry is the announce URL (optional) */
20
+	if (m->announce_list != NULL) {
21
+		fprintf(f, "8:announce%lu:%s",
22
+			(unsigned long)strlen(m->announce_list->l->s),
23
+			m->announce_list->l->s);
24
+		/* write the announce-list entry if we have
25
+		   more than one announce URL */
26
+		if (m->announce_list->next || m->announce_list->l->next)
27
+			write_announce_list(f, m->announce_list);
28
+	}
29
+
30
 	/* add the comment if one is specified */
31
 	if (m->comment != NULL)
32
 		fprintf(f, "7:comment%lu:%s",

Return to bug 210374