Skip to content

Commit

Permalink
Merge pull request #25 from Pika-Software/dev
Browse files Browse the repository at this point in the history
1.33.1
  • Loading branch information
unknown-gd authored Jun 11, 2023
2 parents ddcb231 + 5720845 commit 807d578
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion lua/gpm/import.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ do
end

if autorun and not result.autorun then
logger:Debug( "[%s] Package '%s' autorun restricted.", sourceName, importPath )
logger:Debug( "Package '%s' autorun restricted.", importPath )
return
end

Expand Down
2 changes: 1 addition & 1 deletion lua/gpm/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MsgN( [[

module( "gpm", package.seeall )

_VERSION = 013300
_VERSION = 013301

if not Colors then
Realm = "unknown"
Expand Down
64 changes: 33 additions & 31 deletions lua/gpm/package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ do
if not environment2 then return false end

environment.Link( environment1, environment2 )
self:RemoveChild( child )
self:AddChild( child )
package2:RemoveChild( self )
package2:AddChild( self )

logger:Debug( "'%s' ---> '%s'", package2:GetIdentifier(), self:GetIdentifier() )
return true
Expand All @@ -285,7 +285,7 @@ do
if not environment2 then return false end

environment.UnLink( environment1, environment2 )
self:RemoveChild( child )
package2:RemoveChild( self )

logger:Debug( "'%s' -/-> '%s'", package2:GetIdentifier(), self:GetIdentifier() )
return true
Expand Down Expand Up @@ -338,79 +338,81 @@ do

local env = self:GetEnvironment()
if type( env ) == "table" then
for _, pkg in ipairs( self.Children ) do
for index, pkg in ipairs( self.Children ) do
if noDependencies then
logger:Error( "Package '%s' uninstallation failed, dependencies found, try use -f to force uninstallation, took %.4f seconds.", self:GetIdentifier(), SysTime() - stopwatch )
logger:Error( "Package '%s' uninstallation failed, %d dependencies found, try use -f to force uninstallation.", self:GetIdentifier(), #self.Children )
return
end

if pkg:IsInstalled() then
pkg:UnInstall()
pkg:UnLink( self )
end

self.Children[ index ] = nil
end

local libraries = self.Libraries

-- Hooks
local data = libraries.hook
if type( data ) == "table" then
for eventName, data in pairs( data ) do
local library = libraries.hook
if type( library ) == "table" then
for eventName, data in pairs( library ) do
for identifier in pairs( data ) do
hook.Remove( eventName, identifier )
data[ eventName ][ identifier ] = nil
library[ eventName ][ identifier ] = nil
end

data[ eventName ] = nil
library[ eventName ] = nil
end
end

-- Timers
data = libraries.timer
if type( data ) == "table" then
for identifier in pairs( data ) do
library = libraries.timer
if type( library ) == "table" then
for identifier in pairs( library ) do
timer.Remove( identifier )
data[ identifier ] = nil
library[ identifier ] = nil
end
end

-- ConVars
data = libraries.cvars
if type( data ) == "table" then
for name, cvar in pairs( data ) do
library = libraries.cvars
if type( library ) == "table" then
for name, cvar in pairs( library ) do
for identifier in pairs( cvar ) do
cvars.RemoveChangeCallback( name, identifier )
data[ name ][ identifier ] = nil
library[ name ][ identifier ] = nil
end

data[ name ] = nil
library[ name ] = nil
end
end

-- ConCommands
data = libraries.concommand
if type( data ) == "table" then
for name in pairs( data ) do
library = libraries.concommand
if type( library ) == "table" then
for name in pairs( library ) do
concommand.Remove( name )
data[ name ] = nil
library[ name ] = nil
end
end

-- Properties
data = libraries.properties
if type( data ) == "table" then
for name in pairs( data ) do
library = libraries.properties
if type( library ) == "table" then
for name in pairs( library ) do
properties.List[ name ] = nil
data[ name ] = nil
library[ name ] = nil
end
end

-- Network strings
data = libraries.net
if type( data ) == "table" then
for messageName in pairs( data ) do
library = libraries.net
if type( library ) == "table" then
for messageName in pairs( library ) do
net.Receivers[ messageName ] = nil
data[ messageName ] = nil
library[ messageName ] = nil
end
end
end
Expand Down

0 comments on commit 807d578

Please sign in to comment.