Skip to content

Instantly share code, notes, and snippets.

@SteVwonder
Last active November 1, 2018 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteVwonder/a66ea4a9760321d12e1d2997d265b5ba to your computer and use it in GitHub Desktop.
Save SteVwonder/a66ea4a9760321d12e1d2997d265b5ba to your computer and use it in GitHub Desktop.
#!/bin/bash
# checkout LGPL branch
if [[ "$(git rev-parse --abbrev-ref HEAD)" != "lgpl2_libflux" ]]; then
git checkout lgpl2_libflux
fi
# get all the files changing to LGPL
git diff --name-only upstream/master | grep 'src/common' > full_path_changed_to_lgpl.txt
# get all the headers included by the files changing to LGPL
cat full_path_changed_to_lgpl.txt | xargs grep '#include' | awk '{print $NF}' | sort -u > all_included_headers.txt
# convert full paths to just filenames for easier matching
cat full_path_changed_to_lgpl.txt | awk -F'/' '{print $NF}' | sort -u > changed_to_lgpl.txt
# check that all the included headers are LGPL themselves
grep -v -F -f changed_to_lgpl.txt all_included_headers.txt | sort -u | grep '".*"' | sed 's/src\///' | xargs -I {} find ./src -path ".*{}" | sort -u > headers_to_check_for_gpl.sh
# check if those headers are actually GPL rather than LGPL (or per-file license-less)
cat headers_to_check_for_gpl.sh | xargs grep -l "General Public License" | xargs grep -L "GNU Lesser"
./src/common/libflux/buffer_private.h
./src/common/libflux/ev_buffer_read.h
./src/common/libflux/ev_buffer_write.h
./src/common/libflux/tagpool.h
./src/common/libkvs/kvs_dir_private.h
./src/common/libkvs/kvs_txn_private.h
./src/common/libkvs/treeobj.h
./src/common/liboptparse/getopt.h
./src/common/liboptparse/getopt_int.h
./src/common/libpmi/clique.h
./src/common/libpmi/dgetline.h
./src/common/libpmi/keyval.h
./src/common/libpmi/pmi_strerror.h
./src/common/libpmi/simple_client.h
./src/common/libpmi/simple_server.h
./src/common/libpmi/single.h
./src/common/libpmi/wrap.h
./src/common/libsubprocess/local.h
./src/common/libsubprocess/remote.h
./src/common/libsubprocess/server.h
./src/common/libsubprocess/subprocess_private.h
./src/common/libsubprocess/util.h
./src/common/libutil/blobref.h
./src/common/libutil/cf.h
./src/common/libutil/cleanup.h
./src/common/libutil/cronodate.h
./src/common/libutil/dirwalk.h
./src/common/libutil/environment.h
./src/common/libutil/fdwalk.h
./src/common/libutil/fluid.h
./src/common/libutil/ipaddr.h
./src/common/libutil/kary.h
./src/common/libutil/log.h
./src/common/libutil/lru_cache.h
./src/common/libutil/mnemonic.h
./src/common/libutil/monotime.h
./src/common/libutil/nodeset.h
./src/common/libutil/oom.h
./src/common/libutil/popen2.h
./src/common/libutil/read_all.h
./src/common/libutil/setenvf.h
./src/common/libutil/sha1.h
./src/common/libutil/sha256.h
./src/common/libutil/stdlog.h
./src/common/libutil/timestamp.h
./src/common/libutil/tomltk.h
./src/common/libutil/tstat.h
./src/common/libutil/unlink_recursive.h
./src/common/libutil/veb.h
./src/common/libutil/wallclock.h
./src/common/libutil/xzmalloc.h
./src/common/libzio/zio.h
"blobref.h"
"buffer_private.h"
"cf.h"
"cleanup.h"
"clique.h"
"config.h"
"core/job.h"
"cronodate.h"
"dgetline.h"
"dirwalk.h"
"environment.h"
"ev_buffer_read.h"
"ev_buffer_write.h"
"fdwalk.h"
"fluid.h"
"getopt.h"
"getopt_int.h"
"ipaddr.h"
"kary.h"
"keyval.h"
"kvs_dir_private.h"
"kvs_txn_private.h"
"local.h"
"log.h"
"lru_cache.h"
"mnemonic.h"
"monotime.h"
"nodeset.h"
"oom.h"
"pmi_strerror.h"
"popen2.h"
"read_all.h"
"remote.h"
"server.h"
"setenvf.h"
"sha1.h"
"sha256.h"
"simple_client.h"
"simple_server.h"
"single.h"
"src/common/libev/ev.h"
"src/common/libtomlc99/toml.h"
"src/common/libutil/base64.h"
"src/common/libutil/blobref.h"
"src/common/libutil/dirwalk.h"
"src/common/libutil/ev_zmq.h"
"src/common/libutil/fdwalk.h"
"src/common/libutil/iterators.h"
"src/common/libutil/log.h"
"src/common/libutil/lru_cache.h"
"src/common/libutil/nodeset.h"
"src/common/libutil/oom.h"
"src/common/libutil/stdlog.h"
"src/common/libutil/veb.h"
"src/common/libutil/wallclock.h"
"src/common/libutil/xzmalloc.h"
"src/common/libzio/zio.h"
"stdlog.h"
"subprocess_private.h"
"tagpool.h"
"timestamp.h"
"tomltk.h"
"treeobj.h"
"tstat.h"
"unlink_recursive.h"
"util.h"
"veb.h"
"wallclock.h"
"wrap.h"
"xzmalloc.h"
"zio.h"
()
<argz.h>
<arpa/inet.h>
<assert.h>
<caliper/cali.h>
<cstdint>
<ctype.h>
<czmq.h>
<dirent.h>
<dlfcn.h>
<envz.h>
<errno.h>
<fcntl.h>
<fnmatch.h>
<getopt.h>
<glob.h>
<ifaddrs.h>
<iostream>
<jansson.h>
<libgen.h>
<limits.h>
<math.h>
<munge.h>
<netdb.h>
<poll.h>
<pthread.h>
<pwd.h>
<signal.h>
<stdarg.h>
<stdbool.h>
<stddef.h>
<stdexcept>
<stdint.h>
<stdio.h>
<stdlib.h>
<string.h>
<string>
<sys/epoll.h>
<sys/eventfd.h>
<sys/param.h>
<sys/socket.h>
<sys/stat.h>
<sys/syscall.h>
<sys/time.h>
<sys/wait.h>
<syslog.h>
<termios.h>
<time.h>
<unistd.h>
<unordered_map>
<wait.h>
<yaml-cpp/yaml.h>
<zmq.h>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment