|
| 1 | +.Dd Feb 11, 2023 |
| 2 | +.Dt XBPS-UHELPER 1 |
| 3 | +.Os |
| 4 | +.Sh NAME |
| 5 | +.Nm xbps-uhelper |
| 6 | +.Nd XBPS helper utilities |
| 7 | +.Sh SYNOPSIS |
| 8 | +.Nm |
| 9 | +.Op OPTIONS |
| 10 | +.Ar ACTION |
| 11 | +.Op ARGUMENTS |
| 12 | +.Sh DESCRIPTION |
| 13 | +The |
| 14 | +.Nm |
| 15 | +utility provides various utilities for interacting with XBPS and XBPS packages. |
| 16 | +.Sh ARGUMENT TYPES |
| 17 | +.Ss BINPKG |
| 18 | +A |
| 19 | +.Ar binpkg |
| 20 | +argument is a string of the format |
| 21 | +.Em <pkgname>-<version>_<revision>.<arch>.xbps , |
| 22 | +like the filename of a binary package. |
| 23 | +.Ss PKGVER |
| 24 | +A |
| 25 | +.Ar pkgver |
| 26 | +argument is a string of the format |
| 27 | +.Em <pkgname>-<version>_<revision> , |
| 28 | +like the |
| 29 | +.Em pkgver |
| 30 | +property. |
| 31 | +.Ss PKGPATTERN |
| 32 | +A |
| 33 | +.Ar pkgpattern |
| 34 | +argument is package expression specifying a package name and version separated |
| 35 | +by any of the following version comparators: |
| 36 | +.Pp |
| 37 | +.Bl -tag -width xx -compact |
| 38 | +.It Sy < |
| 39 | +less than |
| 40 | +.It Sy > |
| 41 | +greater than |
| 42 | +.It Sy <= |
| 43 | +less or equal than |
| 44 | +.It Sy >= |
| 45 | +greater or equal than |
| 46 | +.Pp |
| 47 | +.El |
| 48 | +Example: |
| 49 | +.Dq Sy foo>=2.0 . |
| 50 | +.Sh OPTIONS |
| 51 | +.Bl -tag -width -x |
| 52 | +.It Fl C, Fl -config Ar dir |
| 53 | +Specifies a path to the XBPS configuration directory. |
| 54 | +If the first character is not '/' then it's a relative path of |
| 55 | +.Ar rootdir . |
| 56 | +.It Fl d, Fl -debug |
| 57 | +Enables extra debugging shown to stderr. |
| 58 | +.It Fl h, Fl -help |
| 59 | +Show the help message. |
| 60 | +.It Fl r, Fl -rootdir Ar dir |
| 61 | +Specifies a full path for the target root directory. |
| 62 | +.It Fl V, Fl -version |
| 63 | +Show the version information. |
| 64 | +.El |
| 65 | +.Sh ACTIONS |
| 66 | +.Bl -tag -width xx |
| 67 | +.It Cm arch |
| 68 | +Prints the XBPS native arch. |
| 69 | +.It Cm binpkgarch Ar binpkg ... |
| 70 | +Prints the arch of |
| 71 | +.Ar binpkg |
| 72 | +strings. |
| 73 | +.It Cm binpkgver Ar binpkg ... |
| 74 | +Prints the pkgver of |
| 75 | +.Ar binpkg |
| 76 | +strings. |
| 77 | +.It Cm cmpver Ar instver Ar reqver |
| 78 | +Compare two |
| 79 | +.Ar pkgver |
| 80 | +strings, |
| 81 | +.Ar instver |
| 82 | +(installed) vs |
| 83 | +.Ar reqver |
| 84 | +(required). |
| 85 | +See |
| 86 | +.Sx EXIT STATUS |
| 87 | +for more information. |
| 88 | +.It Cm getname Ar string ... |
| 89 | +Prints the pkgname of |
| 90 | +.Ar pkgpatterns |
| 91 | +and/or |
| 92 | +.Ar pkgvers . |
| 93 | +This is a combination of |
| 94 | +.Cm getpkgdepname |
| 95 | +and |
| 96 | +.Cm getpkgname . |
| 97 | +.It Cm getversion Ar string ... |
| 98 | +Prints the version of |
| 99 | +.Ar pkgpatterns |
| 100 | +and/or |
| 101 | +.Ar pkgvers . |
| 102 | +This is a combination of |
| 103 | +.Cm getpkgdepversion |
| 104 | +and |
| 105 | +.Cm getpkgversion . |
| 106 | +.It Cm getpkgdepname Ar pkgpattern ... |
| 107 | +Prints the pkgname of package dependency patterns. |
| 108 | +.It Cm getpkgdepversion Ar pkgpattern |
| 109 | +Prints the version of package dependency patterns. |
| 110 | +.It Cm getpkgname Ar pkgver ... |
| 111 | +Prints the name of package strings. |
| 112 | +.It Cm getpkgrevision Ar pkgver ... |
| 113 | +Prints the revision of package strings. |
| 114 | +.It Cm getpkgversion Ar pkgver ... |
| 115 | +Prints the version of package strings. |
| 116 | +.It Cm getsystemdir |
| 117 | +Prints the xbps system directory |
| 118 | +.Po |
| 119 | +.Pa <sharedir>/xbps.d |
| 120 | +.Pc . |
| 121 | +.It Cm pkgmatch Ar pkgver Ar pkgpattern |
| 122 | +Matches a |
| 123 | +.Ar pkgver |
| 124 | +with a |
| 125 | +.Ar pkgpattern . |
| 126 | +See |
| 127 | +.Sx EXIT STATUS |
| 128 | +for more information. |
| 129 | +.It Cm real-version Ar pkgname ... |
| 130 | +Prints the version of installed real packages. |
| 131 | +.It Cm version Ar pkgname ... |
| 132 | +Prints the version of installed packages. |
| 133 | +.El |
| 134 | +.Sh EXIT STATUS |
| 135 | +.Ex -std |
| 136 | +Exceptions to this are: |
| 137 | +.Bl -tag -width xx |
| 138 | +.It Cm cmpver Ar instver Ar reqver |
| 139 | +.Bl -tag -width xxx -compact |
| 140 | +.It 1 |
| 141 | +if |
| 142 | +.Ar instver |
| 143 | +is greater than |
| 144 | +.Ar reqver . |
| 145 | +.It 0 |
| 146 | +if |
| 147 | +.Ar instver |
| 148 | +is equal to |
| 149 | +.Ar reqver . |
| 150 | +.It 255 |
| 151 | +if |
| 152 | +.Ar instver |
| 153 | +is less than |
| 154 | +.Ar reqver . |
| 155 | +.El |
| 156 | +.It Cm pkgmatch Ar pkgver Ar pkgpattern |
| 157 | +.Bl -tag -width xxx -compact |
| 158 | +.It 1 |
| 159 | +.Ar pkgver |
| 160 | +matches |
| 161 | +.Ar pkgpattern . |
| 162 | +.It 0 |
| 163 | +.Ar pkgver |
| 164 | +does not match |
| 165 | +.Ar pkgpattern . |
| 166 | +.It 255 |
| 167 | +An error occurred. |
| 168 | +.El |
| 169 | +.El |
| 170 | +.Sh EXAMPLES |
| 171 | +Compare package versions: |
| 172 | +.Pp |
| 173 | +.Dl $ xbps-uhelper cmpver 'foo-1.0_1' 'foo-2.1_1' |
| 174 | +.Dl $ xbps-uhelper cmpver 1.0 2.1 |
| 175 | +.Pp |
| 176 | +Get the package name for dependency pattern |
| 177 | +.Dq foo>=0 : |
| 178 | +.Pp |
| 179 | +.Dl $ xbps-uhelper getpkgdepname 'foo>=0' |
| 180 | +.Pp |
| 181 | +Get the version expression for the dependency pattern |
| 182 | +.Dq foo>=0 : |
| 183 | +.Pp |
| 184 | +.Dl $ xbps-uhelper getpkgdepversion 'foo>=0' |
| 185 | +.Pp |
| 186 | +Get the package name for pkgver |
| 187 | +.Dq foo-2.0_1 : |
| 188 | +.Pp |
| 189 | +.Dl $ xbps-uhelper getpkgname foo-2.0_1 |
| 190 | +.Pp |
| 191 | +Get the revision for pkgver |
| 192 | +.Dq foo-2.0_1 : |
| 193 | +.Pp |
| 194 | +.Dl $ xbps-uhelper getpkgrevision foo-2.0_1 |
| 195 | +.Pp |
| 196 | +Get the version for pkgver |
| 197 | +.Dq foo-2.0_1 : |
| 198 | +.Pp |
| 199 | +.Dl $ xbps-uhelper getpkgversion foo-2.0_1 |
| 200 | +.Pp |
| 201 | +Check if the pkgver |
| 202 | +.Dq foo-1.0_1 |
| 203 | +matches the dependency pattern |
| 204 | +.Dq foo>=1.0 : |
| 205 | +.Pp |
| 206 | +.Dl $ xbps-uhelper pkgmatch foo-1.0_1 'foo>=1.0' |
| 207 | +.Pp |
| 208 | +Get the version for the installed package |
| 209 | +.Dq foo : |
| 210 | +.Pp |
| 211 | +.Dl $ xbps-uhelper version foo |
| 212 | +.Pp |
| 213 | +Get the names of packages from a list of pkgvers: |
| 214 | +.Pp |
| 215 | +.Dl $ xbps-query -Rp pkgver -s foo | cut -d: -f1 | xargs xbps-uhelper getpkgname |
| 216 | +.Pp |
| 217 | +Get the names of dependencies for a package: |
| 218 | +.Pp |
| 219 | +.Dl $ xbps-query -Rp run_depends xf86-video-amdgpu | xargs xbps-uhelper getname |
| 220 | +.Sh ENVIRONMENT |
| 221 | +.Bl -tag -width XBPS_TARGET_ARCH |
| 222 | +.It Sy XBPS_ARCH |
| 223 | +Overrides |
| 224 | +.Xr uname 2 |
| 225 | +machine result with this value. |
| 226 | +Useful to install packages with a fake |
| 227 | +architecture. |
| 228 | +.It Sy XBPS_TARGET_ARCH |
| 229 | +Sets the target architecture to this value. |
| 230 | +This variable differs from |
| 231 | +.Sy XBPS_ARCH |
| 232 | +in that it allows you to install packages partially, because |
| 233 | +configuration phase is skipped (the target binaries might not be compatible with |
| 234 | +the native architecture). |
| 235 | +.El |
| 236 | +.Sh FILES |
| 237 | +.Bl -tag -width /var/db/xbps/.<pkgname>-files.plist |
| 238 | +.It Ar /etc/xbps.d |
| 239 | +Default configuration directory. |
| 240 | +.It Ar /usr/share/xbps.d |
| 241 | +Default system configuration directory. |
| 242 | +.It Ar /var/db/xbps/.<pkgname>-files.plist |
| 243 | +Package files metadata. |
| 244 | +.It Ar /var/db/xbps/pkgdb-0.38.plist |
| 245 | +Default package database (0.38 format). Keeps track of installed packages and properties. |
| 246 | +.It Ar /var/cache/xbps |
| 247 | +Default cache directory to store downloaded binary packages. |
| 248 | +.El |
| 249 | +.Sh SEE ALSO |
| 250 | +.Xr xbps-checkvers 1 , |
| 251 | +.Xr xbps-create 1 , |
| 252 | +.Xr xbps-dgraph 1 , |
| 253 | +.Xr xbps-digest 1 , |
| 254 | +.Xr xbps-fbulk 1 , |
| 255 | +.Xr xbps-fetch 1 , |
| 256 | +.Xr xbps-install 1 , |
| 257 | +.Xr xbps-pkgdb 1 , |
| 258 | +.Xr xbps-query 1 , |
| 259 | +.Xr xbps-reconfigure 1 , |
| 260 | +.Xr xbps-remove 1 , |
| 261 | +.Xr xbps-rindex 1 , |
| 262 | +.Xr xbps-uchroot 1 , |
| 263 | +.Xr xbps-uunshare 1 , |
| 264 | +.Xr xbps.d 5 |
| 265 | +.Sh AUTHORS |
| 266 | +.An Juan Romero Pardines Aq Mt xtraeme@gmail.com |
| 267 | +.Sh BUGS |
| 268 | +Report bugs at |
| 269 | +.Lk https://github.com/void-linux/xbps/issues |
0 commit comments