diff options
author | Andrzej Telszewski <atelszewski@gmail.com> | 2020-10-30 23:41:43 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-10-31 11:15:30 +0700 |
commit | fb9002e63441122eaf73f752622bc5fbef1eebf1 (patch) | |
tree | a9b12a33d71f7447a939be0dbbe0f7e0cf92fafb /misc | |
parent | 17e3d72d9d16e4eeadd8048f64b12e972384a35c (diff) |
misc/git-store-meta: Added (metadata storing and applying for Git)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/git-store-meta/README | 22 | ||||
-rw-r--r-- | misc/git-store-meta/change-name-in-git-hooks.patch | 21 | ||||
-rw-r--r-- | misc/git-store-meta/fix-storing-group-name.patch | 33 | ||||
-rw-r--r-- | misc/git-store-meta/git-store-meta.SlackBuild | 72 | ||||
-rw-r--r-- | misc/git-store-meta/git-store-meta.info | 10 | ||||
-rw-r--r-- | misc/git-store-meta/slack-desc | 19 |
6 files changed, 177 insertions, 0 deletions
diff --git a/misc/git-store-meta/README b/misc/git-store-meta/README new file mode 100644 index 000000000000..93b5e4870074 --- /dev/null +++ b/misc/git-store-meta/README @@ -0,0 +1,22 @@ +git-store-meta is a light-weight tool for file metadata storing and +applying for Git. + +Features: + +- Light dependency, cross-platform consistent behavior, + desirable performance. +- Data files are in plain text format and can be easily revisioned, + diffed, or manually modified as needed. +- Supported metadata: mtime, atime, mode, user, uid, group, gid, acl. +- Can store the metadata of git-revisioned files into a data file. +- Can apply the metadata stored in the data file to the working copy. +- Can update the metadata for changed files quickly. +- Can easily pick which metadata fields to store, update, or apply. +- Can determine whether to store, update, or apply directory metadata. + +Note: + + The binary is installed under the name "git-store-meta". Use it + instead of "git-store-meta.pl" when reading online docs or in Git + hooks. The `--install` switch already knows to use "git-store-meta" + and will create correct hooks without any further action required. diff --git a/misc/git-store-meta/change-name-in-git-hooks.patch b/misc/git-store-meta/change-name-in-git-hooks.patch new file mode 100644 index 000000000000..429d36c8772f --- /dev/null +++ b/misc/git-store-meta/change-name-in-git-hooks.patch @@ -0,0 +1,21 @@ +commit 95bce8afd6973b00232f3cb7cc286d3994a07a13 +Author: Andrzej Telszewski <atelszewski@gmail.com> +Date: Sat Oct 24 12:51:20 2020 +0200 + + Change how git-store-meta is called from Git hooks + + Call `git-store-meta` instead of `git-store-meta.pl`. + +diff --git a/git-store-meta.pl b/git-store-meta.pl +index ddc0024..b0d0d37 100755 +--- a/git-store-meta.pl ++++ b/git-store-meta.pl +@@ -600,7 +600,7 @@ sub install_hooks { + my $mask = umask; if (!defined($mask)) { $mask = 0022; } + my $mode = 0777 & ~$mask; + my $t; +- my $s = escapeshellarg($GIT_STORE_META_APP . ".pl"); ++ my $s = escapeshellarg($GIT_STORE_META_APP); + my $f = defined($argv{'target'}) ? " -t " . escapeshellarg($argv{'target'}) : ""; + my $f2 = escapeshellarg(defined($argv{'target'}) ? $argv{'target'} : $GIT_STORE_META_FILENAME); + diff --git a/misc/git-store-meta/fix-storing-group-name.patch b/misc/git-store-meta/fix-storing-group-name.patch new file mode 100644 index 000000000000..13bb8718c18f --- /dev/null +++ b/misc/git-store-meta/fix-storing-group-name.patch @@ -0,0 +1,33 @@ +commit e9a545ae7f45ea2b8b031457ffeeb7ec69cac41d +Author: Andrzej Telszewski <atelszewski@gmail.com> +Date: Sat Oct 24 12:27:13 2020 +0200 + + Fix that the 'group' name is not correctly stored + + Fix that the 'group' name is not correctly stored in '.git_store_meta'. + + The reason for the error is that `getpwuid()` is used instead of + `getgrgid()` when retreiving group information. + +diff --git a/git-store-meta.pl b/git-store-meta.pl +index ddc0024..c7ef50a 100755 +--- a/git-store-meta.pl ++++ b/git-store-meta.pl +@@ -473,7 +473,7 @@ sub getfacl_internal { + } + if (defined $acl{'group'}) { + foreach my $gid (keys %{$acl{'group'}}) { +- my $group = getpwuid($gid); ++ my $group = getgrgid($gid); + $group = defined($group) ? $group : $gid; + push(@results, "group:$group:" . getfacl_internal_getperms(\%{$acl{'group'}{$gid}})); + } +@@ -758,7 +758,7 @@ sub get_file_metadata { + my $user = getpwuid($uid); + push(@rec, $user || ""); + } elsif ($_ eq "group") { +- my $group = getpwuid($gid); ++ my $group = getgrgid($gid); + push(@rec, $group || ""); + } elsif ($_ eq "acl") { + push(@rec, &$getfacl($file)); diff --git a/misc/git-store-meta/git-store-meta.SlackBuild b/misc/git-store-meta/git-store-meta.SlackBuild new file mode 100644 index 000000000000..7df1e09f1192 --- /dev/null +++ b/misc/git-store-meta/git-store-meta.SlackBuild @@ -0,0 +1,72 @@ +#!/bin/sh + +# Slackware build script for git-store-meta + +# Copyright 2020 Andrzej Telszewski, Szczecin +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=git-store-meta +VERSION=${VERSION:-2.1.2} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +ARCH=noarch + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP + +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION + +chown -R root:root . +chmod -R a-st,u+rwX,go-w+rX . + +patch -p1 -i $CWD/fix-storing-group-name.patch +patch -p1 -i $CWD/change-name-in-git-hooks.patch + +mv $PRGNAM.pl ${PRGNAM} + +# Based on https://aur.archlinux.org/packages/git-store-meta/ + +sed -i $PRGNAM -e "s|$PRGNAM\.pl|$PRGNAM|g" +sed -i README.md -e "s|$PRGNAM\.pl|$PRGNAM|g" + +chmod 0755 $PRGNAM + +mkdir -p $PKG/usr/bin +cp $PRGNAM $PKG/usr/bin + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/misc/git-store-meta/git-store-meta.info b/misc/git-store-meta/git-store-meta.info new file mode 100644 index 000000000000..3ed5a7c00035 --- /dev/null +++ b/misc/git-store-meta/git-store-meta.info @@ -0,0 +1,10 @@ +PRGNAM="git-store-meta" +VERSION="2.1.2" +HOMEPAGE="https://github.com/danny0838/git-store-meta" +DOWNLOAD="https://github.com/danny0838/git-store-meta/archive/2.1.2/git-store-meta-2.1.2.tar.gz" +MD5SUM="1c7c55c15c19ca1b74a55a813a7a07a2" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Andrzej Telszewski" +EMAIL="atelszewski@gmail.com" diff --git a/misc/git-store-meta/slack-desc b/misc/git-store-meta/slack-desc new file mode 100644 index 000000000000..c1f02f6507a4 --- /dev/null +++ b/misc/git-store-meta/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +git-store-meta: git-store-meta (file metadata storing and applying for Git) +git-store-meta: +git-store-meta: git-store-meta is a light-weight tool for file metadata storing and +git-store-meta: applying for Git. +git-store-meta: +git-store-meta: Homepage: https://github.com/danny0838/git-store-meta +git-store-meta: +git-store-meta: +git-store-meta: +git-store-meta: +git-store-meta: |