diff options
author | Paul Sokolovsky <pmiscml@gmail.com> | 2006-08-30 09:44:22 +0000 |
---|---|---|
committer | Paul Sokolovsky <pmiscml@gmail.com> | 2006-08-30 09:44:22 +0000 |
commit | 5b7b79c16d9547471842bc26719b3c4bfa75181e (patch) | |
tree | 47ccfb41043f759590269d788c097ca06d45b505 /contrib | |
parent | 3d7729be91fd12330e2163f4ec1cd4c756bdaaae (diff) | |
parent | f9633f75d64fa1df42abd2415cee22695b556e00 (diff) |
merge of '82565cfcf6fec66996d36d4605c34faa7d256c15'
and 'da7632a154580311895110a4f07328ec4c6ed8fe'
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/feed-browser/includes/config.inc | 24 | ||||
-rw-r--r-- | contrib/feed-browser/includes/functions.inc | 8 | ||||
-rw-r--r-- | contrib/feed-browser/update.php | 13 | ||||
-rwxr-xr-x | contrib/mtnpatch.py | 54 |
4 files changed, 38 insertions, 61 deletions
diff --git a/contrib/feed-browser/includes/config.inc b/contrib/feed-browser/includes/config.inc index 0a270a8eb0..e1999b066f 100644 --- a/contrib/feed-browser/includes/config.inc +++ b/contrib/feed-browser/includes/config.inc @@ -11,50 +11,62 @@ $feeds = array( array( 'name'=>'base', 'url'=>'base', + 'type'=>'normal', ), array( 'name'=>'opie', 'url'=>'opie', + 'type'=>'normal', ), array( 'name'=>'x11', 'url'=>'x11', + 'type'=>'normal', ), array( 'name'=>'upgrades', 'url'=>'upgrades', + 'type'=>'upgrades', ), array( 'name'=>'perl', 'url'=>'perl', + 'type'=>'normal', ), array( 'name'=>'python', 'url'=>'python', + 'type'=>'normal', ), array( 'name'=>'Collie upgrades', 'url'=>'upgrades/machine/collie', + 'type'=>'upgrades', ), array( 'name'=>'Tosa upgrades', 'url'=>'upgrades/machine/tosa', + 'type'=>'upgrades', ), array( 'name'=>'Poodle upgrades', 'url'=>'upgrades/machine/poodle', + 'type'=>'upgrades', ), array( 'name'=>'Poodle', 'url'=>'machine/poodle', + 'type'=>'normal', ), array( 'name'=>'Collie', 'url'=>'machine/collie', + 'type'=>'normal', ), array( 'name'=>'Tosa', 'url'=>'machine/tosa', + 'type'=>'normal', ) ) ), @@ -66,50 +78,62 @@ $feeds = array( array( 'name'=>'base', 'url'=>'base', + 'type'=>'normal', ), array( 'name'=>'opie', 'url'=>'opie', + 'type'=>'normal', ), array( 'name'=>'perl', 'url'=>'perl', + 'type'=>'normal', ), array( 'name'=>'python', 'url'=>'python', + 'type'=>'normal', ), array( 'name'=>'upgrades', 'url'=>'upgrades', + 'type'=>'upgrades', ), array( 'name'=>'x11', 'url'=>'x11', + 'type'=>'normal', ), array( 'name'=>'C7x0', 'url'=>'machine/c7x0', + 'type'=>'normal', ), array( 'name'=>'Spitz', 'url'=>'machine/spitz', + 'type'=>'normal', ), array( 'name'=>'Akita', 'url'=>'machine/akita', + 'type'=>'normal', ), array( 'name'=>'Akita upgrades', 'url'=>'upgrades/machine/akita', + 'type'=>'upgrades', ), array( 'name'=>'C7x0 upgrades', 'url'=>'upgrades/machine/c7x0', + 'type'=>'upgrades', ), array( 'name'=>'Spitz upgrades', 'url'=>'upgrades/machine/spitz', + 'type'=>'upgrades', ) ) ) diff --git a/contrib/feed-browser/includes/functions.inc b/contrib/feed-browser/includes/functions.inc index 4745c75910..2532dd7c08 100644 --- a/contrib/feed-browser/includes/functions.inc +++ b/contrib/feed-browser/includes/functions.inc @@ -85,11 +85,12 @@ function insert_feeds ($db) { foreach($distro['feeds'] as $feed) { - sqlite_query($db, "INSERT INTO feeds (f_id, f_name, f_uri) VALUES + sqlite_query($db, "INSERT INTO feeds (f_id, f_name, f_uri, f_type) VALUES ( {$id}, '{$distro['distro_name']} {$distro['distro_version']} {$feed['name']}', - '{$distro['feed_base_url']}{$feed['url']}' + '{$distro['feed_base_url']}{$feed['url']}', + '{$feed['type']}' )"); $id++; @@ -441,7 +442,8 @@ function check_database() f_id int(8), f_name varchar(32), f_uri varchar(100), - f_comments varchar(500))"); + f_type varchar(16) + )"); insert_feeds ($db) ; } diff --git a/contrib/feed-browser/update.php b/contrib/feed-browser/update.php index 786e898494..ed67d3b78a 100644 --- a/contrib/feed-browser/update.php +++ b/contrib/feed-browser/update.php @@ -39,15 +39,20 @@ require_once 'includes/functions.inc'; check_database(); +$feeds = db_query("SELECT f_id, f_name, f_uri FROM feeds"); + +if($argc > 1 AND $argv[1] == 'upgrades') +{ + $feeds = db_query("SELECT f_id, f_name, f_uri FROM feeds WHERE f_type = 'upgrades'"); +} + $start = time(); $p_count = 0; -$feeds = db_query("SELECT f_id, f_name, f_uri FROM feeds"); - foreach($feeds as $feed) { print("Updating {$feed['f_name']}: "); - db_query_n("DELETE FROM packages WHERE p_feed = '{$feed['f_name']}'"); + db_query_n("DELETE FROM packages WHERE p_feed = '{$feed['f_id']}'"); $count = 0; @@ -104,7 +109,7 @@ foreach($feeds as $feed) $package_info['conflicts'] = $value; break; case 'Section': - $package_info['section'] = $value; + $package_info['section'] = strtolower($value); break; case 'Architecture': $package_info['arch'] = $value; diff --git a/contrib/mtnpatch.py b/contrib/mtnpatch.py deleted file mode 100755 index 73143dba69..0000000000 --- a/contrib/mtnpatch.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -import sys, os, string, getopt, re - -mtncmd = "monotone" - -def main(argv = None): - if argv is None: - argv = sys.argv - opts, list = getopt.getopt(sys.argv[1:], ':R') - if len(list) < 1: - print "You must specify a file" - return 2 - reverse = False - for o, a in opts: - if o == "-R": - reverse = True - if os.path.exists(list[0]): - input = open(list[0], 'r') - renameFrom = "" - cmd = "" - if reverse: - print "patch -R -p0 < %s" % list[0] - else: - print "patch -p0 < %s" % list[0] - for line in input: - if len(line) > 0: - if line[0] == '#': - matches = re.search("#\s+(\w+)\s+\"(.*)\"", line) - if matches is not None: - cmd = matches.group(1) - fileName = matches.group(2) - if cmd == "delete_file": - if reverse: - print "%s add %s" % (mtncmd, fileName) - else: - print "%s drop -e %s" % (mtncmd, fileName) - elif cmd == "add_file": - if reverse: - print "%s drop -e %s" % (mtncmd, fileName) - else: - print "%s add %s" % (mtncmd, fileName) - elif cmd == "rename_file": - renameFrom = fileName - elif cmd == "to" and renameFrom != "": - if reverse: - print "%s rename -e %s %s" % (mtncmd, fileName, renameFrom) - else: - print "%s rename -e %s %s" % (mtncmd, renameFrom, fileName) - renameFrom = "" - else: - cmd = "" - -if __name__ == "__main__": - sys.exit(main()) |