Commit 78a79f09 authored by Daniel Armbruster's avatar Daniel Armbruster Committed by thomas.forbriger
Browse files

Proceeding

This is a legacy commit from before 2015-05-18.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.

SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 4157
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 1d6b1145
#!/bin/bash
# This is <csbackgen.sh>
# ----------------------------------------------------------------------------
# $Id$
# Copyright (c) 2011 by Daniel Armbruster
# ----
#
# Purpose: Shell script which provides exactly the same functionality and
# exactly the same interface as csbackgen.py of the csback software suite.
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
# ----
# Daniel Armbruster 15/09/2011
#
# REVISIONS and CHANGES
# 15/09/2011 V0.1 Daniel Armbruster
# ----------------------------------------------------------------------------
#
# USAGE:
#
# ----------------------------------------------------------------------------
function usage {
echo -ne "This is <csbackgen.sh>\n" >&2
echo -ne "Copyright (c) 2011 by Daniel Armbruster\n" >&2
echo -ne "Purpose: Shell script which provides exactly the same\n" >&2
echo -ne " functionality and the same interface as\n" >&2
echo -ne " csbackgen.py of the csback software toolkit.\n" >&2
echo -ne "Usage: `basename $0` [-e REGEX] [-o OUTPUT_DIR]
\t \t[-p PROJECT_NAME] [-t FILE_TYPE] FILENAME\n" >&2
echo -ne "\t-h\tDisplay this help.\n" >&2
echo -ne "\t-e REGEX\t Exclude files or directories matching this\n" >&2
echo -ne "\t\t\t pattern." >&2
if [ ${hflag} ]
then
exit 0
else
exit 2
fi
}
# ----- END OF csbackgen.sh -----
......@@ -57,7 +57,10 @@
# Possible flags are
# [-c] Perform a test of the TARGET and the SOURCE directory.
# Default after executing a backup is only to check the TARGET
# directory for integrity.
# directory for integrity. Using the [-c] flag you have to make
# sure that the filesystem SOURCE is located on isn't readonly.
# Additionally SOURCE must contain a already existing
# checksumfile.
# [-t] Be tolerant. While checking don't report anything if a file
# listed in the checksumfile is missing. This flag is useful if a
# test of a SOURCE directory is executed but SOURCE is realized
......@@ -66,7 +69,6 @@
# be executed to perform afterwards a backup. A test of the
# TARGET directory won't be executed as well as the [-c] and [-t]
# flags are ignored.
# If only one directory is given csback assumes that only testing
# the integrity of the corresponding directory is desired.
# [-e regexp ] A pattern which contains a regular expression to exclude
# subdirectories of SOURCE matching the regular expression.
......
......@@ -34,4 +34,31 @@
#
# =============================================================================
import os
import re
import hashlib
class csFile:
def __init__(self, fname):
self.__fname = fname
self.__lines = []
def __init__(self, fname, dir, hashfunc=hashlib.sha256):
self.__fname = fname
self.__dir = dir
def __init__(self, fname, dir, regex, hashfunc=hashlib.sha256):
self.__fname = fname
self.__dir = dir
def __getitem__(self, index):
return self.__lines[index]
def __setitem__(self, index, item):
self.__lines[index] = item
class csLine:
def __init__(self, file, hashfunc = hashlib.sha256):
# ----- END OF csfile.py -----
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment