Search
j0ke.net Open Build Service
>
Projects
>
GFS
>
kernel-source
> split-into-symsets
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File split-into-symsets of Package kernel-source (Revision 81)
Currently displaying revision
81
,
show latest
#! /bin/bash usage() { echo "Usage: ${0##*/} {dir} < Module.symvers" exit $1 } [ $# -eq 1 ] || usage 1 dir=$1 tmpdir=$(mktemp -dt ${0##*/}.XXXXXXXXXX) trap "rm -rf $tmpdir" EXIT split_into_sets() { local dir=$1 awk ' { set = gensub(/\/[^\/]+$/, "", "", $3) sets[set] = sets[set] $0 "\n" } END { for (set in sets) { filename = gensub(/\//, "_", "g", set) printf "%s", sets[set] > dir "/" filename } } ' dir="$dir" } sort -k2 \ | split_into_sets "$tmpdir" shopt -s nullglob set -- $tmpdir/* if [ $# -ne 0 ]; then md5sum "$@" \ | while read md5sum set; do cp $set $dir/${set##*/}.${md5sum:0:16} done fi