Part of lp.archivepublisher.scripts.publish_ftpmaster View In Hierarchy
The publishable files are kept in the filesystem. Most of the work is done in a working "dists" directory, which then replaces the current "dists" in the archive root.
For performance reasons, the old "dists" is not discarded. It is kept as the dists-copy version for the next run. Its contents don't matter in detail; an rsync updates it based on the currently published dists directory before we start working with it.
At the end of one pass of the script, the "dists" directory in the archive root and its backup copy in the dists-copy root will have traded places.
However the script normally does 2 passes: once just for security updates, to expedite publication of critical fixes, and once for the whole distribution. At the end of this, the directories will be back in their original places (though with updated contents).
Method | add_my_options | See LaunchpadScript . |
Method | processOptions | Handle command-line options. |
Method | getConfigs | Set up configuration objects for archives to be published. |
Method | locateIndexesMarker | Give path for marker file whose presence marks index creation. |
Method | listSuitesNeedingIndexes | Find suites in distroseries that need indexes created. |
Method | markIndexCreationComplete | Note that archive indexes for suite have been created. |
Method | createIndexes | Create archive indexes for suites of distroseries . |
Method | processAccepted | Run the process-accepted script. |
Method | getDirtySuites | Return set of suites that have packages pending publication. |
Method | getDirtySecuritySuites | List security suites with pending publications. |
Method | rsyncBackupDists | Populate the backup dists with a copy of distsroot. |
Method | recoverArchiveWorkingDir | Recover working dists dir for archive_config . |
Method | recoverWorkingDists | Look for and recover any dists left in transient working state. |
Method | setUpDirs | Create archive roots and such if they did not yet exist. |
Method | runPublishDistro | Execute publish-distro . |
Method | publishDistroArchive | Publish the results for an archive. |
Method | runPublishDistroParts | Execute the publish-distro hooks. |
Method | installDists | Put the new dists into place, as near-atomically as possible. |
Method | clearEmptyDirs | Clear out any redundant empty directories. |
Method | runFinalizeParts | Run the finalize.d parts to finalize publication. |
Method | publishSecurityUploads | Quickly process just the pending security uploads. |
Method | publishDistroUploads | Publish the distro's complete uploads. |
Method | updateStagedFilesForSuite | Install all staged files for a single archive and suite. |
Method | updateStagedFiles | Install all staged files for a distribution's archives. |
Method | publish | Do the main publishing work. |
Method | prepareFreshSeries | If there are any new distroseries, prepare them for publishing. |
Method | setUp | Process options, and set up internal state. |
Method | processDistro | Process distribution . |
Method | main | See LaunchpadScript . |
Inherited from LaunchpadCronScript:
Method | __init__ | Construct new LaunchpadScript. |
Method | get_last_activity | Return the last activity, if any. |
Method | record_activity | Record the successful completion of the script. |
Inherited from LaunchpadScript (via LaunchpadCronScript):
Method | handle_options | Undocumented |
Method | name | Enable subclasses to override with command-line arguments. |
Method | dbuser | Enable subclasses to override with command-line arguments. |
Method | login | Super-convenience method that avoids the import. |
Method | lockfilename | Return lockfilename. |
Method | lockfilepath | Undocumented |
Method | setup_lock | Create lockfile. |
Method | lock_or_die | Attempt to lock, and sys.exit(1) if the lock's already taken. |
Method | unlock | Release the lock. Do this before going home. |
Method | run | Actually run the script, executing zcml and initZopeless. |
Method | lock_and_run | Call lock_or_die(), and then run() the script. |
Method | _init_zca | Initialize the ZCA, this can be overridden for testing purposes. |
Method | _init_db | Initialize the database transaction. |
Handle command-line options. Sets `self.distributions` to the `Distribution`s to publish.
The configs dict maps each distribution to another dict that maps the archive purposes that are relevant for publishing to the respective archives' configurations.
So: getConfigs[distro][purpose] gives you a config.
The file will be created once the archive indexes for suite
have been created. This is how future runs will know that this
work is done.
distroseries
that need indexes created.
Checks for the marker left by markIndexCreationComplete
.
suite
have been created.
This tells listSuitesNeedingIndexes
that no, this suite no
longer needs archive indexes to be set up.
Uses "rsync -aH --delete" so that any obsolete files that may still be in the backup dists are cleaned out (bug 58835).
Parameters | archive_purpose | The (purpose of the) archive to copy. |
archive_config
.
If there is a dists directory for archive_config
in the working
location, kick it back to the backup location.
An archive's dists directory is temporarily moved into the archive root for running publish-distro. If a previous script run died while in this state, restore the directory to its permanent location.
Parameters | archive | Archive to publish. |
security_suites | An optional list of suites to restrict the publishing to. |
For each archive, this switches the dists directory and the backup dists directory around.
Returns True if publications were made, False otherwise.
Returns | True if any files were installed, otherwise False. |
Parameters | security_only | If True, limit publication to security updates on the main archive. This is much faster, so it makes sense to do a security-only run before the main event to expedite critical fixes. |
Returns | True if any publication was made to the archive. |