bool
-MatchList_initByVserver(struct MatchList *list, char const *vserver,
+MatchList_initByVserver(struct MatchList *list,
+ struct MatchVserverInfo const *vserver,
char const **res_appdir)
{
vcCfgStyle style;
char const *vdir;
char const *appdir;
- style = vc_getVserverCfgStyle(vserver);
- vdir = vc_getVserverVdir( vserver, style, true);
- appdir = vc_getVserverAppDir(vserver, style, "vunify");
+ style = vc_getVserverCfgStyle(vserver->name);
+ vdir = vc_getVserverVdir( vserver->name, style, true);
+ appdir = vc_getVserverAppDir(vserver->name, style, "vunify");
if (vdir==0 || appdir==0) {
free((char *)appdir);
}
void
-MatchList_initManually(struct MatchList *list, char const *vserver,
+MatchList_initManually(struct MatchList *list,
+ struct MatchVserverInfo const *vserver,
char const *vdir, char const *exclude_file)
{
char *buf[2] = { 0,0 };
WRITE_STR(1, vdir);
if (vserver!=0) {
WRITE_MSG(1, " (");
- WRITE_STR(1, vserver);
+ WRITE_STR(1, vserver->name);
WRITE_MSG(1, ")");
}
WRITE_MSG(1, "\n");
}
- if (vserver && Global_doRenew()) {
+ if (vserver && vserver->use_pkgmgmt && Global_doRenew()) {
if (Global_getVerbosity()>=2)
WRITE_MSG(1, " Fetching configuration-file list from packagemanagement\n");
- getConfigfileList(vserver, &fixed_files, &fixed_count, buf+0);
+ getConfigfileList(vserver->name, &fixed_files, &fixed_count, buf+0);
}
// abuse special values (NULL, empty string) to skip the next step
*lst = Emalloc(sizeof(struct MatchList) * count);
*cnt = count;
for (i=0; i<count; ++i) {
- char const *tmp = entries[i]->d_name;
- size_t l = strlen(tmp);
- char vname[sizeof("./") + l];
+ char const *tmp = entries[i]->d_name;
+ size_t l = strlen(tmp);
+ char vname[sizeof("./") + l];
+ struct MatchVserverInfo vserver = { vname, true };
memcpy(vname, "./", 2);
memcpy(vname+2, tmp, l+1);
- if (!MatchList_initByVserver((*lst)+i, vname, 0)) {
+ if (!MatchList_initByVserver((*lst)+i, &vserver, 0)) {
WRITE_MSG(2, "unification for reference vserver not configured\n");
exit(1);
}
static void
initModeVserver(int argc, char *argv[])
{
- int count=argc;
+ int count = argc;
+ struct MatchVserverInfo const src_vserver = { argv[1], true };
+ struct MatchVserverInfo const dst_vserver = { argv[0], false };
+
if (count!=2) {
WRITE_MSG(2, "Bad arguments; try '--help' for more information\n");
exit(1);
}
- if (!MatchList_initByVserver(&global_info.src_list, argv[1], 0)) {
+ if (!MatchList_initByVserver(&global_info.src_list, &src_vserver, 0)) {
WRITE_MSG(2, "unification not configured for source vserver\n");
exit(1);
}
if (!global_args->is_strict)
- createSkeleton(argv[0]);
+ createSkeleton(dst_vserver.name);
- if (!MatchList_initByVserver(&global_info.dst_list, argv[0], 0)) {
+ if (!MatchList_initByVserver(&global_info.dst_list, &dst_vserver, 0)) {
WRITE_MSG(2, "unification not configured for destination vserver\n");
exit(1);
}
static void
initModeVserver(struct Arguments const UNUSED *args, int argc, char *argv[])
{
- char const *appdir;
+ char const *appdir;
+ struct MatchVserverInfo const dst_vserver = { argv[0], true };
if (argc!=1) {
WRITE_MSG(2, "More than one vserver is not supported\n");
exit(1);
}
- if (!MatchList_initByVserver(&global_info.dst_list, argv[0], &appdir)) {
+ if (!MatchList_initByVserver(&global_info.dst_list, &dst_vserver, &appdir)) {
WRITE_MSG(2, "unification not configured for this vserver\n");
exit(1);
}