aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Kahle <tom111@gmx.de>2011-09-22 02:10:20 +0100
committerThomas Kahle <tom111@gmx.de>2011-09-22 02:10:20 +0100
commit72dbf79a4296aa72d1a5124e6a73c7a9d55b69e8 (patch)
treeea36d84669e94bb6d7851979565b2a52084d1a67 /scripts
parentecommit removed (diff)
downloadtatt-72dbf79a4296aa72d1a5124e6a73c7a9d55b69e8.tar.gz
tatt-72dbf79a4296aa72d1a5124e6a73c7a9d55b69e8.tar.bz2
tatt-72dbf79a4296aa72d1a5124e6a73c7a9d55b69e8.zip
Clean-Up script implemented, small refactoring
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/tatt20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/tatt b/scripts/tatt
index fbe2065..ca50cdb 100755
--- a/scripts/tatt
+++ b/scripts/tatt
@@ -149,23 +149,23 @@ if not packs==None:
if isroot:
# If we are root, then we can write to package.keywords
try:
- keywordfile=open("/etc/portage/package.keywords/arch", 'r+')
+ unmaskfile=open(config['unmaskfile'], 'r+')
except IOError:
# create an empty file, this should be beautified
- keywordfile=open("/etc/portage/package.keywords/arch", 'w')
- keywordfile.write(" ")
- keywordfile.close()
- keywordfile=open("/etc/portage/package.keywords/arch", 'r+')
+ unmaskfile=open(config['unmaskfile'], 'w')
+ unmaskfile.write(" ")
+ unmaskfile.close()
+ unmaskfile=open(config['unmaskfile'], 'r+')
- keywordfilecontent = keywordfile.read()
+ unmaskfileContent = unmaskfile.read()
for p in packs:
- # Test if keywordfile already contains the atom
- if re.search(p.packageString(), keywordfilecontent):
+ # Test if unmaskfile already contains the atom
+ if re.search(p.packageString(), unmaskfileContent):
print (p.packageString() + " already in package.keywords.")
else:
- keywordfile.write("\n" + p.packageString() + "\n")
+ unmaskfile.write("\n" + p.packageString() + "\n")
print ("Appended " + p.packageString()+ " to /etc/portage/package.keywords/arch")
- keywordfile.close()
+ unmaskfile.close()
else:
print ("You are not root, your unmaskstring would be:")
print ("\n".join([p.packageString() for p in packs]) + "\n")