entropy: remove gentoo-compat option, always enabled
This commit is contained in:
@@ -782,7 +782,6 @@ def getinfo(dict = False):
|
||||
# variables
|
||||
info['User protected directories'] = SysSettings[sys_set_client_plg_id]['misc']['configprotect']
|
||||
info['Collision Protection'] = SysSettings[sys_set_client_plg_id]['misc']['collisionprotect']
|
||||
info['Gentoo Compatibility'] = etpConst['gentoo-compat']
|
||||
info['Entropy Log Level'] = SysSettings['system']['log_level']
|
||||
info['Current branch'] = SysSettings['repositories']['branch']
|
||||
info['Entropy configuration directory'] = etpConst['confdir']
|
||||
|
||||
@@ -1379,19 +1379,18 @@ class MiscMixin:
|
||||
tar.close()
|
||||
|
||||
# appending xpak metadata
|
||||
if etpConst['gentoo-compat']:
|
||||
import entropy.xpak as xpak
|
||||
Spm = self.Spm()
|
||||
import entropy.xpak as xpak
|
||||
Spm = self.Spm()
|
||||
|
||||
gentoo_name = self.entropyTools.remove_tag(pkgname)
|
||||
gentoo_name = self.entropyTools.remove_entropy_revision(gentoo_name)
|
||||
if portdbPath == None:
|
||||
dbdir = Spm.get_vdb_path()+"/"+pkgcat+"/"+gentoo_name+"/"
|
||||
else:
|
||||
dbdir = portdbPath+"/"+pkgcat+"/"+gentoo_name+"/"
|
||||
if os.path.isdir(dbdir):
|
||||
tbz2 = xpak.tbz2(dirpath)
|
||||
tbz2.recompose(dbdir)
|
||||
gentoo_name = self.entropyTools.remove_tag(pkgname)
|
||||
gentoo_name = self.entropyTools.remove_entropy_revision(gentoo_name)
|
||||
if portdbPath == None:
|
||||
dbdir = Spm.get_vdb_path()+"/"+pkgcat+"/"+gentoo_name+"/"
|
||||
else:
|
||||
dbdir = portdbPath+"/"+pkgcat+"/"+gentoo_name+"/"
|
||||
if os.path.isdir(dbdir):
|
||||
tbz2 = xpak.tbz2(dirpath)
|
||||
tbz2.recompose(dbdir)
|
||||
|
||||
if edb:
|
||||
self.inject_entropy_database_into_package(dirpath, pkgdata)
|
||||
|
||||
@@ -287,13 +287,12 @@ class Package:
|
||||
os._exit(0)
|
||||
|
||||
# unpack xpak ?
|
||||
if etpConst['gentoo-compat']:
|
||||
if os.path.isdir(self.infoDict['xpakpath']):
|
||||
shutil.rmtree(self.infoDict['xpakpath'])
|
||||
try:
|
||||
os.rmdir(self.infoDict['xpakpath'])
|
||||
except OSError:
|
||||
pass
|
||||
if os.path.isdir(self.infoDict['xpakpath']):
|
||||
shutil.rmtree(self.infoDict['xpakpath'])
|
||||
try:
|
||||
os.rmdir(self.infoDict['xpakpath'])
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
# create data dir where we'll unpack the xpak
|
||||
os.makedirs(self.infoDict['xpakpath']+"/"+etpConst['entropyxpakdatarelativepath'],0755)
|
||||
@@ -423,10 +422,9 @@ class Package:
|
||||
self.__remove_package_from_database()
|
||||
|
||||
# Handle spm database
|
||||
if etpConst['gentoo-compat']:
|
||||
spm_atom = self.entropyTools.remove_tag(self.infoDict['removeatom'])
|
||||
self.Entropy.clientLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_NORMAL,"Removing from Spm: "+str(spm_atom))
|
||||
self.__remove_package_from_spm_database(spm_atom)
|
||||
spm_atom = self.entropyTools.remove_tag(self.infoDict['removeatom'])
|
||||
self.Entropy.clientLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_NORMAL,"Removing from Spm: "+str(spm_atom))
|
||||
self.__remove_package_from_spm_database(spm_atom)
|
||||
|
||||
self.__remove_content_from_system(protected_removable_config_files)
|
||||
return 0
|
||||
@@ -597,7 +595,7 @@ class Package:
|
||||
'''
|
||||
def __remove_package_from_spm_database(self, atom):
|
||||
|
||||
# handle gentoo-compat
|
||||
# handle spm support
|
||||
try:
|
||||
Spm = self.Entropy.Spm()
|
||||
except:
|
||||
@@ -846,18 +844,12 @@ class Package:
|
||||
)
|
||||
self.infoDict['removeidpackage'] = -1 # disabling database removal
|
||||
|
||||
if etpConst['gentoo-compat']:
|
||||
self.Entropy.clientLog.log(
|
||||
ETP_LOGPRI_INFO,
|
||||
ETP_LOGLEVEL_NORMAL,
|
||||
"Removing Entropy and Spm database entry for %s" % (self.infoDict['removeatom'],)
|
||||
)
|
||||
else:
|
||||
self.Entropy.clientLog.log(
|
||||
ETP_LOGPRI_INFO,
|
||||
ETP_LOGLEVEL_NORMAL,
|
||||
"Removing Entropy (only) database entry for %s" % (self.infoDict['removeatom'],)
|
||||
)
|
||||
self.Entropy.clientLog.log(
|
||||
ETP_LOGPRI_INFO,
|
||||
ETP_LOGLEVEL_NORMAL,
|
||||
"Removing Entropy and Spm database entry for %s" % (
|
||||
self.infoDict['removeatom'],)
|
||||
)
|
||||
|
||||
self.Entropy.updateProgress(
|
||||
blue(_("Cleaning old package files...")),
|
||||
@@ -867,14 +859,12 @@ class Package:
|
||||
)
|
||||
self.__remove_package()
|
||||
|
||||
rc = 0
|
||||
if etpConst['gentoo-compat']:
|
||||
self.Entropy.clientLog.log(
|
||||
ETP_LOGPRI_INFO,
|
||||
ETP_LOGLEVEL_NORMAL,
|
||||
"Installing new Spm database entry: %s" % (self.infoDict['atom'],)
|
||||
)
|
||||
rc = self._install_package_into_spm_database(newidpackage)
|
||||
self.Entropy.clientLog.log(
|
||||
ETP_LOGPRI_INFO,
|
||||
ETP_LOGLEVEL_NORMAL,
|
||||
"Installing new Spm database entry: %s" % (self.infoDict['atom'],)
|
||||
)
|
||||
rc = self._install_package_into_spm_database(newidpackage)
|
||||
|
||||
return rc
|
||||
|
||||
@@ -884,7 +874,7 @@ class Package:
|
||||
'''
|
||||
def _install_package_into_spm_database(self, newidpackage):
|
||||
|
||||
# handle gentoo-compat
|
||||
# handle spm support
|
||||
try:
|
||||
Spm = self.Entropy.Spm()
|
||||
except:
|
||||
@@ -2250,18 +2240,21 @@ class Package:
|
||||
self.infoDict['imagedir'] = etpConst['entropyunpackdir']+"/"+self.infoDict['download']+"/"+etpConst['entropyimagerelativepath']
|
||||
|
||||
# spm xpak data
|
||||
if etpConst['gentoo-compat']:
|
||||
self.infoDict['xpakpath'] = etpConst['entropyunpackdir']+"/"+self.infoDict['download']+"/"+etpConst['entropyxpakrelativepath']
|
||||
if not self.infoDict['merge_from']:
|
||||
self.infoDict['xpakstatus'] = None
|
||||
self.infoDict['xpakdir'] = self.infoDict['xpakpath']+"/"+etpConst['entropyxpakdatarelativepath']
|
||||
else:
|
||||
self.infoDict['xpakstatus'] = True
|
||||
portdbdir = 'var/db/pkg' # XXX hard coded ?
|
||||
portdbdir = os.path.join(self.infoDict['merge_from'],portdbdir)
|
||||
portdbdir = os.path.join(portdbdir,self.infoDict['category'])
|
||||
portdbdir = os.path.join(portdbdir,self.infoDict['name']+"-"+self.infoDict['version'])
|
||||
self.infoDict['xpakdir'] = portdbdir
|
||||
self.infoDict['xpakpath'] = etpConst['entropyunpackdir'] + "/" + \
|
||||
self.infoDict['download'] + "/" + \
|
||||
etpConst['entropyxpakrelativepath']
|
||||
if not self.infoDict['merge_from']:
|
||||
self.infoDict['xpakstatus'] = None
|
||||
self.infoDict['xpakdir'] = self.infoDict['xpakpath'] + "/" + \
|
||||
etpConst['entropyxpakdatarelativepath']
|
||||
else:
|
||||
self.infoDict['xpakstatus'] = True
|
||||
portdbdir = 'var/db/pkg' # XXX hard coded ?
|
||||
portdbdir = os.path.join(self.infoDict['merge_from'], portdbdir)
|
||||
portdbdir = os.path.join(portdbdir, self.infoDict['category'])
|
||||
portdbdir = os.path.join(portdbdir, self.infoDict['name'] + "-" + \
|
||||
self.infoDict['version'])
|
||||
self.infoDict['xpakdir'] = portdbdir
|
||||
|
||||
# compare both versions and if they match, disable removeidpackage
|
||||
if self.infoDict['removeidpackage'] != -1:
|
||||
@@ -2301,19 +2294,14 @@ class Package:
|
||||
if (self.infoDict['removeidpackage'] != -1):
|
||||
self.infoDict['steps'].append("postremove")
|
||||
self.infoDict['steps'].append("postinstall")
|
||||
if not etpConst['gentoo-compat']: # otherwise spm triggers will show that
|
||||
self.infoDict['steps'].append("showmessages")
|
||||
else:
|
||||
self.infoDict['steps'].append("logmessages")
|
||||
self.infoDict['steps'].append("logmessages")
|
||||
self.infoDict['steps'].append("cleanup")
|
||||
|
||||
self.infoDict['triggers']['install'] = dbconn.getTriggerInfo(idpackage)
|
||||
self.infoDict['triggers']['install']['accept_license'] = self.infoDict['accept_license']
|
||||
self.infoDict['triggers']['install']['unpackdir'] = self.infoDict['unpackdir']
|
||||
self.infoDict['triggers']['install']['imagedir'] = self.infoDict['imagedir']
|
||||
if etpConst['gentoo-compat']:
|
||||
#self.infoDict['triggers']['install']['xpakpath'] = self.infoDict['xpakpath']
|
||||
self.infoDict['triggers']['install']['xpakdir'] = self.infoDict['xpakdir']
|
||||
self.infoDict['triggers']['install']['xpakdir'] = self.infoDict['xpakdir']
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ class Trigger:
|
||||
self.pkgdata = pkgdata
|
||||
self.prepared = False
|
||||
self.triggers = set()
|
||||
self.gentoo_compat = etpConst['gentoo-compat']
|
||||
self.package_action = package_action
|
||||
|
||||
'''
|
||||
@@ -53,25 +52,24 @@ class Trigger:
|
||||
self.MODULEDB_DIR="/var/lib/module-rebuild/"
|
||||
self.INITSERVICES_DIR="/var/lib/init.d/"
|
||||
|
||||
''' portage stuff '''
|
||||
if self.gentoo_compat:
|
||||
try:
|
||||
Spm = self.Entropy.Spm()
|
||||
self.Spm = Spm
|
||||
except Exception, e:
|
||||
self.entropyTools.print_traceback()
|
||||
mytxt = darkred("%s, %s: %s, %s !") % (
|
||||
_("Portage interface can't be loaded"),
|
||||
_("Error"),
|
||||
e,
|
||||
_("please fix"),
|
||||
)
|
||||
self.Entropy.updateProgress(
|
||||
mytxt,
|
||||
importance = 0,
|
||||
header = bold(" !!! ")
|
||||
)
|
||||
self.gentoo_compat = False
|
||||
self.spm_support = True
|
||||
try:
|
||||
Spm = self.Entropy.Spm()
|
||||
self.Spm = Spm
|
||||
except Exception, e:
|
||||
self.entropyTools.print_traceback()
|
||||
mytxt = darkred("%s, %s: %s, %s !") % (
|
||||
_("Portage interface can't be loaded"),
|
||||
_("Error"),
|
||||
e,
|
||||
_("please fix"),
|
||||
)
|
||||
self.Entropy.updateProgress(
|
||||
mytxt,
|
||||
importance = 0,
|
||||
header = bold(" !!! ")
|
||||
)
|
||||
self.spm_support = False
|
||||
|
||||
self.phase = phase
|
||||
# validate phase
|
||||
@@ -102,7 +100,7 @@ class Trigger:
|
||||
|
||||
functions = []
|
||||
# Gentoo hook
|
||||
if self.gentoo_compat:
|
||||
if self.spm_support:
|
||||
while 1:
|
||||
if self.pkgdata['spm_phases'] != None:
|
||||
if etpConst['spm']['postinst_phase'] not \
|
||||
@@ -163,7 +161,7 @@ class Trigger:
|
||||
functions = []
|
||||
|
||||
# Portage phases
|
||||
if self.gentoo_compat:
|
||||
if self.spm_support:
|
||||
while 1:
|
||||
if self.pkgdata['spm_phases'] != None:
|
||||
if etpConst['spm']['preinst_phase'] not \
|
||||
@@ -215,7 +213,7 @@ class Trigger:
|
||||
functions = []
|
||||
|
||||
# Gentoo hook
|
||||
if self.gentoo_compat:
|
||||
if self.spm_support:
|
||||
|
||||
while 1:
|
||||
if self.pkgdata['spm_phases'] != None:
|
||||
|
||||
@@ -388,8 +388,6 @@ def const_default_settings(rootdir):
|
||||
'branch': "4",
|
||||
# default allowed package keywords
|
||||
'keywords': set([etpSys['arch'],"~"+etpSys['arch']]),
|
||||
# Gentoo compatibility (/var/db/pkg + Portage availability)
|
||||
'gentoo-compat': True,
|
||||
# allow multiple packages in single scope server-side?
|
||||
# this makes possible to have multiple versions of packages
|
||||
# and handle the removal through expiration (using creation date)
|
||||
|
||||
+19
-22
@@ -833,28 +833,25 @@ class LocalRepository:
|
||||
# this is the place to add extra actions support
|
||||
def runTreeUpdatesActions(self, actions):
|
||||
|
||||
# just run fixpackages if gentoo-compat is enabled
|
||||
if etpConst['gentoo-compat']:
|
||||
|
||||
mytxt = "%s: %s, %s." % (
|
||||
bold(_("SPM")),
|
||||
blue(_("Running fixpackages")),
|
||||
red(_("it could take a while")),
|
||||
)
|
||||
self.updateProgress(
|
||||
mytxt,
|
||||
importance = 1,
|
||||
type = "warning",
|
||||
header = darkred(" * ")
|
||||
)
|
||||
if self.clientDatabase:
|
||||
try:
|
||||
spm = self.ServiceInterface.Spm()
|
||||
spm.run_fixpackages()
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
self.ServiceInterface.SpmService.run_fixpackages()
|
||||
mytxt = "%s: %s, %s." % (
|
||||
bold(_("SPM")),
|
||||
blue(_("Running fixpackages")),
|
||||
red(_("it could take a while")),
|
||||
)
|
||||
self.updateProgress(
|
||||
mytxt,
|
||||
importance = 1,
|
||||
type = "warning",
|
||||
header = darkred(" * ")
|
||||
)
|
||||
if self.clientDatabase:
|
||||
try:
|
||||
spm = self.ServiceInterface.Spm()
|
||||
spm.run_fixpackages()
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
self.ServiceInterface.SpmService.run_fixpackages()
|
||||
|
||||
spm_moves = set()
|
||||
quickpkg_atoms = set()
|
||||
|
||||
Reference in New Issue
Block a user