Subversion Repositories DevTools

Rev

Rev 359 | Rev 363 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 359 Rev 361
Line 39... Line 39...
39
use JatsError;
39
use JatsError;
40
use JatsSystem;
40
use JatsSystem;
41
use FileUtils;
41
use FileUtils;
42
use JatsBuildFiles;
42
use JatsBuildFiles;
43
use JatsVersionUtils;
43
use JatsVersionUtils;
44
use File::Path qw(rmtree);
-
 
45
 
44
 
46
 
45
 
47
use Pod::Usage;                             # required for help support
46
use Pod::Usage;                             # required for help support
48
use Getopt::Long qw(:config require_order); # Stop on non-option
47
use Getopt::Long qw(:config require_order); # Stop on non-option
49
my $VERSION = "1.0.0";                      # Update this
48
my $VERSION = "1.0.0";                      # Update this
Line 192... Line 191...
192
# Description     : Delete a sandbox
191
# Description     : Delete a sandbox
193
#                   Its up to the user the delete the components in the sandbox
192
#                   Its up to the user the delete the components in the sandbox
194
#
193
#
195
# Inputs          : None
194
# Inputs          : None
196
#
195
#
197
# Returns         : 
196
# Returns         :
198
#
197
#
199
sub delete_sandbox
198
sub delete_sandbox
200
{
199
{
201
    GetOptions (
200
    GetOptions (
202
                "help:+"        => \$opt_help,
201
                "help:+"        => \$opt_help,
Line 209... Line 208...
209
    {
208
    {
210
        Warning("No sandbox found to delete");
209
        Warning("No sandbox found to delete");
211
    }
210
    }
212
    else
211
    else
213
    {
212
    {
214
        my $sdir = "$GBE_SANDBOX/sandbox_dpkg_archive";
-
 
215
        rmtree($sdir,0,0);
-
 
216
        Error ("Sandbox directory not completly removed")
213
        Error ("Sandbox directory not completly removed")
217
            if ( -e $sdir );
214
            if RmDirTree( "$GBE_SANDBOX/sandbox_dpkg_archive" );
218
 
215
 
219
        Message("Sandbox information deleted",
216
        Message("Sandbox information deleted",
220
                "Sandbox components must be manually deleted");
217
                "Sandbox components must be manually deleted");
221
    }
218
    }
222
    exit 0;
219
    exit 0;
Line 239... Line 236...
239
                "manual:3"      => \$opt_help,
236
                "manual:3"      => \$opt_help,
240
                "verbose:+"     => \$opt_verbose,
237
                "verbose:+"     => \$opt_verbose,
241
                ) || Error ("Invalid command line" );
238
                ) || Error ("Invalid command line" );
242
 
239
 
243
    SubCommandHelp( $opt_help, "Sandbox Information") if ($opt_help || $#ARGV >=0 );
240
    SubCommandHelp( $opt_help, "Sandbox Information") if ($opt_help || $#ARGV >=0 );
244
    
241
 
245
    #
242
    #
246
    #   Determine Sandbox information
243
    #   Determine Sandbox information
247
    #   Populate global variables
244
    #   Populate global variables
248
    #
245
    #
249
    calc_sandbox_info();
246
    calc_sandbox_info();
Line 271... Line 268...
271
            foreach my $edep ( sort keys %{$fe->{'edeps'}} )
268
            foreach my $edep ( sort keys %{$fe->{'edeps'}} )
272
            {
269
            {
273
                my ($ppn,$ppv) = split( $; , $edep);
270
                my ($ppn,$ppv) = split( $; , $edep);
274
                Message ("        E:$ppn $ppv");
271
                Message ("        E:$ppn $ppv");
275
            }
272
            }
276
            
273
 
277
        }
274
        }
278
    }
275
    }
279
 
276
 
280
    #
277
    #
281
    #   External dependencies flags
278
    #   External dependencies flags
Line 479... Line 476...
479
        }
476
        }
480
    }
477
    }
481
 
478
 
482
#DebugDumpData ("depends", \%depends );
479
#DebugDumpData ("depends", \%depends );
483
#DebugDumpData ("External Depends", \%extern_deps );
480
#DebugDumpData ("External Depends", \%extern_deps );
484
    
481
 
485
 
482
 
486
    #
483
    #
487
    #   Determine package build order
484
    #   Determine package build order
488
    #       Scan the list of packages in the build set and determine
485
    #       Scan the list of packages in the build set and determine
489
    #       those with no dependencies. These can be built.
486
    #       those with no dependencies. These can be built.
Line 611... Line 608...
611
                "help:+"        => \$opt_help,
608
                "help:+"        => \$opt_help,
612
                "manual:3"      => \$opt_help,
609
                "manual:3"      => \$opt_help,
613
                ) || Error ("Invalid command line" );
610
                ) || Error ("Invalid command line" );
614
 
611
 
615
    SubCommandHelp( $opt_help, "Command $cmd") if ($opt_help );
612
    SubCommandHelp( $opt_help, "Command $cmd") if ($opt_help );
616
    
613
 
617
    #
614
    #
618
    #   Insert default options
615
    #   Insert default options
619
    #
616
    #
620
    push @build_opts, '-noforce' if ( $cmd eq 'all' );
617
    push @build_opts, '-noforce' if ( $cmd eq 'all' );
621
    push @build_opts, '-force' if ( $cmd ne 'all' );
618
    push @build_opts, '-force' if ( $cmd ne 'all' );
Line 746... Line 743...
746
            my ($pn,$pv) = split( $; , $pve );
743
            my ($pn,$pv) = split( $; , $pve );
747
            Message ("Cache ${pn} ${pv}");
744
            Message ("Cache ${pn} ${pv}");
748
            JatsTool ('cache_dpkg', "${pn}/${pv}" );
745
            JatsTool ('cache_dpkg', "${pn}/${pv}" );
749
        }
746
        }
750
    }
747
    }
751
    
748
 
752
    exit 0;
749
    exit 0;
753
    
750
 
754
}
751
}
755
 
752
 
756
#-------------------------------------------------------------------------------
753
#-------------------------------------------------------------------------------
757
# Function        : populate
754
# Function        : populate
758
#
755
#
Line 980... Line 977...
980
# Description     : Determine the PVID for a given package name and version
977
# Description     : Determine the PVID for a given package name and version
981
#
978
#
982
# Inputs          : $pname          - Package name
979
# Inputs          : $pname          - Package name
983
#                   $pver           - Package Version
980
#                   $pver           - Package Version
984
#
981
#
985
# Returns         : 
982
# Returns         :
986
#
983
#
987
 
984
 
