/[gentoo-x86]/net-misc/sitecopy/files/sitecopy-0.16.6-01-remote-dynamic-rc.patch
Gentoo

Contents of /net-misc/sitecopy/files/sitecopy-0.16.6-01-remote-dynamic-rc.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sat Jan 31 00:21:27 2015 UTC (5 years ago) by idella4
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-diff
bump subsequent to bug #500070, new patches to match, bump EAPI, removed -0.16.6_p3, all wrt bug #500070

(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0xB8072B0D)

1 From: Jesus Climent <jesus dot climent at hispalinux dot es>
2 Subject: A patch for generating dynamic rc files
3
4 diff -u sitecopy-0.16.3-orig/src/console_fe.c sitecopy-0.16.3/src/console_fe.c
5 --- sitecopy-0.16.3-orig/src/console_fe.c 2006-10-27 18:55:19.000000000 +0530
6 +++ sitecopy-0.16.3/src/console_fe.c 2006-10-27 18:39:06.000000000 +0530
7 @@ -155,7 +155,8 @@
8 show_progress, /* Do they want the %-complete messages */
9 prompting, /* Did they say --prompting? */
10 keepgoing, /* Did they say --keep-going? */
11 - dry_run; /* Did they say --dry-run? */
12 + dry_run, /* Did they say --dry-run? */
13 + createremoteroot=false; /* Did they say --create-remote? */
14
15 /* Functions prototypes */
16 static void init(int, char **);
17 @@ -222,9 +223,9 @@
18 exit(-1);
19 }
20
21 - for (current=all_sites; current!=NULL; current=current->next) {
22 + for (current=all_sites; current!=NULL; current=current->next) {
23
24 - if (current->use_this || allsites) {
25 + if (current->use_this || allsites) {
26 if (!listflat && quiet == 0) {
27 /* Display the banner line */
28 const char *str_action = _(actions[action].doing);
29 @@ -507,6 +508,9 @@
30 }
31 } break;
32 #endif
33 + case 'x':
34 + createremoteroot = true;
35 + break;
36 case 'y':
37 prompting = true;
38 break;
39 @@ -1210,7 +1214,8 @@
40 int ret = 0, verify_removed;
41
42 /* Set the options */
43 - site->keep_going = keepgoing;
44 + site->keep_going = keepgoing;
45 + site->create_remote_root = createremoteroot;
46
47 switch (act) {
48 case action_update:
49 @@ -1354,6 +1359,7 @@
50 " -p, --storepath=PATH Use alternate site storage directory\n"
51 " -y, --prompting Request confirmation before making each update\n"
52 " -a, --allsites Perform the operation on ALL defined sites\n"
53 +" -x, --create-remote Create root for remote site\n"
54 " -k, --keep-going Carry on an update regardless of errors\n"
55 " -o, --show-progress Display total percentage file transfer complete\n"
56 " -q, --quiet Be quiet while performing the operation\n"
57 diff -u sitecopy-0.16.3-orig/src/sites.c sitecopy-0.16.3/src/sites.c
58 --- sitecopy-0.16.3-orig/src/sites.c 2006-03-02 01:08:21.000000000 +0530
59 +++ sitecopy-0.16.3/src/sites.c 2006-10-27 19:12:30.000000000 +0530
60 @@ -94,7 +94,6 @@
61 struct site_file *current;
62 char *full_local;
63 int ret;
64 -
65 ret = 0;
66
67 for_each_file(current, site) {
68 @@ -312,11 +311,52 @@
69 free(full_remote);
70 }
71
72 +static int create_remote_root_dirs(struct site *site, void *session)
73 +{
74 + char *buffer;
75 + int i,j=0,ret=1,flag=1;
76 +
77 + buffer = (char *) calloc(strlen(site->remote_root)+1,sizeof(char));
78 +
79 + buffer[j++] = '/';
80 +
81 + for( i=1 ; site->remote_root[i] != '\0' ; i++ )
82 + {
83 + if (site->remote_root[i] == '/')
84 + flag = 0;
85 +
86 + if (flag)
87 + buffer[j++] = site->remote_root[i];
88 + else
89 + if (j > 0)
90 + {
91 + buffer[j] = '\0';
92 + ret = CALL(dir_create)(session, buffer);
93 +
94 + if (ret != SITE_OK)
95 + ret = 0;
96 +
97 + buffer[j++] = '/';
98 + flag=1;
99 + }
100 + }
101 +
102 + return ret;
103 +}
104 +
105 /* Create new directories and change permissions on existing directories. */
106 static int update_create_directories(struct site *site, void *session)
107 {
108 struct site_file *current;
109 - int ret = 0;
110 + int ret = 0, ret_root_dir;
111 +
112 + if (site->create_remote_root) /* We create remote init struct before updating the whole stuff */
113 + {
114 + ret_root_dir = create_remote_root_dirs(site,session);
115 +
116 + if (!ret_root_dir)
117 + fe_warning (_("I couldn't create some dir. already exists?"),NULL,NULL);
118 + }
119
120 for_each_file(current, site) {
121 if ((current->type == file_dir)
122 diff -u sitecopy-0.16.3-orig/src/sites.h sitecopy-0.16.3/src/sites.h
123 --- sitecopy-0.16.3-orig/src/sites.h 2006-02-04 17:46:36.000000000 +0530
124 +++ sitecopy-0.16.3/src/sites.h 2006-10-27 18:39:06.000000000 +0530
125 @@ -381,6 +381,8 @@
126 char *rsh_cmd;
127 char *rcp_cmd;
128
129 + unsigned int create_remote_root:1; /* to create remote root in case it doesn't exist */
130 +
131 unsigned int nodelete; /* whether to delete any files remotely */
132 unsigned int checkmoved; /* whether to check for moved files */
133 unsigned int checkrenames; /* whether to check for renamed files */
134

  ViewVC Help
Powered by ViewVC 1.1.20