This commit is contained in:
Jay Lee
2024-09-18 16:04:32 -04:00
6 changed files with 49 additions and 38 deletions

View File

@@ -58,7 +58,7 @@ jobs:
arch: aarch64 arch: aarch64
openssl_archs: linux-aarch64 openssl_archs: linux-aarch64
staticx: yes staticx: yes
- os: macos-12 - os: macos-13
jid: 6 jid: 6
goal: build goal: build
arch: x86_64 arch: x86_64
@@ -75,7 +75,7 @@ jobs:
openssl_archs: VC-WIN64A openssl_archs: VC-WIN64A
- os: ubuntu-22.04 - os: ubuntu-22.04
goal: test goal: test
python: "3.8" python: "3.13"
jid: 10 jid: 10
arch: x86_64 arch: x86_64
- os: ubuntu-22.04 - os: ubuntu-22.04
@@ -115,7 +115,7 @@ jobs:
with: with:
path: | path: |
cache.tar.xz cache.tar.xz
key: gam-${{ matrix.jid }}-20240916 key: gam-${{ matrix.jid }}-20240918
- name: Untar Cache archive - name: Untar Cache archive
if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true' if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true'
@@ -301,7 +301,8 @@ jobs:
- name: Rename GNU link on Windows - name: Rename GNU link on Windows
if: matrix.goal == 'build' && runner.os == 'Windows' && steps.cache-python-ssl.outputs.cache-hit != 'true' if: matrix.goal == 'build' && runner.os == 'Windows' && steps.cache-python-ssl.outputs.cache-hit != 'true'
shell: bash shell: bash
run: mv /usr/bin/link /usr/bin/gnulink run: |
mv -v /usr/bin/link /usr/bin/gnulink
- name: Make OpenSSL - name: Make OpenSSL
if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit != 'true' if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit != 'true'
@@ -319,7 +320,7 @@ jobs:
cd "${GITHUB_WORKSPACE}/src/openssl-${openssl_arch}" cd "${GITHUB_WORKSPACE}/src/openssl-${openssl_arch}"
# install_sw saves us ages processing man pages :-) # install_sw saves us ages processing man pages :-)
$MAKE install_sw $MAKE install_sw
mv "${OPENSSL_INSTALL_PATH}" "${GITHUB_WORKSPACE}/bin/ssl-${openssl_arch}" mv -v "${OPENSSL_INSTALL_PATH}" "${GITHUB_WORKSPACE}/bin/ssl-${openssl_arch}"
done done
mkdir -vp "${OPENSSL_INSTALL_PATH}/lib" mkdir -vp "${OPENSSL_INSTALL_PATH}/lib"
mkdir -vp "${OPENSSL_INSTALL_PATH}/bin" mkdir -vp "${OPENSSL_INSTALL_PATH}/bin"
@@ -530,8 +531,7 @@ jobs:
if: matrix.goal != 'test' if: matrix.goal != 'test'
run: | run: |
export distpath="./dist/gam" export distpath="./dist/gam"
export gampath="$distpath" mkdir -p -v "${distpath}"
mkdir -p -v "${gampath}"
if [[ "${RUNNER_OS}" == "macOS" ]]; then if [[ "${RUNNER_OS}" == "macOS" ]]; then
# Tell our gam.spec to use our code sign certificate # Tell our gam.spec to use our code sign certificate
export codesign_identity="Jay Lee" export codesign_identity="Jay Lee"
@@ -539,38 +539,39 @@ jobs:
# breaking our self-compiled version # breaking our self-compiled version
brew uninstall --ignore-dependencies openssl brew uninstall --ignore-dependencies openssl
export PYINSTALLER_BUILD_ONEDIR=yes export PYINSTALLER_BUILD_ONEDIR=yes
export gampath=$($PYTHON -c "import os; print(os.path.realpath('${gampath}/gam'))")
elif [[ "${RUNNER_OS}" == "Windows" ]]; then elif [[ "${RUNNER_OS}" == "Windows" ]]; then
# Work around issue where PyInstaller picks up python3.dll from other Python versions # Work around issue where PyInstaller picks up python3.dll from other Python versions
# https://github.com/pyinstaller/pyinstaller/issues/7102 # https://github.com/pyinstaller/pyinstaller/issues/7102
export PATH="$(dirname ${PYTHON}):/usr/bin" export PATH="$(dirname ${PYTHON}):/usr/bin"
export PYINSTALLER_BUILD_ONEDIR=no export PYINSTALLER_BUILD_ONEDIR=no
else elif [[ "${staticx}" != "yes" ]]; then
export gampath=$(realpath "${gampath}") export PYINSTALLER_BUILD_ONEDIR=yes
export PYINSTALLER_BUILD_ONEDIR=no
fi fi
export gam="${gampath}/gam"
echo "gampath=${gampath}" >> $GITHUB_ENV
"${PYTHON}" -m PyInstaller --clean --noconfirm --distpath="${distpath}" gam.spec "${PYTHON}" -m PyInstaller --clean --noconfirm --distpath="${distpath}" gam.spec
echo "dist results:" if [[ "$PYINSTALLER_BUILD_ONEDIR" == "yes" ]]; then
ls -alRF "$distpath" mv -v "${distpath}/gam" "${distpath}/gam7"
echo "WARNINGS FROM build/gam/warn-gam.txt" export gampath="${distpath}/gam7"
cat build/gam/warn-gam.txt
echo "Analysis FROM build/gam/Analysis-00.toc"
cat build/gam/Analysis-00.toc
echo "EXE data FROM build/gam/EXE-00.toc"
cat build/gam/EXE-00.toc
if [ -x "$(command -v realpath)" ]; then
realpath=realpath
else else
brew install coreutils mv -v "$distpath" "${distpath}7"
realpath=grealpath export gampath="${distpath}7"
fi fi
export gam=$(realpath "$gam") export gampath=$(realpath "$gampath")
echo "gampath ${gampath} results:"
ls -alRF "$gampath"
#echo "WARNINGS FROM build/gam/warn-gam.txt"
#cat build/gam/warn-gam.txt
#echo "Analysis FROM build/gam/Analysis-00.toc"
#cat build/gam/Analysis-00.toc
#echo "EXE data FROM build/gam/EXE-00.toc"
#cat build/gam/EXE-00.toc
export gam="${gampath}/gam"
if [[ "${RUNNER_OS}" == "Windows" ]]; then if [[ "${RUNNER_OS}" == "Windows" ]]; then
export gam=$(cygpath -w "$gam") export gam=$(cygpath -w "$gam")
echo "GAM on Windows at ${gam}" echo "GAM on Windows at ${gam}"
else
export gam=$(realpath "$gam")
fi fi
echo "gampath=${gampath}" >> $GITHUB_ENV
echo "gam=${gam}" >> $GITHUB_ENV echo "gam=${gam}" >> $GITHUB_ENV
echo -e "GAM: ${gam}\nGAMPATH: ${gampath}" echo -e "GAM: ${gam}\nGAMPATH: ${gampath}"
@@ -648,14 +649,14 @@ jobs:
GAM_ARCHIVE="gam-${GAMVERSION}-linux-$(arch)-${libver}.tar.xz" GAM_ARCHIVE="gam-${GAMVERSION}-linux-$(arch)-${libver}.tar.xz"
fi fi
echo "GAM Archive ${GAM_ARCHIVE}" echo "GAM Archive ${GAM_ARCHIVE}"
tar -C dist/ --create --verbose --exclude-from "${GITHUB_WORKSPACE}/.github/actions/package_exclusions.txt" --file $GAM_ARCHIVE --xz gam tar -C "${gampath}/.." --create --verbose --exclude-from "${GITHUB_WORKSPACE}/.github/actions/package_exclusions.txt" --file $GAM_ARCHIVE --xz gam7
- name: Windows package - name: Windows package
if: runner.os == 'Windows' && matrix.goal != 'test' if: runner.os == 'Windows' && matrix.goal != 'test'
run: | run: |
cd dist/ cd "${gampath}/.."
GAM_ARCHIVE="../gam-${GAMVERSION}-windows-${GAM_ARCHIVE_ARCH}.zip" GAM_ARCHIVE="../gam-${GAMVERSION}-windows-${GAM_ARCHIVE_ARCH}.zip"
/c/Program\ Files/7-Zip/7z.exe a -tzip $GAM_ARCHIVE gam "-xr@${GITHUB_WORKSPACE}/.github/actions/package_exclusions.txt" -bb3 /c/Program\ Files/7-Zip/7z.exe a -tzip $GAM_ARCHIVE gam7 "-xr@${GITHUB_WORKSPACE}/.github/actions/package_exclusions.txt" -bb3
cd .. cd ..
/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.14/bin/candle.exe -arch "${WIX_ARCH}" gam.wxs /c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.14/bin/candle.exe -arch "${WIX_ARCH}" gam.wxs
/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.14/bin/light.exe -ext /c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.14/bin/WixUIExtension.dll gam.wixobj -o "gam-${GAMVERSION}-windows-${GAM_ARCHIVE_ARCH}.msi" || true; /c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.14/bin/light.exe -ext /c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.14/bin/WixUIExtension.dll gam.wixobj -o "gam-${GAMVERSION}-windows-${GAM_ARCHIVE_ARCH}.msi" || true;

