summary refs log tree commit diff
diff options
context:
space:
mode:
authorPiotr Wójcik <chocimier@tlen.pl>2019-12-14 15:34:46 +0100
committerLeah Neukirchen <leah@vuxu.org>2019-12-15 21:38:14 +0100
commit30eeec30515a3bfe47872528c1ef09ac861d561b (patch)
tree29337801a304be3c7ed4c33bcdf5ed521b1feb2d
parent87a225c26e9046db5e552e6f78c1bd3d7eeb733b (diff)
downloadxtools-30eeec30515a3bfe47872528c1ef09ac861d561b.tar.gz
xtools-30eeec30515a3bfe47872528c1ef09ac861d561b.tar.xz
xtools-30eeec30515a3bfe47872528c1ef09ac861d561b.zip
xnew: append subpkgs
Closes: #164 [via git-merge-pr]
-rw-r--r--README3
-rwxr-xr-xxnew9
-rw-r--r--xtools.16
3 files changed, 17 insertions, 1 deletions
diff --git a/README b/README
index 0504421..7ef0596 100644
--- a/README
+++ b/README
@@ -68,7 +68,8 @@ COMMANDS
 
      xmypkgs [email] – list all pkgs maintained by you
 
-     xnew pkg – create XBPS template
+     xnew [-a] pkg [subpkgs ...] – create XBPS template
+       -a  append subpkgs to existing pkg
 
      xnodev – list not installed -devel packages for installed packages
 
diff --git a/xnew b/xnew
index 49fa5a5..8473d48 100755
--- a/xnew
+++ b/xnew
@@ -1,6 +1,11 @@
 #!/bin/sh -e
 # xnew PKG - create XBPS template template
 
+if [ "$1" = "-a" ]; then
+	append=1
+	shift
+fi
+
 PKG=${1?no package name given}
 srcdir=$(xdistdir)/srcpkgs
 shift
@@ -29,6 +34,8 @@ case "$PKG" in
 	distfiles="$homepage\${pkgname}-\${version}.$ext"
 esac
 
+if [ -z "$append" ]; then
+
 mkdir $srcdir/$PKG
 
 cat >$srcdir/$PKG/template <<EOF
@@ -56,6 +63,8 @@ distfiles="$distfiles"
 checksum=badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb
 EOF
 
+fi
+
 for subpkg; do
 	ln -sr -- "$srcdir/$PKG" "$srcdir/$subpkg"
 	cat >>$srcdir/$PKG/template <<EOF
diff --git a/xtools.1 b/xtools.1
index eadf347..c20b794 100644
--- a/xtools.1
+++ b/xtools.1
@@ -143,8 +143,14 @@ Sync with the official git based xlocate database
 .Nd list all pkgs maintained by you
 .Pp
 .Nm xnew
+.Op Fl a
 .Ar pkg
+.Op Ar subpkgs ...
 .Nd create XBPS template
+.Bl -tag -offset 2n -width 2n -compact
+.It Fl a
+append subpkgs to existing pkg
+.El
 .Pp
 .Nm xnodev
 .Nd list not installed -devel packages for installed packages