ePages 7.26.0 - DE_EPAGES/Installer/API/PatchBuilder.pm

Package DE_EPAGES::Installer::API::PatchBuilder

This modul generates and change all files necessary for patch. These files can be find under ../Patches of each cartridge. The patch change the file ../API/Cartridge.pm in each cartridge. Each patch increase the version number of each cartridge, even if there are no changes. So the ePages version number and the cartridge version numbers are linked.

Functions

addPatchFolderToCVS
cleanUpdateToBranch
commitCartridgePMToCVS
commitPatchFolderToCVS
createPatchXMLFromPatchFiles
exportReleaseFolder
exportReleaseFolders
generatePatchFiles
new
newVersion
oldVersion
patchCartridgePm
printMessage
setCommitBranch
updateCVSPatchReleaseTagsOnCartridgePM
updateCVSPatchReleaseTagsOnPatchFolder
updateToBranch
verbose

addPatchFolderToCVS

step 5 add files under ../Patches to cvs

Syntax
$PatchBuilder->addPatchFolderToCVS($CartridgeFolder)
Input
$CartridgeFolder (string)
cartridge directory

cleanUpdateToBranch

clean update to branch or tag

Syntax
$PatchBuilder->cleanUpdateToBranch($Path,$Branch)
Input
$Path (string)
path to update
$Branch (string)
branch to update from
$Part (string)
files or folders

commitCartridgePMToCVS

step 5 add files under ../Patches to cvs

Syntax
$PatchBuilder->commitCartridgePMToCVS($CartridgeFolder)
Input
$CartridgeFolder (string)
cartridge directory

commitPatchFolderToCVS

step 5 add files under ../Patches to cvs

Syntax
$PatchBuilder->commitPatchFolderToCVS($CartridgeFolder)
Input
$CartridgeFolder (string)
cartridge directory

createPatchXMLFromPatchFiles

step 3 creates the patch.xml file from the files in the patch directory.

Syntax
$PatchBuilder->createPatchXMLFromPatchFiles($CartridgePath, $CartridgePackage, $BaseName );
Input
$CartridgePath (string)
target directory for the cartridge
$CartridgePackage (string)
cartridge package, e.g. 'DE_EPAGES::Object'
$BaseName (string)
(optional; default: 'patch.xml') output file name
Return
$Created (boolean)
true if an XML file was created

exportReleaseFolder

part of step 1 export two versions of one cartridge, one tagged with old release and one tagged with the new release tag to different folders

Syntax
$self->exportReleaseFolder($CVSPath, $Dir, $Tag);
Input
$CVSPath (string)
cvs path from cartridge that should be patcht
$OldDir (string)
directory to export cartridge version tagged with $Tag
$Tag (string)
tag of cartridge, most any release tag

exportReleaseFolders

step 1 export two versions of one cartridge, one tagged with old release and one tagged with the new release tag to different folders

Syntax
$self->exportReleaseFolders($CVSPath, $OldDir, $NewDir);
Input
$CVSPath (string)
cvs path from cartridge that should be patcht
$OldDir (string)
directory to export cartridge version tagged with old release tag
$NewDir (string)
directory to export cartridge version tagged with new release tag

generatePatchFiles

step 2 - compare old and new version of cartridge - generates all patch files under ../Patches/Patch../Database/XML - (if patch files already builded, only additional tags where added manually changes with stay)

Syntax
$self->generatePatchFiles($OldFolder, $NewFolder, $CartridgeFolder);
Input
$OldFolder (string)
folder of cartridgeversion tagged with old release tag
$NewFolder (string)
folder of cartridgeversion tagged with new release tag
$CartridgeFolder (string)
folder of cartridge, where should commit
$useGit (bool)
1, if you use the Git version, 0 otherwise

new

Creates a new PatchBuilder object

Syntax
$PatchBuilder = DE_EPAGES::Installer::API::PatchBuilder->new(
    'OldReleaseTag' => $OldReleaseTag,
    'NewReleaseTag' => $NewReleaseTag,
    'Verbose' => 1,
    'ForceReview' => 1,
    'DontExportDeletedDirectories' => 0,
);
Input
$hOptions (hash)
keys
  • OldReleaseTag - old release tag, e.g. 'release_6_9_1'
  • NewReleaseTag - new release tag, e.g. 'release_6_9_2'
  • Verbose - print debug information (0 or 1)
  • ForceReview - add dies to Cartridge.pm to force manual check
  • DontExportDeletedDirectories - set to 1 if deleted cartridge
    directories should not exported, e.g. for language pack patch
  • reconstruct - 1 to reconstruct from CVS
    ignore already existing patch files
  • CommitBranch - name of branch to commit
  • AutoMode - PatchBuilder operates in HEAD Branch
  • UseGeneratedBranch - ony allowed in combination with AutoMode, operates in branches HEAD and B_generated_patch_code

Return
$PatchBuilder (object)
PatchBuilder object

newVersion

return object attribute, new version

Syntax
my $NewVersion = $self->newVersion();
Return
$NewVersion (string)
object attribute

oldVersion

return object attribute, old version

Syntax
my $OldVersion = $self->oldVersion();
Return
$OldVersion (string)
object attribute

patchCartridgePm

step 4 patch the ../API/Cartridge.pm file

Syntax
$PatchBuilder->patchCartridgePm($CartridgePath)
Input
$CartridgePath (string)
target directory for the cartridge
$GenerateWarnings (bool)
if 0 no warnings will generate in Cartridge.pm
$useGit (bool)
1, if Git version is used, 0 otherwise

printMessage

print message if verbose is true

Syntax
$self->printMessage('message to test');
Input
$Message (string)
message to print

setCommitBranch

actualize the commit branch

Syntax
$PatchBuilder->setCommitBranch($Branch)
Input
$Branch (string)
branch to commit

updateCVSPatchReleaseTagsOnCartridgePM

step 9 tag Cartridge.pm file

Syntax
$PatchBuilder->updateCVSPatchReleaseTagsOnCartridgePM($CartridgeFolder)
Input
$CartridgeFolder (string)
cartridge directory

updateCVSPatchReleaseTagsOnPatchFolder

step 9 update tags

Syntax
$PatchBuilder->updateCVSPatchReleaseTagsOnPatchFolder($CartridgeFolder)
Input
$CartridgeFolder (string)
cartridge directory

updateToBranch

update to branch or tag

Syntax
$PatchBuilder->updateToBranch($Path,$Branch)
Input
$Path (string)
path to update
$Branch (string)
branch to update from
$Part (string)
files or folders

verbose

return object attribute verbose

Syntax
$self->verbose()
Return
$Verbose (boolean)
object attribute