Skip to content

Commit

Permalink
Copy template to install dir and modify permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Aug 5, 2023
1 parent 86ab7a9 commit 90f3fa9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
11 changes: 10 additions & 1 deletion diskimageprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,16 @@ def create_aspace_excel_sheet(args, sips, volumes, logger):
try:
shutil.copyfile(template_path, xlsx_path)
except OSError as err:
logger.error("Unable to copy ASpace template to destination")
logger.error(f"Unable to copy ASpace template to destination: {err}")

# Set ASpace file permissions
try:
os.chmod(
path,
stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH,
)
except OSError as err:
logger.error(f"Error setting permissions: {err}")

workbook = xlsxwriter.Workbook(xlsx_path, {"strings_to_numbers": True})
worksheet = workbook.get_worksheet_by_name("Data")
Expand Down
5 changes: 5 additions & 0 deletions install-bc2-ubuntu18.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ sudo cp LICENSE $dip_dir
sudo cp README.md $dip_dir
sudo cp -r disk_image_toolkit/ $dip_dir

if [ ! -d $dip_dir/aspace_template ]; then
sudo mkdir $dip_dir/aspace_template
fi
sudo cp aspace_template/aspace_import_template.xlsx $dip_dir/aspace_template

if [ ! -d $dip_dir/disk_image_toolkit/dfxml ]; then
sudo mkdir $dip_dir/disk_image_toolkit/dfxml/
fi
Expand Down
5 changes: 5 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ sudo cp LICENSE $dip_dir
sudo cp README.md $dip_dir
sudo cp -r disk_image_toolkit/ $dip_dir

if [ ! -d $dip_dir/aspace_template ]; then
sudo mkdir $dip_dir/aspace_template
fi
sudo cp aspace_template/aspace_import_template.xlsx $dip_dir/aspace_template

if [ ! -d $dip_dir/disk_image_toolkit/dfxml ]; then
sudo mkdir $dip_dir/disk_image_toolkit/dfxml/
fi
Expand Down
5 changes: 5 additions & 0 deletions test-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ sudo cp disk_image_toolkit/dfxml/dfxml.py /usr/share/ccatools/diskimageprocessor
sudo cp disk_image_toolkit/dfxml/objects.py /usr/share/ccatools/diskimageprocessor
sudo cp disk_image_toolkit/dfxml/walk_to_dfxml.py /usr/share/ccatools/diskimageprocessor

if [ ! -d /usr/share/ccatools/diskimageprocessor/aspace_template ]; then
sudo mkdir /usr/share/ccatools/diskimageprocessor/aspace_template
fi
sudo cp aspace_template/aspace_import_template.xlsx /usr/share/ccatools/diskimageprocessor/aspace_template

sudo cp disk_image_toolkit/dfxml/dfxml.py .
sudo cp disk_image_toolkit/dfxml/objects.py .
sudo cp disk_image_toolkit/dfxml/walk_to_dfxml.py .

0 comments on commit 90f3fa9

Please sign in to comment.