Compare commits
No commits in common. "main" and "fix-3-bugs" have entirely different histories.
main
...
fix-3-bugs
24
CHANGELOG.md
24
CHANGELOG.md
|
@ -5,30 +5,6 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.1.1] - 2025-07-29
|
||||
|
||||
### Fixed
|
||||
|
||||
- Correctly decode hivexregedit UTF-16LE output
|
||||
|
||||
## [1.1.0] - 2025-07-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Have CrearImagenGit not receive the "tag" parameter
|
||||
|
||||
## [1.0.3] - 2025-07-24
|
||||
|
||||
### Fixed
|
||||
|
||||
- Have GetGitData deal with the fact that .git may be a regular file
|
||||
|
||||
## [1.0.2] - 2025-07-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Write listSoftwareInfo errors in the log
|
||||
|
||||
## [1.0.1] - 2025-07-23
|
||||
|
||||
### Fixed
|
||||
|
|
|
@ -4,6 +4,7 @@ import resource
|
|||
import logging
|
||||
|
||||
|
||||
import NetLib
|
||||
import ogGlobals
|
||||
import SystemLib
|
||||
import DiskLib
|
||||
|
@ -34,7 +35,7 @@ class OgLogger(logging.StreamHandler):
|
|||
|
||||
|
||||
|
||||
def create_image(disk_num, partition_num, repo, image_name):
|
||||
def create_image(disk_num, partition_num, repo, image_name, tagName):
|
||||
|
||||
ntfs_impl = NTFSImplementation.NTFS3G
|
||||
og_git = OpengnsysGitLibrary(ntfs_implementation = ntfs_impl)
|
||||
|
@ -43,6 +44,8 @@ def create_image(disk_num, partition_num, repo, image_name):
|
|||
device = DiskLib.ogDiskToDev(disk_num, partition_num)
|
||||
if og_git.initRepo(device, image_name):
|
||||
return 0
|
||||
#if tagName:
|
||||
# og_git.tag(device = device, tagName = tagName, commit = "HEAD", message = "Image created")
|
||||
else:
|
||||
return 1
|
||||
|
||||
|
@ -60,13 +63,14 @@ def main():
|
|||
|
||||
|
||||
|
||||
if len(sys.argv) < 5:
|
||||
sys.exit(SystemLib.ogRaiseError([], ogGlobals.OG_ERR_FORMAT, "Incorrect number of arguments. Usage: CrearImagenGit disk_num partition_num image_name repo"))
|
||||
if len(sys.argv) != 6:
|
||||
sys.exit(SystemLib.ogRaiseError([], ogGlobals.OG_ERR_FORMAT, "Incorrect number of arguments. Usage: CrearImagenGit disk_num partition_num image_name repo tag"))
|
||||
|
||||
# repo - repositorio, ip address. Opcional porque oglive lo recibe como parametro de kernel
|
||||
# tag - tag a crear automaticamente. Opcional, no necesitamos crear un tag siempre.
|
||||
|
||||
|
||||
disk_num, partition_num, image_name, repo = sys.argv[1:5]
|
||||
disk_num, partition_num, image_name, repo, tag = sys.argv[1:6]
|
||||
|
||||
|
||||
opengnsys_log_dir = "/opt/opengnsys/log"
|
||||
|
@ -92,7 +96,7 @@ def main():
|
|||
logger.info("Starting CrearImagenGit")
|
||||
|
||||
|
||||
retval = create_image(disk_num, partition_num, repo, image_name)
|
||||
retval = create_image(disk_num, partition_num, repo, image_name, tag)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ ogEcho (['log', 'session'], None, f'{ogGlobals.lang.MSG_INTERFACE_START} {prog}
|
|||
mntpt = ogMount (dsk, par)
|
||||
git_dir = f'{mntpt}/.git'
|
||||
|
||||
if not os.path.exists (git_dir):
|
||||
ogRaiseError (['log', 'session'], ogGlobals.OG_ERR_FORMAT, f'"{git_dir}" no existe')
|
||||
if not os.path.isdir (git_dir):
|
||||
ogRaiseError (['log', 'session'], ogGlobals.OG_ERR_FORMAT, f'"{git_dir}" no existe o no es un directorio')
|
||||
sys.exit (1)
|
||||
|
||||
p = subprocess.run (['git', '--git-dir', git_dir, 'branch', '--show-current'], capture_output=True, text=True)
|
||||
|
|
|
@ -27,18 +27,12 @@ if __name__ == "__main__":
|
|||
# Registro de inicio de ejecución
|
||||
ogEcho (['log', 'session'], None, f'{ogGlobals.lang.MSG_INTERFACE_START} {prog} {disk} {par} {dest_file}')
|
||||
|
||||
p = subprocess.run ([f'{ogGlobals.OGSCRIPTS}/listSoftwareInfo', disk, par], capture_output=True, text=True)
|
||||
listsi_out = p.stdout
|
||||
listsi_err = p.stderr
|
||||
listsi_out = subprocess.run ([f'{ogGlobals.OGSCRIPTS}/listSoftwareInfo', disk, par], capture_output=True, text=True).stdout
|
||||
if listsi_out:
|
||||
file = listsi_out.splitlines()[0]
|
||||
else:
|
||||
if listsi_err:
|
||||
ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, listsi_err)
|
||||
sys.exit (1)
|
||||
else:
|
||||
ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, 'listSoftwareInfo failed')
|
||||
sys.exit (1)
|
||||
ogRaiseError ([], ogGlobals.OG_ERR_GENERIC, 'listSoftwareInfo failed')
|
||||
sys.exit (1)
|
||||
|
||||
shutil.copy (file, dest_file)
|
||||
|
||||
|
|
|
@ -266,8 +266,8 @@ def ogListSoftware (disk, par):
|
|||
if shutil.which ('hivexregedit'):
|
||||
hive = RegistryLib.ogGetHivePath (mntdir, 'software')
|
||||
if hive:
|
||||
cmd1_out = subprocess.run (['hivexregedit', '--unsafe-printable-strings', '--export', hive, r'\Microsoft\Windows\CurrentVersion\Uninstall'], capture_output=True, text=True, encoding='utf-16le').stdout
|
||||
cmd1_out += subprocess.run (['hivexregedit', '--unsafe-printable-strings', '--export', hive, r'\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'], capture_output=True, text=True, encoding='utf-16le').stdout
|
||||
cmd1_out = subprocess.run (['hivexregedit', '--unsafe-printable-strings', '--export', hive, r'\Microsoft\Windows\CurrentVersion\Uninstall'], capture_output=True, text=True).stdout
|
||||
cmd1_out += subprocess.run (['hivexregedit', '--unsafe-printable-strings', '--export', hive, r'\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'], capture_output=True, text=True).stdout
|
||||
out = name = ''
|
||||
for l in cmd1_out.splitlines():
|
||||
words = l.split ('"')
|
||||
|
|
|
@ -160,7 +160,7 @@ def ogGetIpAddress():
|
|||
addrs = e['addr_info']
|
||||
for a in addrs:
|
||||
if 'inet' != a['family']: continue
|
||||
addresses.append (a['local'])
|
||||
addresses.append ({ 'local': a['local'], 'prefixlen': a['prefixlen'] })
|
||||
|
||||
if 1 != len (addresses):
|
||||
raise Exception ('more than one local IP address found')
|
||||
|
|
Loading…
Reference in New Issue