~ubuntu-branches/ubuntu/wily/torrus/wily-proposed

« back to all changes in this revision

Viewing changes to bin/compilexml.in

  • Committer: Package Import Robot
  • Author(s): Marc Haber
  • Date: 2011-11-06 17:15:40 UTC
  • mto: (6.1.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: package-import@ubuntu.com-20111106171540-myc0auwqqio8bmhl
Tags: upstream-2.01
ImportĀ upstreamĀ versionĀ 2.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#  along with this program; if not, write to the Free Software
16
16
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17
17
 
18
 
# $Id: compilexml.in,v 1.5 2009/03/11 16:04:14 ssinyagin Exp $
 
18
# $Id$
19
19
# Stanislav Sinyagin <ssinyagin@yahoo.com>
20
20
 
21
21
BEGIN { require '@torrus_config_pl@'; }
153
153
        }
154
154
    }
155
155
 
 
156
    &Torrus::DB::checkInterrupted();
 
157
    
 
158
    # Preserve the dynamic tokenset members
 
159
    if( not $compiler->{'first_time_created'} )
 
160
    {
 
161
        my $oldConfig = new Torrus::ConfigTree( -TreeName => $tree );
 
162
        if( defined( $oldConfig ) )
 
163
        {
 
164
            foreach my $ts ( $oldConfig->getTsets() )
 
165
            {
 
166
                if( $compiler->tsetExists( $ts ) )
 
167
                {
 
168
                    foreach my $member ( $oldConfig->tsetMembers( $ts ) )
 
169
                    {
 
170
                        my $origin =
 
171
                            $oldConfig->tsetMemberOrigin( $ts, $member );
 
172
                        if( defined( $origin ) and $origin ne 'static' )
 
173
                        {
 
174
                            my $path = $oldConfig->path($member);
 
175
                            if( $compiler->nodeExists( $path ) )
 
176
                            {
 
177
                                my $token = $compiler->token( $path );
 
178
                                $compiler->tsetAddMember
 
179
                                    ( $ts, $token, $origin );
 
180
                                Verbose('Preserved dynamic tokenset member: ' .
 
181
                                        $path . ' in ' . $ts);
 
182
                            }
 
183
                        }
 
184
                    }
 
185
                }
 
186
            }
 
187
        }
 
188
 
 
189
        undef $oldConfig;
 
190
    }
 
191
                    
 
192
    &Torrus::DB::checkInterrupted();
 
193
                             
156
194
    $compiler->finalize( $ok );
157
195
    undef $compiler;
158
196
    &Torrus::DB::cleanupEnvironment();