@@ -252,69 +252,6 @@ shift
252
252
current_branch=$( git rev-parse --abbrev-ref HEAD)
253
253
template_path=$VOID_PKGS /srcpkgs/$@ /template
254
254
255
- longest_word () {
256
- declare -a pkgs=$@
257
- declare -i longest=0
258
- for pkg in ${pkgs[@]}
259
- do
260
- if [ ${# pkg} -gt $longest ]; then
261
- longest=${# pkg}
262
- fi
263
- done
264
-
265
- echo $longest
266
- }
267
-
268
- whitespaces () {
269
- i=0
270
- space=" "
271
- qnt_ws=$(( $1 - $2 ))
272
-
273
- while [[ " $i " != $qnt_ws ]]
274
- do
275
- space+=" "
276
- (( i+= 1 ))
277
- done
278
- echo " $space "
279
-
280
- }
281
-
282
- show_desc () {
283
- ./xbps-src show " $1 " | rg short_desc | awk ' {$1=""; print $0}'
284
- }
285
-
286
- if_instaled () {
287
- [[ " $1 " != ' ' ]] && flag=" [$colorgray *$colorreset ]" || flag=" [-]"
288
- echo -n " $flag "
289
- }
290
-
291
- lsgrep_binpkgs () {
292
- [ -d " $VOID_BINPKGS /*" ] && ls $VOID_BINPKGS /* | rg $1 || echo ' '
293
- }
294
-
295
- check_binpkgs () {
296
- check=$( lsgrep_binpkgs " $1 " )
297
- resul=$( if_instaled $check )
298
- echo -n " $resul "
299
- }
300
-
301
- search_result () {
302
- declare -a res=()
303
-
304
- pkgs=$( ls $VOID_SRCPKGS | rg $1 )
305
- lword=$( longest_word ${pkgs[@]} )
306
-
307
- for pkg in ${pkgs[@]}
308
- do
309
- wsnum=$( whitespaces $lword ${# pkg} )
310
- desc=$( show_desc $pkg )
311
- inststr=$( check_binpkgs $pkg )
312
- res+=(" $inststr $pkg$wsnum -$desc " )
313
- done
314
-
315
- printf ' %s\n' " ${res[@]} "
316
- }
317
-
318
255
build_binary () {
319
256
./xbps-src pkg " $@ " | \
320
257
while read line
@@ -341,6 +278,19 @@ xgensum_config() {
341
278
done
342
279
}
343
280
281
+ addrepos () {
282
+ check_repos=$( find $VOID_BINPKGS /* -type d)
283
+ declare -a repos
284
+ for repo in ${check_repos[@]}
285
+ do
286
+ if ! [[ " $repo " =~ repodata ]]; then
287
+ repos+=" --repository=$repo "
288
+ fi
289
+ done
290
+
291
+ echo " ${repos[@]} "
292
+ }
293
+
344
294
case " $cmd " in
345
295
346
296
# clone repo with ssh
@@ -426,8 +376,9 @@ case "$cmd" in
426
376
;;
427
377
428
378
search|s)
379
+ repos=$( addrepos)
429
380
msg -n " Searching for: $* "
430
- wrapcommand search_result " $@ "
381
+ wrapcommand xbps-query $repos -Rs " $@ "
431
382
;;
432
383
433
384
show|sw)
@@ -445,15 +396,20 @@ case "$cmd" in
445
396
shopt -u globstar
446
397
;;
447
398
448
- update|up )
399
+ update-repo|upr )
449
400
msg " Update void-packages from void-linux remote master"
450
401
git pull void-linux master
451
402
msg " Push commits to my own repo"
452
403
git push -u origin $current_branch
453
404
;;
454
405
406
+ update-sys|ups)
407
+ msg " Rebuilds packages in system and updates them."
408
+ wrapcommand ./xbps-src update-sys
409
+ ;;
410
+
455
411
xgsum)
456
- msg -n " Generate/Update SHA256 sum in: $* /template "
412
+ msg -n " Generate/Update SHA256 sum in: $@ /template "
457
413
wrapcommand xgensum_config $template_path
458
414
;;
459
415
@@ -464,7 +420,7 @@ case "$cmd" in
464
420
add-commit-new-pkg|anp)
465
421
msg " Add new package to repository: branch -> $current_branch "
466
422
git add .
467
- wrapcomand git commit -m " New package: $* "
423
+ wrapcomand git commit -m " New package: $@ "
468
424
;;
469
425
470
426
push-commit|pc)
0 commit comments