add git-remote-annex stub and build machinery

Renamed git-remote-annex.sh, keeping it around for now for reference.

Sponsored-by: Graham Spencer on Patreon
This commit is contained in:
Joey Hess 2024-05-06 12:58:38 -04:00
parent 0be9f7a2c6
commit a01d64a4ad
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 32 additions and 3 deletions

View file

@ -224,6 +224,7 @@ installGitAnnex topdir = go (topdir </> "bin")
error "strip failed" error "strip failed"
createSymbolicLink "git-annex" (bindir </> "git-annex-shell") createSymbolicLink "git-annex" (bindir </> "git-annex-shell")
createSymbolicLink "git-annex" (bindir </> "git-remote-tor-annex") createSymbolicLink "git-annex" (bindir </> "git-remote-tor-annex")
createSymbolicLink "git-annex" (bindir </> "git-remote-annex")
main :: IO () main :: IO ()
main = getArgs >>= go main = getArgs >>= go

21
CmdLine/GitRemoteAnnex.hs Normal file
View file

@ -0,0 +1,21 @@
{- git-remote-annex program
-
- Copyright 2024 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
module CmdLine.GitRemoteAnnex where
import Common
import qualified Annex
import qualified Git.CurrentRepo
import Annex.UUID
import Annex.Action
run :: [String] -> IO ()
run (_remotename:address:[]) = forever $
getLine >>= \case
l -> giveup $ "gitremote-helpers protocol error at " ++ show l
run (_remotename:[]) = giveup "remote address not configured"
run _ = giveup "expected remote name and address parameters"

View file

@ -1,4 +1,4 @@
all=git-annex git-annex-shell mans docs all=git-annex git-annex-shell git-remote-annex mans docs
# set to "./Setup" if you lack a cabal program. Or can be set to "stack" # set to "./Setup" if you lack a cabal program. Or can be set to "stack"
BUILDER?=cabal BUILDER?=cabal
@ -70,6 +70,9 @@ git-annex: tmp/configure-stamp
git-annex-shell: git-annex git-annex-shell: git-annex
ln -sf git-annex git-annex-shell ln -sf git-annex git-annex-shell
git-remote-annex: git-annex
ln -sf git-annex git-remote-annex
# These are not built normally. # These are not built normally.
git-union-merge.1: doc/git-union-merge.mdwn git-union-merge.1: doc/git-union-merge.mdwn
./Build/mdwn2man git-union-merge 1 doc/git-union-merge.mdwn > git-union-merge.1 ./Build/mdwn2man git-union-merge 1 doc/git-union-merge.mdwn > git-union-merge.1
@ -90,6 +93,7 @@ install-bins: build
install -d $(DESTDIR)$(PREFIX)/bin install -d $(DESTDIR)$(PREFIX)/bin
install git-annex $(DESTDIR)$(PREFIX)/bin install git-annex $(DESTDIR)$(PREFIX)/bin
ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-annex-shell ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-annex-shell
ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-remote-annex
ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-remote-tor-annex ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-remote-tor-annex
install-desktop: build Build/InstallDesktopFile install-desktop: build Build/InstallDesktopFile
@ -141,7 +145,7 @@ clean:
doc/.ikiwiki html dist tags Build/SysConfig Build/Version \ doc/.ikiwiki html dist tags Build/SysConfig Build/Version \
Setup Build/InstallDesktopFile Build/Standalone \ Setup Build/InstallDesktopFile Build/Standalone \
Build/DistributionUpdate Build/BuildVersion Build/MakeMans \ Build/DistributionUpdate Build/BuildVersion Build/MakeMans \
git-annex-shell git-union-merge .tasty-rerun-log git-annex-shell git-remote-annex git-union-merge .tasty-rerun-log
find . -name \*.o -exec rm {} \; find . -name \*.o -exec rm {} \;
find . -name \*.hi -exec rm {} \; find . -name \*.hi -exec rm {} \;

View file

@ -606,6 +606,7 @@ Executable git-annex
CmdLine.GitAnnexShell.Fields CmdLine.GitAnnexShell.Fields
CmdLine.AnnexSetter CmdLine.AnnexSetter
CmdLine.Option CmdLine.Option
CmdLine.GitRemoteAnnex
CmdLine.GitRemoteTorAnnex CmdLine.GitRemoteTorAnnex
CmdLine.Seek CmdLine.Seek
CmdLine.Usage CmdLine.Usage

View file

@ -1,6 +1,6 @@
{- git-annex main program dispatch {- git-annex main program dispatch
- -
- Copyright 2010-2016 Joey Hess <id@joeyh.name> - Copyright 2010-2024 Joey Hess <id@joeyh.name>
- -
- Licensed under the GNU AGPL version 3 or higher. - Licensed under the GNU AGPL version 3 or higher.
-} -}
@ -13,6 +13,7 @@ import Network.Socket (withSocketsDo)
import qualified CmdLine.GitAnnex import qualified CmdLine.GitAnnex
import qualified CmdLine.GitAnnexShell import qualified CmdLine.GitAnnexShell
import qualified CmdLine.GitRemoteAnnex
import qualified CmdLine.GitRemoteTorAnnex import qualified CmdLine.GitRemoteTorAnnex
import qualified Test import qualified Test
import qualified Benchmark import qualified Benchmark
@ -35,6 +36,7 @@ main = sanitizeTopLevelExceptionMessages $ withSocketsDo $ do
where where
run ps n = case takeFileName n of run ps n = case takeFileName n of
"git-annex-shell" -> CmdLine.GitAnnexShell.run ps "git-annex-shell" -> CmdLine.GitAnnexShell.run ps
"git-remote-annex" -> CmdLine.GitRemoteAnnex.run ps
"git-remote-tor-annex" -> CmdLine.GitRemoteTorAnnex.run ps "git-remote-tor-annex" -> CmdLine.GitRemoteTorAnnex.run ps
_ -> CmdLine.GitAnnex.run Test.optParser Test.runner Benchmark.mkGenerator ps _ -> CmdLine.GitAnnex.run Test.optParser Test.runner Benchmark.mkGenerator ps