johnmehr / gitup

A minimalist, dependency-free FreeBSD program to clone/pull Git repositories.
BSD 2-Clause "Simplified" License
50 stars 9 forks source link

Repair seems to cause excessive removals when there's a custom target #75

Closed grahamperrin closed 2 years ago

grahamperrin commented 2 years ago

Confirming the behaviour reported at https://forums.freebsd.org/posts/542233

  1. edit /usr/local/etc/gitup.conf for ports to target "/tmp/ports"
  2. gitup ports
  3. du -hs /tmp/ports
  4. result: 814 M
  5. gitup -r ports
  6. du -hs /tmp/ports
  7. result: 4.0 K
grahamperrin commented 2 years ago

Additional context for my case:

% pkg info -x gitup
gitup-0.96
% uname -aKU
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #115 main-n250650-ef396441ceb: Sat Nov 13 23:52:09 GMT 2021     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64 1400041 1400041
% cat /usr/local/etc/gitup.conf
# $FreeBSD$
#
# Default configuration options for gitup.conf.
{
        "defaults" : {
                "host"           : "git.freebsd.org",
                "port"           : 443,
                "verbosity"      : 1,
                "work_directory" : "/var/db/gitup",
        },

        "ports" : {
                "repository" : "/ports.git",
                "branch"     : "main",
                "target"     : "/usr/ports",
#               "target"     : "/tmp/ports",
                "ignores"    : [
                        "distfiles",
                        "packages",
                ],
        },

        "poudriere" : {
                "repository" : "/ports.git",
                "branch"     : "main",
                "target"     : "/usr/local/poudriere/ports/default",
                "ignores"    : [
                        "distfiles",
                        "packages",
                ],
        },

        "quarterly" : {
                "repository" : "/ports.git",
                "branch"     : "quarterly",
                "target"     : "/usr/ports",
                "ignores"    : [
                        "distfiles",
                        "packages",
                ]
        },

        "release" : {
                "repository" : "/src.git",
                "branch"     : "releng/11.4",
                "target"     : "/usr/src",
                "ignores"    : [
                        "sys/amd64/conf",
                        "sys/arm64/conf",
                        "sys/i386/conf",
                        "sys/pc98/conf",
                        "sys/powerpc/conf",
                        "sys/riscv/conf",
                        "sys/sparc64/conf",
                ]
        },

        "stable" : {
                "repository" : "/src.git",
                "branch"     : "stable/12",
                "target"     : "/usr/src",
                "ignores"    : [
                        "sys/amd64/conf",
                        "sys/arm64/conf",
                        "sys/i386/conf",
                        "sys/pc98/conf",
                        "sys/powerpc/conf",
                        "sys/riscv/conf",
                        "sys/sparc64/conf",
                ]
        },

        "current" : {
                "repository" : "/src.git",
                "branch"     : "main",
                "target"     : "/usr/src",
                "ignores"    : [
                        "sys/amd64/conf",
                        "sys/arm64/conf",
                        "sys/i386/conf",
                        "sys/pc98/conf",
                        "sys/powerpc/conf",
                        "sys/riscv/conf",
                        "sys/sparc64/conf",
                ]
        }
}
% 
johnmehr commented 2 years ago

Sorry about that! I just pushed out a fix. How does it look on your end?

grahamperrin commented 2 years ago

Thanks. Sorry, my mind always goes blank at points such as this, what's my mistake below?

% cd gitup
% ls -hl
total 1
-rw-r--r--  1 grahamperrin  grahamperrin   6.1K 24 Nov 23:40 gitup.1.in
-rw-r--r--  1 grahamperrin  grahamperrin    97K 24 Nov 23:40 gitup.c
-rw-r--r--  1 grahamperrin  grahamperrin   1.8K 24 Nov 23:40 gitup.conf
-rw-r--r--  1 grahamperrin  grahamperrin   4.6K 24 Nov 23:40 gitup.conf.5.in
-rw-r--r--  1 grahamperrin  grahamperrin   1.3K 24 Nov 23:40 LICENSE
-rw-r--r--  1 grahamperrin  grahamperrin   637B 24 Nov 23:40 Makefile
-rw-r--r--  1 grahamperrin  grahamperrin   414B 24 Nov 23:40 README.md
% make install
install  -s -o root -g wheel -m 555   gitup /gitup
install: gitup: No such file or directory
*** Error code 71

Stop.
make: stopped in /usr/home/grahamperrin/dev/gitup
% 
johnmehr commented 2 years ago

No worries! If you do a make instead of make install, you should be able to test it by running ./gitup

grahamperrin commented 2 years ago

At a glance: fixed; thank you.

…
 + /tmp/ports/x11/zenity/pkg-plist
#
# Please review the following file(s) for important changes.
#       /tmp/ports/UPDATING
#       /tmp/ports/mail/dspam/files/UPDATING
#
# Done.
% du -hs /tmp/ports
816M    /tmp/ports
% sudo ./gitup -r ports
grahamperrin's password:
# Scanning local repository...
# Host: git.freebsd.org
# Port: 443
# Repository Path: /ports.git
# Target Directory: /tmp/ports
# Have: c83cbdf5573e365ef37fb7d731ba52dfd6825977
# Want: c83cbdf5573e365ef37fb7d731ba52dfd6825977
# Branch: main
# Done.
% du -hs /tmp/ports
816M    /tmp/ports
% 
johnmehr commented 2 years ago

Thank you for letting me know about this!