Browse Source

Config hash define fix, ENGINE-885 function for commit hash, and fix for semicolon in codegen from Release_2.1

IOSAD-201
Krista Bennett 9 months ago
committed by Andreas Buff
parent
commit
4c6efbdc21
9 changed files with 21 additions and 17 deletions
  1. +1
    -3
      scripts/git/post-checkout
  2. +1
    -3
      scripts/git/post-commit
  3. +1
    -3
      scripts/git/post-merge-commit
  4. +1
    -4
      scripts/git/pre-commit
  5. +1
    -1
      src/Makefile
  6. +4
    -0
      src/pEpEngine.c
  7. +9
    -0
      src/pEpEngine.h
  8. +2
    -2
      sync/gen_statemachine.ysl2
  9. +1
    -1
      templates/commit_hash.h

+ 1
- 3
scripts/git/post-checkout View File

@ -2,7 +2,5 @@
# Commit hash header file - if we don't run this, it won't build.
commit_hash="$(git rev-parse HEAD)"
if test -f "templates/commit_hash.h"; then
sed "s/\(PEP_CURRENT_COMMIT_HASH\ =\).*/\1\"$commit_hash\"/" templates/commit_hash.h > src/commit_hash.h
fi
sed "s/\(PEP_CURRENT_COMMIT_HASH\ \).*/\1\"$commit_hash\"/" templates/commit_hash.h > src/commit_hash.h

+ 1
- 3
scripts/git/post-commit View File

@ -2,7 +2,5 @@
# Commit hash header file - if we don't run this, it won't build.
commit_hash="$(git rev-parse HEAD)"
if test -f "templates/commit_hash.h"; then
sed "s/\(PEP_CURRENT_COMMIT_HASH\ =\).*/\1\"$commit_hash\"/" templates/commit_hash.h > src/commit_hash.h
fi
sed "s/\(PEP_CURRENT_COMMIT_HASH\ \).*/\1\"$commit_hash\"/" templates/commit_hash.h > src/commit_hash.h

+ 1
- 3
scripts/git/post-merge-commit View File

@ -2,7 +2,5 @@
# Commit hash header file - if we don't run this, it won't build.
commit_hash="$(git rev-parse HEAD)"
if test -f "templates/commit_hash.h"; then
sed "s/\(PEP_CURRENT_COMMIT_HASH\ =\).*/\1\"$commit_hash\"/" templates/commit_hash.h > src/commit_hash.h
fi
sed "s/\(PEP_CURRENT_COMMIT_HASH\ \).*/\1\"$commit_hash\"/" templates/commit_hash.h > src/commit_hash.h

+ 1
- 4
scripts/git/pre-commit View File

@ -1,6 +1,3 @@
#! /bin/sh
if test -f "src/commit_hash.h"; then
rm src/commit_hash.h
fi
rm src/commit_hash.h

+ 1
- 1
src/Makefile View File

@ -94,7 +94,7 @@ commit_hash.h:
ifeq (,$(COMMIT_HASH))
$(shell cp ../templates/commit_hash.h commit_hash.h)
else
sed "s/\(PEP_CURRENT_COMMIT_HASH\ =\).*/\1\"$(COMMIT_HASH)\"/" ../templates/commit_hash.h > commit_hash.h
sed "s/\(PEP_CURRENT_COMMIT_HASH\ \).*/\1\"$(COMMIT_HASH)\"/" ../templates/commit_hash.h > commit_hash.h
endif
objects: $(ALL_OBJECTS) commit_hash.h


+ 4
- 0
src/pEpEngine.c View File

@ -225,6 +225,10 @@ DYNAMIC_API void config_service_log(PEP_SESSION session, bool enable)
session->service_log = enable;
}
DYNAMIC_API const char* get_commit_hash() {
return PEP_CURRENT_COMMIT_HASH;
}
DYNAMIC_API PEP_STATUS log_event(
PEP_SESSION session,
const char *title,


+ 9
- 0
src/pEpEngine.h View File

@ -526,6 +526,15 @@ DYNAMIC_API PEP_STATUS encrypt_and_sign(
DYNAMIC_API PEP_STATUS probe_encrypt(PEP_SESSION session, const char *fpr);
/**
* <!-- get_commit_hash() -->
*
* @brief Get the commit hash of this build
*
* @retval commit_hash string constant referring to the commit hash
*
*/
DYNAMIC_API const char* get_commit_hash();
/**
* <!-- set_debug_color() -->


+ 2
- 2
sync/gen_statemachine.ysl2 View File

@ -1075,7 +1075,7 @@ tstylesheet {
);
if (status) {
free(_data);
if (status == PEP_OUT_OF_MEMORY);
if (status == PEP_OUT_OF_MEMORY)
goto the_end;
continue;
}
@ -1083,7 +1083,7 @@ tstylesheet {
status = try_encrypt_message(session, _m, NULL, &m, PEP_enc_PEP, 0);
if (status) {
status = PEP_«yml:ucase(@name)»_CANNOT_ENCRYPT;
if (status == PEP_OUT_OF_MEMORY);
if (status == PEP_OUT_OF_MEMORY)
goto the_end;
continue;
}


+ 1
- 1
templates/commit_hash.h View File

@ -1,7 +1,7 @@
#ifndef COMMIT_HASH_H
#define COMMIT_HASH_H
#define PEP_CURRENT_COMMIT_HASH = "DUMMY_COMMIT_HASH_ERROR"
#define PEP_CURRENT_COMMIT_HASH "DUMMY_COMMIT_HASH_ERROR"
#endif

Loading…
Cancel
Save