988
sub getPkgDetailsByName
985
sub getPkgDetailsByName
989
{
986
{
990
    my ($pname, $pver) = @_;
987
    my ($pname, $pver) = @_;
Line 1195... Line 1192...
1195
 
1192
 
1196
jats_sandbox - Build in a Development Sandbox
1193
jats_sandbox - Build in a Development Sandbox
1197
 
1194
 
1198
=head1 SYNOPSIS
1195
=head1 SYNOPSIS
1199
 
1196
 
1200
  jats sandbox [options] {command} [command options]
1197
  jats sandbox [options] command [command options]
1201
 
1198
 
1202
 Options:
1199
 Options:
1203
    -help[=n]          - Display help with specified detail
1200
    -help[=n]          - Display help with specified detail
1204
    -help -help        - Detailed help message
1201
    -help -help        - Detailed help message
1205
    -man               - Full documentation
1202
    -man               - Full documentation
Line 1219... Line 1216...
1219
    cache               - Cache external dependent packages
1216
    cache               - Cache external dependent packages
1220
 
1217
 
1221
 Use the command
1218
 Use the command
1222
    jats sandbox 'command' -h
1219
    jats sandbox 'command' -h
1223
 for command specific help
1220
 for command specific help
1224
    
1221
 
1225
=head1 OPTIONS
1222
=head1 OPTIONS
1226
 
1223
 
1227
=over 8
1224
=over 8
1228
 
1225
 
1229
=item B<-help[=n]>
1226
=item B<-help[=n]>
Line 1231... Line 1228...
1231
Print a brief help message and exits.
1228
Print a brief help message and exits.
1232
There are three levels of help
1229
There are three levels of help
1233
 
1230
 
1234
=over 8
1231
=over 8
1235
 
1232
 
-
 
1233
=item   1
-
 
1234
 
1236
=item   1 Brief synopsis
1235
Brief synopsis
-
 
1236
 
-
 
1237
=item   2
1237
 
1238
 
1238
=item   2 Synopsis and option summary
1239
Synopsis and option summary
1239
 
1240
 
-
 
1241
=item   3
-
 
1242
 
1240
=item   3 Detailed help in man format
1243
Detailed help in man format
1241
 
1244
 
1242
=back 8
1245
=back 8
1243
 
1246
 
1244
=item B<-help -help>
1247
=item B<-help -help>
1245
 
1248
 
Line 1328... Line 1331...
1328
 
1331
 
1329
The create command simply places a known directory in the current directory.
1332
The create command simply places a known directory in the current directory.
1330
This directory is used by the sandboxing process. It may be manually deleted, or
1333
This directory is used by the sandboxing process. It may be manually deleted, or
1331
deleted with the 'delete' command.
1334
deleted with the 'delete' command.
1332
 
1335
 
1333
 
-
 
1334
=head1 Populate Sandbox
1336
=head1 Populate Sandbox
1335
 
1337
 
1336
=head2 NAME
1338
=head2 NAME
1337
 
1339
 
1338
Populate a Sandbox
1340
Populate a Sandbox
Line 1393... Line 1395...
1393
Options not understood by the 'populate' sub command will be passed through
1395
Options not understood by the 'populate' sub command will be passed through
1394
the package extraction program. Useful options include:
1396
the package extraction program. Useful options include:
1395
 
1397
 
1396
=over 8
1398
=over 8
1397
 
1399
 
-
 
1400
=item *
-
 
1401
 
1398
=item   -extractfiles
1402
-extractfiles
1399
 
1403
 
-
 
1404
=item *
-
 
1405
 
1400
=item   -branch=<branch name>
1406
-branch=<branch name>
1401
 
1407
 
1402
=back
1408
=back
1403
 
1409
 
1404
=back
1410
=back
1405
 
1411
 
Line 1410... Line 1416...
1410
The 'populate' command can be used to assist in populating the sandbox. It has
1416
The 'populate' command can be used to assist in populating the sandbox. It has
1411
two modes of operation.
1417
two modes of operation.
1412
 
1418
 
1413
=over 8
1419
=over 8
1414
 
1420
 
-
 
1421
=item 1
-
 
1422
 
1415
=item Named Package
1423
Named Package
1416
 
1424
 
1417
If the user specifies both a package name and a package version then he command
1425
If the user specifies both a package name and a package version then he command
1418
will populate the sandbox with that package and optionally its dependencies.
1426
will populate the sandbox with that package and optionally its dependencies.
1419
 
1427
 
-
 
1428
=item 2
-
 
1429
 
1420
=item Determine missing dependencies
1430
Determine missing dependencies
1421
 
1431
 
1422
If the user does not specify a package name and version, but does specify
1432
If the user does not specify a package name and version, but does specify
1423
the '-missing' option,  then the command will examine the current sandbox and
1433
the '-missing' option,  then the command will examine the current sandbox and
1424
determine missing dependent packages. It will then populate the sandbox with
1434
determine missing dependent packages. It will then populate the sandbox with
1425
these packages and optionally there dependencies.
1435
these packages and optionally there dependencies.
Line 1428... Line 1438...
1428
 
1438
 
1429
=head2 EXAMPLES
1439
=head2 EXAMPLES
1430
 
1440
 
1431
=over 4
1441
=over 4
1432
 
1442
 
-
 
1443
=item *
-
 
1444
 
1433
=item jats sandbox populate package1 version1
1445
jats sandbox populate package1 version1
1434
 
1446
 
1435
This command will populate the sandbox with version1 of package1, if it does not
1447
This command will populate the sandbox with version1 of package1, if it does not
1436
already exist in the sandbox.
1448
already exist in the sandbox.
1437
 
1449
 
-
 
1450
=item *
-
 
1451
 
1438
=item jats sandbox populate package1 version1 -recurse -missing
1452
jats sandbox populate package1 version1 -recurse -missing
1439
 
1453
 
1440
This command will populate the sandbox with version1 of package1, if it does not
1454
This command will populate the sandbox with version1 of package1, if it does not
1441
already exist in the sandbox, together will all the packages dependencies that
1455
already exist in the sandbox, together will all the packages dependencies that
1442
are not available in a package archive.
1456
are not available in a package archive.
1443
 
1457
 
-
 
1458
=item *
-
 
1459
 
1444
=item jats sandbox populate -recurse -missing
1460
jats sandbox populate -recurse -missing
1445
 
1461
 
1446
This command will examine the current sandbox and populate the sandbox with
1462
This command will examine the current sandbox and populate the sandbox with
1447
packages that are required to build the packages in the sandbox and the
1463
packages that are required to build the packages in the sandbox and the
1448
dependencies of these packages, provide the dependent package is not in a
1464
dependencies of these packages, provide the dependent package is not in a
1449
package archive.
1465
package archive.
1450
 
1466
 
-
 
1467
=item *
-
 
1468
 
1451
=item jats sandbox populate
1469
jats sandbox populate
1452
 
1470
 
1453
This command will examine the current sandbox and populate the sandbox with
1471
This command will examine the current sandbox and populate the sandbox with
1454
packages that are required to build the packages in the sandbox. It will not
1472
packages that are required to build the packages in the sandbox. It will not
1455
examine the dependents of these packages.
1473
examine the dependents of these packages.
1456
 
1474
 
Line 1495... Line 1513...
1495
    -verbose[=n]            - Verbose command operation
1513
    -verbose[=n]            - Verbose command operation
1496
 
1514
 
1497
 Command Options
1515
 Command Options
1498
    -help[=n]               - Command specific help, [n=1,2,3]
1516
    -help[=n]               - Command specific help, [n=1,2,3]
1499
    -verbose[=n]            - Display more information
1517
    -verbose[=n]            - Display more information
1500
    
1518
 
1501
=head2 OPTIONS
1519
=head2 OPTIONS
1502
 
1520
 
1503
=over
1521
=over
1504
 
1522
 
1505
=item B<-verbose[=n]>
1523
=item B<-verbose[=n]>
Line 1517... Line 1535...
1517
 
1535
 
1518
The command works within various levels of verbosity:
1536
The command works within various levels of verbosity:
1519
 
1537
 
1520
=over 8
1538
=over 8
1521
 
1539
 
-
 
1540
=item *
-
 
1541
 
1522
=item * No Verbosity
1542
No Verbosity
1523
 
1543
 
1524
The basic command will display the build order and the external
1544
The basic command will display the build order and the external
1525
dependencies. External dependencies may be prefixed with one of the
1545
dependencies. External dependencies may be prefixed with one of the
1526
following indicators:
1546
following indicators:
1527
 
1547
 
1528
=over 8
1548
=over 8
1529
 
1549
 
1530
=item   +   Multiple versions of this package are being used by sandboxed components.
1550
=item   '+' Multiple versions of this package are being used by sandboxed components.
1531
 
1551
 
1532
=item   *   The package cannot be found in any of the package archives.
1552
=item   '*' The package cannot be found in any of the package archives.
1533
 
1553
 
1534
=back
1554
=back
1535
 
1555
 
-
 
1556
=item *
-
 
1557
 
1536
=item Verbosity of 1
1558
Verbosity of 1
1537
 
1559
 
1538
This level of verbosity will display the build order and detailed information
1560
This level of verbosity will display the build order and detailed information
1539
on the dependencies. The dependencies will be prefixed with:
1561
on the dependencies. The dependencies will be prefixed with:
1540
 
1562
 
1541
=over 8
1563
=over 8
1542
 
1564
 
1543
=item   E   Dependent Package is external to the sandbox
1565
=item   E Dependent Package is external to the sandbox
1544
 
1566
 
1545
=item   I   Dependent Package is internal to the sandbox
1567
=item   I Dependent Package is internal to the sandbox
1546
 
1568
 
1547
=back
1569
=back
1548
 
1570
 
1549
External dependencies may be prefixed with one of the indicators described for
1571
External dependencies may be prefixed with one of the indicators described for
1550
no-verbosity. Additionally the internal consumer of the external package is also
1572
no-verbosity. Additionally the internal consumer of the external package is also
1551
shown. These are prefixed with a 'U'.
1573
shown. These are prefixed with a 'U'.
1552
 
1574
 
-
 
1575
=item *
-
 
1576
 
1553
=item Verbosity of 2
1577
Verbosity of 2
1554
 
1578
 
1555
Reserved for future use
1579
Reserved for future use
1556
 
1580
 
-
 
1581
=item *
-
 
1582
 
1557
=item Verbosity over 2
1583
Verbosity over 2
1558
 
1584
 
1559
This should be considered a debug option. Undocumented internal information will
1585
This should be considered a debug option. Undocumented internal information will
1560
be displayed.
1586
be displayed.
1561
 
1587
 
1562
=back
1588
=back
Line 1597... Line 1623...
1597
 
1623
 
1598
This command may be used to:
1624
This command may be used to:
1599
 
1625
 
1600
=over 8
1626
=over 8
1601
 
1627
 
-
 
1628
=item *
-
 
1629
 
1602
=item * Pickup any build file changes.
1630
Pickup any build file changes.
-
 
1631
 
-
 
1632
=item *
1603
 
1633
 
1604
=item * Resume a failed build.
1634
Resume a failed build.
1605
 
1635
 
1606
=back
1636
=back
1607
 
1637
 
1608
=head1 Command build
1638
=head1 Command build
1609
 
1639