The previous variant was nice and sleek. But unfortunately, there are
constructs like:
#if 0
(... old code ...)
#else
(... alternative code for elogind ...)
#endif // 0
These fragments couldn't be handled by the old code, but can by the
new one.
To make this work, the precompiler macros must be set like shown above.
Apart from that, all lines like:
/// Any doxygen one-line-comments with elogind in it are removed
are removed, too. Please note the three slashes.
And finally, all commented out #include directives are removed as well.
- git archive --format=tar --prefix=elogind-$(VERSION)-raw/ HEAD | \
- (cd /var/tmp/ && tar xf -) ; \
- (cd /var/tmp && rm -rf elogind-$(VERSION) && $(MKDIR_P) elogind-$(VERSION) && \
+ $(AM_V_at)git archive --format=tar --prefix=elogind-$(VERSION)-raw/ HEAD | \
+ (cd /var/tmp/ && tar xf -)
+ $(AM_V_GEN)(cd /var/tmp && rm -rf elogind-$(VERSION) && $(MKDIR_P) elogind-$(VERSION) && \
for f in `find elogind-$(VERSION)-raw/ -type f | cut -d '/' -f 2-` ; do \
for f in `find elogind-$(VERSION)-raw/ -type f | cut -d '/' -f 2-` ; do \
- $(MKDIR_P) elogind-$(VERSION)/`dirname $$f` ; \
- $(AWK) '/^#if 0\s*$$/,/^#endif\s+\/\/\s+0\s*$$/{next}{print}' \
- elogind-$(VERSION)-raw/$$f \
- | $(SED) -e '/^\/\/\/ .*elogind.*$$/d' \
- -e '/^\/\/ #include.*$$/d' > elogind-$(VERSION)/$$f ; \
+ $(MKDIR_P) elogind-$(VERSION)/`dirname $$f` ; \
+ $(AWK) 'BEGIN { i=0;e=0 } \
+ /^#if\s+0\s*$$/ { i=1;next } \
+ /^#else\s*$$/ { \
+ { if ( i==1 ) e=1; else print }{next} \
+ } \
+ /^#endif\s*\/\/\s*0\s*$$/ { \
+ { if ( i==1 ) { i=0;e=0 } else print }{next} \
+ } \
+ /^\s*\/\/\/.*elogind.*$$/{ next } \
+ /^\s*\/\/\s*#include.+$$/{ next } \
+ { if ( (i==0) || (e==1) ) print }' \
+ elogind-$(VERSION)-raw/$$f \
+ > elogind-$(VERSION)/$$f ; \
+ chmod `stat -c '%a' elogind-$(VERSION)-raw/$$f` \
+ elogind-$(VERSION)/$$f ; \
done ; \
for l in `find elogind-$(VERSION)-raw/ -type l | cut -d '/' -f 2-` ; do \
$(MKDIR_P) elogind-$(VERSION)/`dirname $$l` ; \
done ; \
for l in `find elogind-$(VERSION)-raw/ -type l | cut -d '/' -f 2-` ; do \
$(MKDIR_P) elogind-$(VERSION)/`dirname $$l` ; \
done ; \
tar czf elogind-$(VERSION).tar.gz elogind-$(VERSION) ; \
rm -rf elogind-$(VERSION) elogind-$(VERSION)-raw) ; \
done ; \
tar czf elogind-$(VERSION).tar.gz elogind-$(VERSION) ; \
rm -rf elogind-$(VERSION) elogind-$(VERSION)-raw) ; \
- mv /var/tmp/elogind-$(VERSION).tar.gz ./
+ $(AM_V_at)mv /var/tmp/elogind-$(VERSION).tar.gz ./
.PHONY: install-tree
install-tree: all
.PHONY: install-tree
install-tree: all
else if (F_TYPE_EQUAL(fs.f_type, TMPFS_MAGIC))
#else
if (F_TYPE_EQUAL(fs.f_type, TMPFS_MAGIC))
else if (F_TYPE_EQUAL(fs.f_type, TMPFS_MAGIC))
#else
if (F_TYPE_EQUAL(fs.f_type, TMPFS_MAGIC))
unified_cache = false;
else
return -ENOEXEC;
unified_cache = false;
else
return -ENOEXEC;
/* If dbus isn't running or responding, there is nothing
* we can do about it. */
log_debug_errno(r, "Failed to open system bus: %m");
/* If dbus isn't running or responding, there is nothing
* we can do about it. */
log_debug_errno(r, "Failed to open system bus: %m");
log_debug_errno(r, "Failed to send signal message on private connection: %m");
#else
log_debug_errno(r, "Failed to send signal message: %m");
log_debug_errno(r, "Failed to send signal message on private connection: %m");
#else
log_debug_errno(r, "Failed to send signal message: %m");
#else
return log_error_errno(EOPNOTSUPP, "Unified cgroup hierarchy not supported: %m");
#else
return log_error_errno(EOPNOTSUPP, "Unified cgroup hierarchy not supported: %m");
} else if (m->running_as == MANAGER_SYSTEM) {
/* On the legacy hierarchy we only get
* notifications via cgroup agents. (Which
} else if (m->running_as == MANAGER_SYSTEM) {
/* On the legacy hierarchy we only get
* notifications via cgroup agents. (Which
#if 0
{ "lines", required_argument, NULL, 'n' },
{ "output", required_argument, NULL, 'o' },
#if 0
{ "lines", required_argument, NULL, 'n' },
{ "output", required_argument, NULL, 'o' },
{ "ignore-inhibitors", no_argument, NULL, 'i' },
{}
};
{ "ignore-inhibitors", no_argument, NULL, 'i' },
{}
};
_cleanup_free_ char *unit = NULL;
#else
_cleanup_free_ char *session_name = NULL;
_cleanup_free_ char *unit = NULL;
#else
_cleanup_free_ char *session_name = NULL;
s = hashmap_get(m->sessions, session_name);
log_debug_elogind("Session Name \"%s\" -> Session \"%s\"",
session_name, s && s->id ? s->id : "NULL");
s = hashmap_get(m->sessions, session_name);
log_debug_elogind("Session Name \"%s\" -> Session \"%s\"",
session_name, s && s->id ? s->id : "NULL");
User *u;
#else
Session *s;
User *u;
#else
Session *s;