- Configure does not list fake modules with --listmodules
authorZdeněk Šustr <sustr4@cesnet.cz>
Wed, 1 Feb 2012 11:51:49 +0000 (11:51 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Wed, 1 Feb 2012 11:51:49 +0000 (11:51 +0000)
- Tagging scripts handle submodules for each module encountered

org.glite.lb/configure
org.glite.lb/etics-tag-with-subsystems.pl
org.glite.lb/etics-tag.pl

index 451bc91..0e2a782 100755 (executable)
@@ -320,13 +320,14 @@ if ($listmodules) {
        my @m;
 
        if (exists $lbmodules{$listmodules}) {
-               @m = map "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
+               @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
        } else {
                for my $sub (keys %subpackages) {
                        push @m, $sub if ($subpackages{$sub} eq $listmodules);
                }
        }
-       print "@m\n";
+       print map $_ eq "" ? "" : "$_ ", @m;
+       print "\n";
        exit 0;
 }
 
index 5ea2cd3..a2e9d9e 100755 (executable)
@@ -335,6 +335,26 @@ usage: $0 [-c <current configuration>] module.name
                printf(NEWCONF "$m = $modconfig\n");
 
                close (MOD);
+
+               $shortname=$m;
+               $shortname=~s/^org\.glite\.//;
+               $shortname=~s/^emi\.//;
+               open( SC, "PATH=\$PATH:./:./org.glite.lb configure --listmodules $shortname|" );
+               while ( <SC> ) {
+                       $subconfs=$_;
+                       break;
+               }
+               close SC;
+               chomp($subconfs);
+
+               my @subconfs=split(/ /, $subconfs);
+               foreach $submod (@subconfs) {
+                       $subpref = $project eq "emi" ? "emi" : "org.glite";
+                       $subconf = "$subpref.$submod";
+                       $subconf =~s/\./-/g;
+                       $subconf =~s/^org-//;
+                       printf(NEWCONF "$subpref.$submod = ${subconf}_R_${m_major}_${m_minor}_${m_revision}_${m_age}\n");
+               }
         }
 
        close(NEWCONF);
index 2446973..bf09c14 100755 (executable)
@@ -367,29 +367,40 @@ usage: $0 [-i maj|min|rev|age|none|<sigle_word_age>] [-g] [-c <current configura
                system("etics-configuration prepare -o $TMPDIR/$currentconfig.ini.$$ -c $currentconfig $module");
        }
 
-#      open OLDCONF, "$TMPDIR/$currentconfig.ini.$$" or die $!; 
-#      open NEWCONF, ">", "$TMPDIR/$newconfig.ini.$$" or die $!;
+       if ($increment eq "n") { # There was no version change and the configuration should already exist
+               printf(EXEC "\n#Modify new configuration\netics-configuration modify -i $TMPDIR/$newconfig.ini.$$\n"); }
+       else { # New configuration needs to be created
+       printf(EXEC "\n#Add new configuration\netics-configuration add -i $TMPDIR/$newconfig.ini.$$\n"); }
+       $listconfig=$newconfig . ".ini.$$";
 
-#       while ($_ = <OLDCONF>) {
-#                chomp;
+       # **********************************
+       # Subconfigurations
+       # **********************************
 
-##                $_=~s/module\.age\s*=\s*(\S+)/module\.age=$age/;
-#              $_=~s/$currentconfig/$newconfig/;
-#              $_=~s/^\s*version\s*=\s*[.0-9]+/version = $major.$minor.$revision/;
-#                $_=~s/^\s*age\s*=\s*\S+/age = $age/;
+       open( SC, "$GLITE_LB_LOCATION/configure --listmodules $subsysname.$modulename|" ); 
+       while ( <SC> ) {
+               $subconfs=$_;
+               break;
+       }
+       close SC;
+       chomp($subconfs);
 
-#              printf(NEWCONF "$_\n");
-#        }
+       my @subconfs=split(/ /, $subconfs);
+       foreach $subconf (@subconfs) {
+               $newconfig=$project . "-" . $subconf  . "_R_$major" . "_$minor" . "_$revision" . "_$age";
+               $newconfig=~s/\./-/;
 
-#      close(OLDCONF);
-#      close(NEWCONF);
+               system("$GLITE_LB_LOCATION/configure --mode=etics --module $subconf --output $TMPDIR/$newconfig.ini.$$ --version $major.$minor.$revision-$age $proj_opt");
 
-       if ($increment eq "n") { # There was no version change and the configuration should already exist
-               printf(EXEC "\n#Modify new configuration\netics-configuration modify -i $TMPDIR/$newconfig.ini.$$\n"); }
-       else { # New configuration needs to be created
-       printf(EXEC "\n#Add new configuration\netics-configuration add -i $TMPDIR/$newconfig.ini.$$\n"); }
-       printf(EXEC "etics-commit\n");
+               if ($increment eq "n") { # There was no version change and the configuration should already exist
+                       printf(EXEC "\n#Modify configuration\netics-configuration modify -i $TMPDIR/$newconfig.ini.$$\n"); }
+               else { # New configuration needs to be created
+               printf(EXEC "etics-configuration add -i $TMPDIR/$newconfig.ini.$$\n"); }
+               $listconfig=$listconfig . " $TMPDIR/$newconfig.ini.$$";
+       }
 
+       printf(EXEC "etics-commit\n");
+       
 
        # **********************************
        # Final bows
@@ -401,5 +412,5 @@ usage: $0 [-i maj|min|rev|age|none|<sigle_word_age>] [-g] [-c <current configura
 
        printf("\n\n---------\nDone!\n\nExecution script written in:\t$TMPDIR/etics-tag-$module.$major.$minor.$revision-$age.sh\nChangeLog candidate written in:\t$tmpChangeLog\n");
        printf("Old configuration stored in:\t$TMPDIR/$currentconfig.ini.$$\n") if (defined $opt_g);
-       printf("New configuration written in:\t$TMPDIR/$newconfig.ini.$$\n\n");
+       printf("New configuration written in:\t$TMPDIR/$listconfig\n\n");