Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pcy
sspt
Commits
690e412f
Commit
690e412f
authored
Jul 25, 2017
by
PoroCYon
Browse files
added optional package naming
parent
da4c9a8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
.sspt
View file @
690e412f
...
...
@@ -7,23 +7,3 @@ sspt_version() {
sspt_prettyver() {
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
sspt_config() {
true
}
sspt_build() {
true
}
sspt_install() {
local instdir="$HOME/.local"
install -D -t "$instdir/bin/" "local/bin/sspt"
install -D -t "$instdir/libexec/sspt/" \
local/libexec/sspt/sspt-{autogen,bin-db,build,clean,clean-config,configure,edit,install,list,orphanize,pkgcmd,pull,purge,src-db,strace,uninstall,update}
}
sspt_clean() {
true
}
sspt_clean_config() {
true
}
local/libexec/sspt/sspt-pull
View file @
690e412f
...
...
@@ -6,7 +6,7 @@ Pull the source code of a package from a remote location.
Usage: sspt pull [-h|-?|--help]
Print this help text and exit.
- sspt pull {-n|--no-autogen} {-f|--force-autogen} {-e|--edit}
{-b|--build} {-i|--install} {--<vcs>} <repo url>
{-b|--build} {-i|--install} {--<vcs>} <repo url>
{<name>}
Add the repo to the database and download the source code.
Optionally, the VCS type, whether to autogenerate the
.sspt file (-n, -f, defaults to generate if none exists),
...
...
@@ -24,6 +24,9 @@ PKG_NAME=
pull_with_vcs
()
{
PKG_NAME
=
"
$(
basename
"
$2
"
)
"
if
!
[
-z
"
$3
"
]
;
then
PKG_NAME
=
"
$3
"
fi
if
[
"
$1
"
==
"git"
]
&&
[[
"
$PKG_NAME
"
==
*
".git"
]]
;
then
PKG_NAME
=
${
PKG_NAME
%.*
}
...
...
@@ -132,31 +135,31 @@ main() {
pull_with_vcs
"
${
1
:2
}
"
"
$2
"
;;
"git"
*
|
*
".git"
|
*
"github"
*
|
*
"gitlab"
*
|
*
"git.savannah"
*
|
*
"gogs"
*
|
"://git."
*
|
":git."
*
)
pull_with_vcs git
"
$1
"
pull_with_vcs git
"
$1
"
"
$2
"
;;
"hg"
*
|
*
"hg.savannah"
*
|
"://hg."
*
|
"://mercurial."
*
|
":hg."
*
|
":mercurial."
*
)
pull_with_vcs hg
"
$1
"
pull_with_vcs hg
"
$1
"
"
$2
"
;;
"svn"
*
|
*
"svn.savannah"
*
|
"://svn."
*
|
":svn."
*
)
pull_with_vcs svn
"
$1
"
pull_with_vcs svn
"
$1
"
"
$2
"
;;
"cvs"
*
|
*
"cvs.savannah"
*
|
"://cvs."
*
|
":cvs."
*
)
pull_with_vcs cvs
"
$1
"
pull_with_vcs cvs
"
$1
"
"
$2
"
;;
"bzr"
*
|
*
"bzr.savannah"
*
|
"://bzr."
*
|
":bzr."
*
)
pull_with_vcs bzr
"
$1
"
pull_with_vcs bzr
"
$1
"
"
$2
"
;;
"mtn"
*
|
"://mtn."
*
|
":mtn."
*
)
pull_with_vcs mtn
"
$1
"
pull_with_vcs mtn
"
$1
"
"
$2
"
;;
"darcs"
*
|
*
"hub.darcs"
*
|
"://darcs."
*
|
":darcs."
*
)
pull_with_vcs darcs
"
$1
"
pull_with_vcs darcs
"
$1
"
"
$2
"
;;
"http"
*
".tar"
|
"http"
*
".tar."
*
|
"http"
*
".zip"
|
"http"
*
".7z"
)
pull_with_vcs http
"
$1
"
pull_with_vcs http
"
$1
"
"
$2
"
;;
"rsync:"
*
)
pull_with_vcs rsync
"
$1
"
pull_with_vcs rsync
"
$1
"
"
$2
"
;;
*
)
(>
&2
echo
"Could not detect VCS type, please use the --<vcs> switch."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment