diff options
Diffstat (limited to 'trunk/src/gensync')
-rw-r--r-- | trunk/src/gensync/AUTHORS | 5 | ||||
-rw-r--r-- | trunk/src/gensync/ChangeLog | 12 | ||||
-rw-r--r-- | trunk/src/gensync/Makefile | 24 | ||||
-rw-r--r-- | trunk/src/gensync/README | 16 | ||||
-rw-r--r-- | trunk/src/gensync/TODO | 4 | ||||
-rw-r--r-- | trunk/src/gensync/bmg-gnome-current.syncsource | 18 | ||||
-rw-r--r-- | trunk/src/gensync/bmg-main.syncsource | 18 | ||||
-rwxr-xr-x | trunk/src/gensync/gensync | 226 | ||||
-rw-r--r-- | trunk/src/gensync/gensync.1 | 75 | ||||
-rw-r--r-- | trunk/src/gensync/gensync.conf | 8 |
10 files changed, 0 insertions, 406 deletions
diff --git a/trunk/src/gensync/AUTHORS b/trunk/src/gensync/AUTHORS deleted file mode 100644 index 389c51b..0000000 --- a/trunk/src/gensync/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -Maintainer: -Karl Trygve Kalleberg <karltk@gentoo.org> - -Original Author: -Matthew Schick <matt@breakmygentoo.net> diff --git a/trunk/src/gensync/ChangeLog b/trunk/src/gensync/ChangeLog deleted file mode 100644 index 7ec2b86..0000000 --- a/trunk/src/gensync/ChangeLog +++ /dev/null @@ -1,12 +0,0 @@ -2004-09-10 Karl Trygve Kalleberg <karltk@gentoo.org> - * Fixed portage import, fixes #45079. - * Added all sources sync patch from Adam Ashley - <adam_ashley@softhome.net>, fixes #45079. - * Fixed config dir scanning, suggested by burrelln@colorado.edu, - fixes #47390. - * Applied config file parser fix by Mamoru KOMACHI <usata@gentoo.org>, - fixes #44777. - -2004-02-08 Karl Trygve Kalleberg <karltk@gentoo.org> - * Initial import - diff --git a/trunk/src/gensync/Makefile b/trunk/src/gensync/Makefile deleted file mode 100644 index d5b879a..0000000 --- a/trunk/src/gensync/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2004 Karl Trygve Kalleberg <karltk@gentoo.org> -# Copyright 2004 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License v2 -# -# $Header$ - -include ../../makedefs.mak - -.PHONY: all -all: - -dist: - mkdir -p ../../$(distdir)/src/gensync/ - cp Makefile AUTHORS README TODO ChangeLog \ - gensync gensync.1 gensync.conf \ - bmg-main.syncsource bmg-gnome-current.syncsource \ - ../../$(distdir)/src/gensync/ - -install: all - install -d $(docdir)/deprecated/gensync - install -m 0755 gensync $(docdir)/deprecated/gensync/ - install -m 0644 AUTHORS README TODO ChangeLog $(docdir)/deprecated/gensync/ - install -m 0644 gensync.1 $(docdir)/deprecated/gensync/ - install -m 0644 gensync.conf bmg-main.syncsource bmg-gnome-current.syncsource $(docdir)/deprecated/gensync/ diff --git a/trunk/src/gensync/README b/trunk/src/gensync/README deleted file mode 100644 index cf54dec..0000000 --- a/trunk/src/gensync/README +++ /dev/null @@ -1,16 +0,0 @@ - -Package : gensync -Version : 0.1.0 -Author : See AUTHORS - -MOTIVATION - -Gensync handles rsyncing to multiple sync sources. - -MECHANICS - -N/A - -IMPROVEMENTS - -N/A diff --git a/trunk/src/gensync/TODO b/trunk/src/gensync/TODO deleted file mode 100644 index 733a959..0000000 --- a/trunk/src/gensync/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- Add using cvs to sync -- Update portage cache after sync -- Add overlay dirs defined in /etc/conf.d/gensync to /etc/make.conf -- Sync up with Marius on the multiple overlay code diff --git a/trunk/src/gensync/bmg-gnome-current.syncsource b/trunk/src/gensync/bmg-gnome-current.syncsource deleted file mode 100644 index 51dd908..0000000 --- a/trunk/src/gensync/bmg-gnome-current.syncsource +++ /dev/null @@ -1,18 +0,0 @@ - -# This id must be unique among all the ids in /etc/gensync/*.syncsource -id="bmg-gnome-current" - -# This is a human-readable description of the source -description="BreakMyGentoo GNOME current" - -# The rsync url -rsync="rsync://rsync.breakmygentoo.net/gnome-current" - -# By default, the overlay directory is set to ${base_overlay}/${id}, -# where base_overlay is picked from /etc/gensync/gensync.conf -# -# You may specify a different relative path, such as -overlay="bmg-gnome-current.alternative" -# -# Or an entirely new absolute path (remeber to create the path first) -#overlay="/my/absolute/path" diff --git a/trunk/src/gensync/bmg-main.syncsource b/trunk/src/gensync/bmg-main.syncsource deleted file mode 100644 index 8d74ca2..0000000 --- a/trunk/src/gensync/bmg-main.syncsource +++ /dev/null @@ -1,18 +0,0 @@ - -# This id must be unique among all the ids in /etc/gensync/*.syncsource -id="bmg-main" - -# This is a human-readable description of the source -description="BreakMyGentoo main tree" - -# The rsync url -rsync="rsync://rsync.breakmygentoo.net/bmg-overlay" - -# By default, the overlay directory is set to ${base_overlay}/${id}, -# where base_overlay is picked from /etc/gensync/gensync.conf -# -# You may specify a different relative path, such as -overlay="bmg-main.alternative" -# -# Or an entirely new absolute path (remeber to create the path first) -#overlay="/my/absolute/path" diff --git a/trunk/src/gensync/gensync b/trunk/src/gensync/gensync deleted file mode 100755 index 52f25ed..0000000 --- a/trunk/src/gensync/gensync +++ /dev/null @@ -1,226 +0,0 @@ -#!/usr/bin/python -# -# Simple program to rsync from various 3rd party ebuild servers. -# -# -# Copyright (c) 2004, Matthew Schick <matt@breakmygentoo.net> (original author) -# Copyright (c) 2004, Gentoo Technologies, Inc -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> -# -# Distributed under the terms of the GNU General Public License v2 - -__author__ = "Matt Schick <matt@breakmygentoo.net>, Karl Trygve Kalleberg <karltk@gentoo.org>" -__email__ = "karltk@gentoo.org" -__version__ = "0.1.0" -__productname__ = "gensync" -__description__ = "Gentoo Overlay Sync Tool" - - -import sys -import os -import fileinput - -sys.path.insert(0, "/usr/lib/portage/pym") -import portage - -try: - from portage.output import * -except ImportError: - from output import * - -class ConfigDefaults: - def __init__(self): - self.rsync_timeout = 0 - self.base_overlay = "/usr/local/overlays" - self.confdir = '/etc/gensync' - self._init_from_file() - self._setup_rsync() - def _init_from_file(self): - try: - ins = open("/etc/gensync/gensync.conf") - for x in ins.readlines(): - # Skip line if it's a comment or not well-formed - if x.find("=") == -1 or \ - (len(x) and x[0] == "#"): - continue - (attrib, value) = x.split('=') - attrib = attrib.strip().strip('"') - value = value.strip().strip('"') - if attrib == "rsync_timeout": - self.rsync_timeout = value - elif attrib == "base_overlay": - self.base_overlay = value - except: - pass - - def _setup_rsync(self): - if self.rsync_timeout == 0: - try: - self.rsync_timeout = portage.settings["RSYNC_TIMEOUT"] - except: - self.rsync_timeout = 180 - self.rsync_command = "/usr/bin/rsync " + \ - "-rlptDvz --progress " + \ - "--delete --delete-after " + \ - "--timeout=" + str(self.rsync_timeout) + " " \ - "--exclude='distfiles/*' " + \ - "--exclude='local/*' " + \ - "--exclude='packages/*' " - -Config = ConfigDefaults() - -class SyncSource: - """Contains all details about an upstream rsync source.""" - def __init__(self,filename): - self.id = "#unset#" - self.name = "#unset#" - self.url = "#unset#" - self.overlay = "#unset#" - self._init_from_file(filename) - - if self.overlay == "#unset#": - self.overlay = Config.base_overlay + "/" + self.id - elif len(self.overlay) and self.overlay[0] != "/": - self.overlay = Config.base_overlay + "/" + self.overlay - elif len(self.overlay) and self.overlay[0] == "/": - pass - else: - print "Malformed overlay, '" + self.overlay + "'" - sys.exit(-2) - - def _init_from_file(self, filename): - """Loads configuration settings from a .syncsource file.""" - ins = open(filename) - for x in ins.readlines(): - # Skip line if it's a comment or not well-formed - if x.find("=") == -1 or \ - (len(x) and x[0] == "#"): - continue - (attrib, value) = x.split("=") - attrib = attrib.strip().strip('"') - value = value.strip().strip('"') - if attrib == "id": - self.id = value - elif attrib == "description": - self.name = value - elif attrib == "rsync": - self.url = value - elif attrib == "overlay": - self.overlay = value - def perform_sync(self): - """Syncs with upstream source.""" - cmd = Config.rsync_command + self.url +"/* " + self.overlay - exitcode = portage.spawn(cmd, portage.settings, free=1) - - def dump(self,ous=sys.stdout): - ous.write("id =\"%s\"\n" % (self.id) + \ - "name =\"%s\"\n" % (self.name) + \ - "rsync =\"%s\"\n" % (self.url) + \ - "overlay=\"%s\"\n\n" % (self.overlay)) - -class SyncSourceManager: - """Holds information on all known upstream rsync sources.""" - def __init__(self): - self.sources = [] - self._load_source_info() - def _load_source_info(self): - for x in os.listdir(Config.confdir): - if x.rfind(".syncsource") > 0 and \ - x.endswith(".syncsource"): - ss = SyncSource(Config.confdir + "/" + x) - self.sources.append(ss) - def list_sources(self): - for x in self.sources: - x.dump() - def get_sync_source(self, source_id): - for x in self.sources: - if x.id == source_id: - return x - return None - def get_all_sync_sources(self): - return self.sources - -def print_version(): - print __productname__ + "(" + __version__ + ") - " + \ - __description__ - print "Author(s): " + __author__ - -def print_usage(): - print white("Usage: ") + turquoise(__productname__) + \ - yellow(" <options> ") + green("repo-id-1 repo-id-2 ...") - print "where " + yellow("<options>") + " is one of" - print yellow(" -a, --all-sources") + " - sync all know sources" - print yellow(" -l, --list-sources") + " - list known rsync sources" - print yellow(" -C, --no-color") + " - turn off colours" - print yellow(" -h, --help") + " - this help screen" - print yellow(" -V, --version") + " - display version info" - - -def parse_args(cliargs): - - cmd = "sync-sources" - args = [] - options = [] - - for x in cliargs: - if x in ["-V", "--version"]: - cmd = "print-version" - break - elif x in ["-h", "--help"]: - cmd = "print-usage" - break - elif x in ["-C", "--no-color"]: - options.append("nocolor") - break - elif x in ["-l", "--list-sources"]: - cmd = "list-sources" - elif x in ["-a", "--all-sources"]: - cmd = "all-sources" - else: - args.append(x) - return (cmd, args, options) - -def main(): - - # Setup colors, as per system defaults - if (not sys.stdout.isatty()) or \ - (portage.settings["NOCOLOR"] in ["yes","true"]): - nocolor() - - # Parse arguments - (cmd, args, options) = parse_args(sys.argv[1:]) - - # Turn off color, if specified by cmdline switch - if "nocolor" in options: - nocolor() - - # Initialise sync source manager - ssmgr = SyncSourceManager() - - # Perform selected command - if cmd == "list-sources": - ssmgr.list_sources() - elif cmd == "print-version": - print_version() - elif cmd == "print-usage": - print_usage() - elif cmd == "sync-sources": - for x in args: - repo = ssmgr.get_sync_source(x) - if repo: - print "Syncing '%s' into '%s'" % \ - (repo.id, repo.overlay) - repo.perform_sync() - elif cmd == "all-sources": - for repo in ssmgr.get_all_sync_sources(): - print "Syncing '%s' into '%s'" % \ - (repo.id, repo.overlay) - repo.perform_sync() - else: - print red("Unknown command '" + cmd + "'") - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - print "Operation aborted by user keypress!" diff --git a/trunk/src/gensync/gensync.1 b/trunk/src/gensync/gensync.1 deleted file mode 100644 index 17d85fc..0000000 --- a/trunk/src/gensync/gensync.1 +++ /dev/null @@ -1,75 +0,0 @@ -.TH gensync 1 "0.1.0" "Gentoolkit" "Gentoo Administration" -.SH "NAME" -.LP -gensync \- Gentoo: Overlay Sync Tool -.SH "SYNTAX" -.LP -gensync [\fIoption\fP] <\fIrepo-id-1 repo-id-2 ...\fP> - -.SH "DESCRIPTION" - -.LP - -\fIgensync\fR synchronises your machine against an upstream repository -of ebuild files, called a sync source. Normally, Portage will only -synchronise against the main Portage tree maintained by the Gentoo -project. However, there exist development trees with auxiliary ebuild -files that may occasionally be of interest to the adventurous power -user, such as the \fIbreakmygentoo.net\fR sync source. - -This tool can be used to synchronise against these alternative sync -sources. - -.SH "OPTIONS" -.LP -\fB\-l\fR -.br -\fB--list-sources\fB -.IP -List available sync sources known to \fIgensync\fR. - -.LP -\fB\-V\fR -.br -\fB--version\fB -.IP -Display version information and exit. - -.LP -\fB\-C\fR -.br -\fB--no-color\fB -.IP -Turn off colors. - -.LP -\fB\-h\fR -.br -\fB\--help\fR -.IP -Display help. - -.SH "CONFIGURATION FILES" -.LP -\fB/etc/gensync/gensync.conf\fR -.IP -The main configuration file, commented and self-explanatory - -.LP -\fB/etc/gensync/*.syncsource\fR -.IP -Per-sync source configuration files, describing the sync source to -\fIgensync\fR. - - -.SH "SEE ALSO" -.LP -The rest of the utilities in \fIapp-portage/gentoolkit-dev\fR, such as -\fIechangelog\fR, \fIebump\fR and \fIego\fR. - -.SH "AUTHORS" -.LP -Matthew Schick <matt@breakmygentoo.net> (original author) -.br -Karl Trygve Kalleberg <karltk@gentoo.org> - diff --git a/trunk/src/gensync/gensync.conf b/trunk/src/gensync/gensync.conf deleted file mode 100644 index 389e020..0000000 --- a/trunk/src/gensync/gensync.conf +++ /dev/null @@ -1,8 +0,0 @@ - -# By default, we ask Portage about the preferred timeout -#rsync_timeout = 180 - -# Normally, each sync source will be placed under -# ${base_overlay}/${syncsource-id}, where the 'syncsource-id' is a unique -# identifier, specified inside the individual .syncsource file -base_overlay = /usr/local/overlays |