Commit | Line | Data |
---|---|---|
92dbad5e JB |
1 | diff --git a/Makefile b/Makefile |
2 | index 4327a7a..f8e4cd9 100644 | |
3 | --- a/Makefile | |
4 | +++ b/Makefile | |
5 | @@ -1,5 +1,7 @@ | |
6 | NAME=pkg-get | |
7 | -VERSION="0.4.5" | |
8 | +VERSION="0.4.6" | |
9 | + | |
10 | +DESTDIR= | |
11 | ||
12 | PREFIX=/usr | |
13 | CFGDIR=/etc | |
14 | @@ -7,11 +9,11 @@ CFGDIR=/etc | |
15 | all: | |
16 | @echo "Use 'make install' to install pkg-get" | |
17 | ||
18 | -man: | |
19 | +man: | |
20 | makeman doc/pkg-get.8.txt | |
21 | makeman doc/pkg-repgen.8.txt | |
22 | man2ps doc/pkg-get.8 | ps2pdf14 - > doc/pkg-get.pdf | |
23 | - | |
24 | + | |
25 | dist: man | |
26 | rm -rf ${NAME}-${VERSION} | |
27 | mkdir ${NAME}-${VERSION} | |
28 | @@ -22,12 +24,11 @@ dist: man | |
29 | rm -rf ${NAME}-${VERSION} | |
30 | ||
31 | install: | |
32 | - | |
33 | - install -D -m 755 scripts/pkg-get.pl ${PREFIX}/bin/pkg-get | |
34 | - install -D -m 755 scripts/pkg-repgen.pl ${PREFIX}/bin/pkg-repgen | |
35 | - install -D -m 755 scripts/pkg-get.pl ${PREFIX}/bin/pkg-get | |
36 | - install -D -m 644 doc/pkg-get.8 ${PREFIX}/man/man8/pkg-get.8 | |
37 | - install -D -m 644 doc/pkg-get.conf ${CFGDIR}/pkg-get.conf | |
38 | - install -D -m 644 doc/pkg-repgen.8 ${PREFIX}/man/man8/pkg-repgen.8 | |
39 | - install -D -m 644 doc/pkg-get.8 ${PREFIX}/man/man8/pkg-get.8 | |
40 | + install -D -m 755 scripts/pkg-get.pl ${DESTDIR}${PREFIX}/bin/pkg-get | |
41 | + install -D -m 755 scripts/pkg-repgen.pl ${DESTDIR}${PREFIX}/bin/pkg-repgen | |
42 | + install -D -m 755 scripts/pkg-get.pl ${DESTDIR}${PREFIX}/bin/pkg-get | |
43 | + install -D -m 644 doc/pkg-get.8 ${DESTDIR}${PREFIX}/man/man8/pkg-get.8 | |
44 | + install -D -m 644 doc/pkg-get.conf ${DESTDIR}${CFGDIR}/pkg-get.conf | |
45 | + install -D -m 644 doc/pkg-repgen.8 ${DESTDIR}${PREFIX}/man/man8/pkg-repgen.8 | |
46 | + install -D -m 644 doc/pkg-get.8 ${DESTDIR}${PREFIX}/man/man8/pkg-get.8 | |
47 | ||
48 | diff --git a/doc/pkg-repgen.8 b/doc/pkg-repgen.8 | |
49 | index 17d0609..30b58fc 100644 | |
50 | --- a/doc/pkg-repgen.8 | |
51 | +++ b/doc/pkg-repgen.8 | |
52 | @@ -22,6 +22,10 @@ packages are specified. | |
53 | .SH OPTIONS | |
54 | .TP | |
55 | .B | |
56 | +\fB--prtdir\fP=PATH | |
57 | +use prtdir to override the default used by prt-get | |
58 | +.TP | |
59 | +.B | |
60 | \fB--header\fP=FILE | |
61 | insert FILE at the beginning of the html index | |
62 | .TP | |
63 | @@ -36,6 +40,8 @@ use the specified title for the index page | |
64 | \fBpkg-repgen\fP | |
65 | .PP | |
66 | \fBpkg-repgen\fP kdebase kdelibs | |
67 | +.pp | |
68 | +\fBpkg-repgen\fP --prtdir=/tmp/mytestrepo --header=/tmp/header.html | |
69 | .SH AUTHORS | |
70 | Simone Rota <sip@varlock.com> | |
71 | index generation code adapted from Jukka Heino's portspage | |
72 | diff --git a/scripts/pkg-repgen.pl b/scripts/pkg-repgen.pl | |
73 | index 2743ce4..0aa4e16 100755 | |
74 | --- a/scripts/pkg-repgen.pl | |
75 | +++ b/scripts/pkg-repgen.pl | |
76 | @@ -13,8 +13,9 @@ use warnings; | |
77 | use strict; | |
78 | use Getopt::Long; | |
79 | ||
80 | +our $prtget = "/usr/bin/prt-get"; our $prtdir; | |
81 | our $title = "CRUX Packages"; our $header; our $footer; | |
82 | -GetOptions("title=s"=>\$title, "header=s"=>\$header, "footer=s"=>\$footer); | |
83 | +GetOptions("prtdir=s"=>\$prtdir, "title=s"=>\$title, "header=s"=>\$header, "footer=s"=>\$footer); | |
84 | ||
85 | if ($#ARGV >= 0) { # single packages | |
86 | pkgrepo_single(); | |
87 | @@ -22,6 +23,9 @@ if ($#ARGV >= 0) { # single packages | |
88 | pkgread(); | |
89 | pkginst(); | |
90 | } else { | |
91 | + if ($prtdir) { | |
92 | + $prtget = "$prtget --no-std-config --config-set=\"prtdir $prtdir\""; | |
93 | + } | |
94 | pkgrepo(); | |
95 | pkgdeps(); | |
96 | pkgread(); | |
97 | @@ -40,7 +44,7 @@ sub pkgdeps_single { | |
98 | my $found = 0; | |
99 | my $package = $packages[0]; | |
100 | $package =~ s/#.*//; | |
101 | - my $deps = `prt-get printf "%e" --filter="$package"`; | |
102 | + my $deps = `$prtget printf "%e" --filter="$package"`; | |
103 | if ($deps ne "") { | |
104 | my $isnew = `grep "$p .*:" PKGDEPS`; | |
105 | if ($isnew eq ""){ # package is new, put deps at the end. | |
106 | @@ -74,10 +78,10 @@ sub pkgrepo_single { | |
107 | my $du = (-s $package); | |
108 | my $md5 = `md5sum $package`; | |
109 | $md5 =~ s/ .*$|\n//g; | |
110 | - my $des=`prt-get printf %d --filter="$name"`; | |
111 | + my $des=`$prtget printf %d --filter="$name"`; | |
112 | $des =~ s/:/ /g; | |
113 | if ($des eq ""){$des = "N.A."}; | |
114 | - my $flags=`prt-get printf %E:%O:%R --filter="$name"`; | |
115 | + my $flags=`$prtget printf %E:%O:%R --filter="$name"`; | |
116 | if ($flags eq "") {$flags = "no:no:no"} | |
117 | my $isnew = `grep "$p#" PKGREPO`; | |
118 | if ($isnew eq ""){ # package is new, put it at the end | |
119 | @@ -107,7 +111,7 @@ sub pkgdeps { | |
120 | open (my $fh, '>PKGDEPS'); | |
121 | foreach my $package (@packages) { | |
122 | $package =~ s/#.*//; | |
123 | - my $deps = `prt-get printf "%e" --filter="$package"`; | |
124 | + my $deps = `$prtget printf "%e" --filter="$package"`; | |
125 | if ($deps ne "") { | |
126 | printf $fh "%-30s : %-s\n", $package, $deps; | |
127 | } | |
128 | @@ -133,10 +137,10 @@ sub pkgrepo { | |
129 | my $du = (-s $package); | |
130 | my $md5 = `md5sum $package`; | |
131 | $md5 =~ s/ .*$|\n//g; | |
132 | - my $des=`prt-get printf %d --filter="$name"`; | |
133 | + my $des=`$prtget printf %d --filter="$name"`; | |
134 | $des =~ s/:/ /g; | |
135 | if ($des eq ""){$des = "N.A."}; | |
136 | - my $flags=`prt-get printf %E:%O:%R --filter="$name"`; | |
137 | + my $flags=`$prtget printf %E:%O:%R --filter="$name"`; | |
138 | if ($flags eq "") {$flags = "no:no:no"} | |
139 | printf $fh "%-s:%-s:%-s:%-s:%-s\n", $package,$du,$md5,$des,$flags; | |
140 | my $version = $package; | |
141 | @@ -167,7 +171,7 @@ sub pkgread { | |
142 | print $fh "# README files for repository. Do NOT remove this line.\n"; | |
143 | foreach my $package (@packages) { | |
144 | $package =~ s/#.*//; | |
145 | - my $path = `prt-get path $package`; | |
146 | + my $path = `$prtget path $package`; | |
147 | $path =~ s/\n//g; | |
148 | if (-f "$path/README"){ | |
149 | print $fh "##### PKGREADME: $package\n"; | |
150 | @@ -195,7 +199,7 @@ sub pkginst { | |
151 | my @packages = glob("*#*.pkg.tar.gz"); | |
152 | foreach my $package (@packages) { | |
153 | $package =~ s/#.*//; | |
154 | - my $path = `prt-get path $package`; | |
155 | + my $path = `$prtget path $package`; | |
156 | $path =~ s/\n//g; | |
157 | my $normal= $package; | |
158 | $normal =~ s/[^[:alnum:]]/_/g; |