| |
@@ -427,7 +427,10 @@
|
| |
stdin = stdin.encode("utf-8")
|
| |
|
| |
if debug:
|
| |
- print("Running legacy hooks with args: %s, stdin: %s" % (args, stdin))
|
| |
+ print(
|
| |
+ "Running legacy hooks (if any) with args: %s, stdin: %s"
|
| |
+ % (args, stdin)
|
| |
+ )
|
| |
|
| |
for hook in os.listdir(hookdir):
|
| |
# This is for legacy hooks, which create symlinks in the form of
|
| |
@@ -435,10 +438,13 @@
|
| |
if hook.startswith(hooktype + "."):
|
| |
hookfile = os.path.join(hookdir, hook)
|
| |
|
| |
- # Determine if this is an actual hook, or if it's a remnant
|
| |
- # from a hook that was installed before it was moved to the
|
| |
- # runner system.
|
| |
- if os.path.realpath(hookfile) == pagure.lib.query.HOOK_DNE_TARGET:
|
| |
+ # By-pass all the old hooks that pagure may have created before
|
| |
+ # moving to the runner architecture
|
| |
+ if hook in pagure.lib.query.ORIGINAL_PAGURE_HOOK:
|
| |
+ continue
|
| |
+
|
| |
+ if hook.endswith(".sample"):
|
| |
+ # Ignore the samples that Git inserts
|
| |
continue
|
| |
|
| |
# Execute
|
| |
When we moved to the runner architecture, we changed the way hooks are
called. During this move, we changed all of our existing hooks into
non-existing symlinks pointing to '/does/not/exists' and we were checking
if the files on disk were matching this target or not.
This created a few issue when releasing pagure:
- python setup.py sdist resolve symlinks as part of the archive creation
process
Reported in https://pagure.io/pagure/issue/3782
- Building pagure failed on some system because these symlinks does not
exist
Reported in https://pagure.io/pagure/issue/3706
So in this commit we are dropping the use of symlink and just making
pagure ignore all the hook it could have created.
Fixes https://pagure.io/pagure/issue/3782
Fixes https://pagure.io/pagure/issue/3706
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr