mirror of
https://github.com/Ponce/slackbuilds
synced 2024-10-01 06:32:51 +02:00
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>
This commit is contained in:
parent
17e3d72d9d
commit
fb9002e634
6 changed files with 177 additions and 0 deletions
22
misc/git-store-meta/README
Normal file
22
misc/git-store-meta/README
Normal file
|
@ -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.
|
21
misc/git-store-meta/change-name-in-git-hooks.patch
Normal file
21
misc/git-store-meta/change-name-in-git-hooks.patch
Normal file
|
@ -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);
|
||||
|
33
misc/git-store-meta/fix-storing-group-name.patch
Normal file
33
misc/git-store-meta/fix-storing-group-name.patch
Normal file
|
@ -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));
|
72
misc/git-store-meta/git-store-meta.SlackBuild
Normal file
72
misc/git-store-meta/git-store-meta.SlackBuild
Normal file
|
@ -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}
|
10
misc/git-store-meta/git-store-meta.info
Normal file
10
misc/git-store-meta/git-store-meta.info
Normal file
|
@ -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"
|
19
misc/git-store-meta/slack-desc
Normal file
19
misc/git-store-meta/slack-desc
Normal file
|
@ -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:
|
Loading…
Reference in a new issue