summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <rsiddharth@ninthfloor.org>2013-12-10 23:45:18 +0530
committerrsiddharth <rsiddharth@ninthfloor.org>2013-12-10 23:45:18 +0530
commit21225aac8880d840612d186defa043be485b8db0 (patch)
tree7d2ba885ba4309283d9a674adf2bfcabe70c4af9
initial commit.
-rw-r--r--COPYING14
-rw-r--r--packages-parkes.list47
-rw-r--r--src/gns-deb-diff.py95
3 files changed, 156 insertions, 0 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..5a8e332
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,14 @@
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 2, December 2004
+
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
+
diff --git a/packages-parkes.list b/packages-parkes.list
new file mode 100644
index 0000000..7c00c89
--- /dev/null
+++ b/packages-parkes.list
@@ -0,0 +1,47 @@
+antlr
+apt
+apt-setup
+bacula
+base-files
+base-installer
+batik
+cdebootstrap
+claws-mail
+debian-cd
+debian-installer
+debian-installer-launcher
+debootstrap
+desktop-base
+enscript
+epiphany-browser
+fop
+galaxia
+gdm3
+gnewsense-archive-keyring
+gnome-desktop
+iceweasel
+kde4libs
+kdebase
+kdenetwork
+kernel-wedge
+liferea
+lintian
+linux-2.6
+linux-kernel-di-amd64-2.6
+linux-kernel-di-i386-2.6
+linux-latest-2.6
+live-build
+live-config
+meta-gnome2
+net-retriever
+openoffice.org
+python-apt
+screenlets
+texlive-extra
+update-manager
+wmaker
+xchat
+xdm
+xorg-server
+xserver-xorg-video-siliconmotion
+yeeloong-base \ No newline at end of file
diff --git a/src/gns-deb-diff.py b/src/gns-deb-diff.py
new file mode 100644
index 0000000..48dab1d
--- /dev/null
+++ b/src/gns-deb-diff.py
@@ -0,0 +1,95 @@
+# Copyright 2013 rsiddharth <rsiddharth@ninthfloor.org>
+#
+# This work is free. You can redistribute it and/or modify it under
+# the terms of the Do What The Fuck You Want To Public License,
+# Version 2, as published by Sam Hocevar. See the COPYING file or
+# <http://www.wtfpl.net/> for more details.
+
+import subprocess as child
+import shlex
+
+# global variables.
+bzr_base_url = ""
+local_dir = ""
+pkgs_file = ""
+
+def get_packages():
+ """
+ Return a list of package names from pkgs_file.
+ """
+ global pkgs_file
+
+ try:
+ packages_file = file(pkgs_file, 'r')
+ except IOError, e:
+ print "Trouble opening %r" % pkgs_file
+ print e
+ return None
+
+ packages = []
+ for package in packages_file.readlines():
+ packages.append(package.strip())
+
+ packages_file.close()
+
+ print packages
+
+ return packages
+
+
+def bzr_branch_command(package):
+ """
+ Return the command to create a local bzr branch of package.
+ """
+ global bzr_base_url, local_dir
+
+ return "bzr branch %s/%s %s/%s" % (bzr_base_url, package,
+ local_dir, package)
+
+def fetch_bzr_branch(package):
+ """
+ Create a local bzr branch of the package.
+ """
+ bzr_branch_cmd = bzr_branch_command(package)
+ print "doing %s ..." % bzr_branch_cmd
+ return child.call(shlex.split(bzr_branch_cmd))
+
+
+def deploy_packages_locally(packages_list):
+ """
+ Create a local bzr branch for each package in packages list.
+ """
+ for pkg in packages_list:
+ fetch_bzr_branch(pkg)
+
+def get_paraphernalia():
+ """
+ Read relevant values from stdin to start work.
+ """
+ global bzr_base_url, local_dir, pkgs_file
+
+ stdin = raw_input("> url of packages location: ").strip()
+
+ if (len(stdin) != 0):
+ bzr_base_url = stdin
+ else:
+ bzr_base_url = "bzr://bzr.savannah.gnu.org/gnewsense/packages-parkes"
+
+ # directory under which the bzr branches has to be stored.
+ local_dir = raw_input("> local directory: ")
+
+ # absolute path to file which contains the packages names.
+ # one package per line.
+ stdin = raw_input("> packages list file (absolute path): ").strip()
+
+ if (len(stdin) != 0):
+ pkgs_file = stdin
+ else:
+ pkgs_file = "packages-parkes.list"
+
+ packages_list = get_packages()
+
+ return packages_list
+
+pkgs_list = get_paraphernalia()
+deploy_packages_locally(pkgs_list)