View File

@@ -8,6 +8,11 @@ where 7.00.02 MacOS builds usually took ~7 seconds to run "gam version", 7.00.03
MacOS builds are now signed by Jay's Apple Developer ID and notarized (scanned for malware) by Apple. This MacOS builds are now signed by Jay's Apple Developer ID and notarized (scanned for malware) by Apple. This
should resolve MacOS security warnings that need to be overridden when running GAM. should resolve MacOS security warnings that need to be overridden when running GAM.
Updated `gam delete ou` and `gam print admins` to handle the following error:
```
ERROR: 503: serviceNotAvailable - The service is currently unavailable.
```
7.00.02 7.00.02
Added option `showlastmodification` to `gam <UserTypeEntity> print|show filecounts` that adds Added option `showlastmodification` to `gam <UserTypeEntity> print|show filecounts` that adds

View File

@@ -21,7 +21,7 @@ EOF
} }
target_dir="$HOME/bin" target_dir="$HOME/bin"
target_gam="gam/gam" target_gam="gam7/gam"
gamarch=$(uname -m) gamarch=$(uname -m)
gamos=$(uname -s) gamos=$(uname -s)
osversion="" osversion=""

View File

@@ -37,12 +37,12 @@ a = Analysis(
cipher=None, cipher=None,
noarchive=False, noarchive=False,
) )
print(f"datas from analysis:\n{a.datas}") #print(f"datas from analysis:\n{a.datas}")
for d in a.datas: for d in a.datas:
if 'pyconfig' in d[0]: if 'pyconfig' in d[0]:
a.datas.remove(d) a.datas.remove(d)
break break
print(f"datas after pyconfig cleanup:\n{a.datas}") #print(f"datas after pyconfig cleanup:\n{a.datas}")
pyz = PYZ(a.pure, pyz = PYZ(a.pure,
a.zipped_data, a.zipped_data,
cipher=None) cipher=None)

