Permalink
Browse files

Initial commit (basic cli interface)

  • Loading branch information...
0 parents commit df475f114380e8f6f1a6f0a3e70d2284db234ca1 @lirazsiri lirazsiri committed Feb 14, 2010
Showing with 186 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +56 −0 Makefile
  3. +1 −0 debian/.gitignore
  4. +1 −0 debian/compat
  5. 0 debian/conffiles
  6. +12 −0 debian/control
  7. +23 −0 debian/copyright
  8. +4 −0 debian/postinst
  9. +4 −0 debian/preinst
  10. +33 −0 debian/rules
  11. +51 −0 whatchanged.py
@@ -0,0 +1 @@
+*.pyc
@@ -0,0 +1,56 @@
+# standard Python project Makefile
+progname = $(shell awk '/^Source/ {print $$2}' debian/control)
+name=
+
+prefix = /usr/local
+PATH_BIN = $(prefix)/bin
+PATH_INSTALL_LIB = $(prefix)/lib/$(progname)
+PATH_DIST := $(progname)-$(shell date +%F)
+
+truepath = $(shell echo $1 | sed -e 's/^debian\/$(progname)//')
+
+all: help
+
+debug:
+ $(foreach v, $V, $(warning $v = $($v)))
+ @true
+
+dist: clean
+ -mkdir -p $(PATH_DIST)
+
+ -cp -a .git .gitignore $(PATH_DIST)
+ -cp -a *.sh *.c *.py Makefile pylib/ libexec* $(PATH_DIST)
+
+ tar jcvf $(PATH_DIST).tar.bz2 $(PATH_DIST)
+ rm -rf $(PATH_DIST)
+
+### Extendable targets
+
+# target: help
+help:
+ @echo '=== Targets:'
+ @echo 'install [ prefix=path/to/usr ] # default: prefix=$(value prefix)'
+ @echo 'uninstall [ prefix=path/to/usr ]'
+ @echo
+ @echo 'clean'
+ @echo
+ @echo 'dist # create distribution tarball'
+
+# target: install
+install:
+ @echo
+ @echo \*\* CONFIG: prefix = $(prefix) \*\*
+ @echo
+
+ install -d $(PATH_BIN) $(PATH_INSTALL_LIB)
+ cp *.py $(PATH_INSTALL_LIB)
+ ln -fs $(call truepath,$(PATH_INSTALL_LIB))/$(progname).py $(PATH_BIN)/$(progname)
+
+# target: uninstall
+uninstall:
+ rm -rf $(PATH_INSTALL_LIB)
+ rm -f $(PATH_BIN)/$(progname)
+
+# target: clean
+clean:
+ rm -f *.pyc *.pyo _$(progname)
@@ -0,0 +1 @@
+changelog
@@ -0,0 +1 @@
+5
No changes.
@@ -0,0 +1,12 @@
+Source: whatchanged
+Section: misc
+Priority: optional
+Maintainer: Liraz Siri <liraz@sterilesecurity.com>
+Build-Depends: debhelper (>> 4.2.0)
+Standards-Version: 3.6.1
+
+Package: whatchanged
+Architecture: all
+Depends: python (>= 2.4)
+Section: misc
+Description: Example
@@ -0,0 +1,23 @@
+Author: Liraz Siri <liraz@turnkeylinux.org>
+
+License:
+
+ Copyright (C) 2010 Liraz Siri <liraz@turnkeylinux.org>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian and Ubuntu systems, the complete text of the GNU General Public
+License can be found in /usr/share/common-licenses/GPL file.
+
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+#DEBHELPER#
+exit 0
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+#DEBHELPER#
+exit 0
@@ -0,0 +1,33 @@
+#! /usr/bin/make -f
+
+progname=$(shell awk '/^Source/ {print $$2}' debian/control)
+buildroot=debian/$(progname)
+prefix=$(buildroot)/usr
+
+clean:
+ dh_clean
+
+build:
+ mkdir -p $(prefix)
+
+install:
+ dh_testroot
+ dh_clean -k
+ dh_testdir
+ dh_installdirs
+ dh_install
+ $(MAKE) install prefix=$(prefix)
+
+binary-indep: install
+ dh_testdir
+ dh_testroot
+ dh_installdocs
+ dh_installdeb
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary-arch: install
+
+binary: binary-indep binary-arch
+.PHONY: clean binary-indep binary-arch binary install
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+"""Print a list of files that have changed
+
+Options:
+ --create create index
+
+"""
+import sys
+import getopt
+
+def usage(e=None):
+ if e:
+ print >> sys.stderr, e
+
+ print >> sys.stderr, "Syntax: %s index path1 ... pathN" % sys.argv[0]
+ print >> sys.stderr, __doc__.strip()
+ sys.exit(1)
+
+def fatal(s):
+ print >> sys.stderr, "error: " + str(s)
+ sys.exit(1)
+
+def main():
+ try:
+ opts, args = getopt.gnu_getopt(sys.argv[1:], 'c:h',
+ ['create'])
+ except getopt.GetoptError, e:
+ usage(e)
+
+ opt_create = False
+
+ for opt, val in opts:
+ if opt == '-h':
+ usage()
+
+ elif opt in ('-c', '--create'):
+ opt_create = True
+
+ if len(args) < 2:
+ usage()
+
+ index = args[0]
+ paths = args[1:]
+
+ print 'index: ' + `index`
+ print 'paths: ' + `paths`
+ print 'opt_create: ' + `opt_create`
+
+if __name__=="__main__":
+ main()
+

0 comments on commit df475f1

Please sign in to comment.