View File

@@ -16623,13 +16623,15 @@ def doPrintShowAdmins():
try: try:
admins = callGAPIpages(cd.roleAssignments(), 'list', 'items', admins = callGAPIpages(cd.roleAssignments(), 'list', 'items',
pageMessage=getPageMessage(), pageMessage=getPageMessage(),
throwReasons=[GAPI.INVALID, GAPI.USER_NOT_FOUND, GAPI.BAD_REQUEST, throwReasons=[GAPI.INVALID, GAPI.USER_NOT_FOUND,
GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN], GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE,
GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND],
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
customer=GC.Values[GC.CUSTOMER_ID], fields=fields, **kwargs) customer=GC.Values[GC.CUSTOMER_ID], fields=fields, **kwargs)
except (GAPI.invalid, GAPI.userNotFound): except (GAPI.invalid, GAPI.userNotFound):
entityUnknownWarning(Ent.ADMINISTRATOR, userKey) entityUnknownWarning(Ent.ADMINISTRATOR, userKey)
return return
except GAPI.forbidden as e: except (GAPI.forbidden, GAPI.serviceNotAvailable) as e:
entityActionFailedExit([Ent.ADMINISTRATOR, userKey, Ent.ADMIN_ROLE, roleId], str(e)) entityActionFailedExit([Ent.ADMINISTRATOR, userKey, Ent.ADMIN_ROLE, roleId], str(e))
except (GAPI.badRequest, GAPI.customerNotFound): except (GAPI.badRequest, GAPI.customerNotFound):
accessErrorExit(cd) accessErrorExit(cd)
@@ -17334,14 +17336,17 @@ def _doDeleteOrgs(entityList):
try: try:
orgUnitPath = makeOrgUnitPathAbsolute(orgUnitPath) orgUnitPath = makeOrgUnitPathAbsolute(orgUnitPath)
callGAPI(cd.orgunits(), 'delete', callGAPI(cd.orgunits(), 'delete',
throwReasons=[GAPI.CONDITION_NOT_MET, GAPI.INVALID_ORGUNIT, GAPI.ORGUNIT_NOT_FOUND, GAPI.BACKEND_ERROR, GAPI.BAD_REQUEST, GAPI.INVALID_CUSTOMER_ID, GAPI.LOGIN_REQUIRED], throwReasons=[GAPI.CONDITION_NOT_MET, GAPI.INVALID_ORGUNIT, GAPI.ORGUNIT_NOT_FOUND, GAPI.BACKEND_ERROR,
GAPI.INVALID_CUSTOMER_ID, GAPI.SERVICE_NOT_AVAILABLE,
GAPI.BAD_REQUEST, GAPI.LOGIN_REQUIRED],
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
customerId=GC.Values[GC.CUSTOMER_ID], orgUnitPath=encodeOrgUnitPath(makeOrgUnitPathRelative(orgUnitPath))) customerId=GC.Values[GC.CUSTOMER_ID], orgUnitPath=encodeOrgUnitPath(makeOrgUnitPathRelative(orgUnitPath)))
entityActionPerformed([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], i, count) entityActionPerformed([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], i, count)
except GAPI.conditionNotMet: except GAPI.conditionNotMet:
entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], Msg.HAS_CHILD_ORGS.format(Ent.Plural(Ent.ORGANIZATIONAL_UNIT)), i, count) entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], Msg.HAS_CHILD_ORGS.format(Ent.Plural(Ent.ORGANIZATIONAL_UNIT)), i, count)
except (GAPI.invalidOrgunit, GAPI.orgunitNotFound, GAPI.backendError): except (GAPI.invalidOrgunit, GAPI.orgunitNotFound, GAPI.backendError):
entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], Msg.DOES_NOT_EXIST, i, count) entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], Msg.DOES_NOT_EXIST, i, count)
except GAPI.invalidCustomerId as e: except (GAPI.invalidCustomerId, GAPI.serviceNotAvailable) as e:
### Check for my_customer ### Check for my_customer
entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath, Ent.CUSTOMER_ID, GC.Values[GC.CUSTOMER_ID]], str(e), i, count) entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath, Ent.CUSTOMER_ID, GC.Values[GC.CUSTOMER_ID]], str(e), i, count)
except (GAPI.badRequest, GAPI.loginRequired): except (GAPI.badRequest, GAPI.loginRequired):

View File

@@ -13,10 +13,10 @@ keywords = google, oauth2, gsuite, google-apps, google-admin-sdk, google-drive,
classifiers = classifiers =
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
License :: OSI Approved :: Apache License License :: OSI Approved :: Apache License
[options] [options]