Coder Social home page Coder Social logo

customizepkg's People

Contributors

ava1ar avatar dffischer avatar dmitrik avatar justcryen avatar levitatingbusinessman avatar nogweii avatar stevenhoneyman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

customizepkg's Issues

Eval broken for a pkgname with multiple names

I'll try and get something in place to fix as soon as I can, but I've had very little time to spend on open source stuff lately. My current broken package is qemu. this breaks the script at line 149:

pkgname=('qemu'
         'qemu-block-iscsi'
         'qemu-block-rbd'
         'qemu-block-gluster'
         'libcacard')

Feature Request: Adhering to xdg-base-dir standard

I just found out about your tool and it seems to be just the tool I missed for a while, I have only one gripe with it:
It forces me to put another directory in my already-bloated home directory. Therefore I suggest to make use of the XDG Base Directory Standard (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#basics) to locate for the customizepkg directory. For backwards-compatibility we could still look into the old directories, but I would really like it if we have the standard-conforming paths as default in the README.

For example, without setting $XDG_CONFIG_HOME, the files would now be expected to be in ~/.config/customizepkg instead of ~/.customizepkg. For the global configuration, if $XDG_CONFIG_DIRS is unset, use /etc/xdg/customizepkg.d instead of /etc/customizepkg. But to be honest, I think we can let the default for the global directory stay the same and simply use $XDG_CONFIG_DIRS if it's set.

This has the advantage of making a backup of all user configuration files (of all programs using the xdg-standard) simpler than listing all folders in ~ which should be backed up. This also makes it configurable for users who have their own idea of where config files should go.

patch should support specifying files in the .files directory for a package

This would allow me to not have to specify absolute paths (brittle across multiple hosts).

$ tree ~/.customizepkg/
~/.customizepkg
├── kdeplasma-applets-menubar-archway-bzr
└── kdeplasma-applets-menubar-archway-bzr.files
    └── remove_right_icon.diff

$ cat ~/.customizepkg/remove_right_icon.diff
patch#1#remove_right_icon.diff

Unable to do replacements that contain # in the pattern

due to using read -r, you can't do a replacement that has a # in the pattern, because read just recognises the # as the delimiter and you can't escape it because of the use of -r. In my case, this matters because mozc-ut has commented out variables that you are supposed to uncomment to enable features the package can provide, and I would prefer for that process to be automatic. removing the -r would probably fix this for this case, but has a chance of ruining other people's customizations, so I'm not entirely sure what to do.

Executable bit is ignored

If you mark a file as executable, the executable bit is lost when it is copied so it will be interpreted as a normal file rather than executed.

After the cp command you could do something like:

# copy the config file to current directory
cp "${CONFIGDIR}/${package}" "./${package}.customize"
if [ -x "${CONFIGDIR}/${package}" ]; then
  chmod +x "./${package}.customize"
fi

The ability to add a new line

It seems that the latest version does not support adding a new line, which makes it hard to apply an additional patch. Could you add this functionality to customizepkg?

Thanks!

Your last commit broke substitutions&removals in depends/makedepends

Hi! It's been a while since I've used this much (started to move away from yaourt/abs/arch). However, I've just been doing a clean install of Arch, so customizepkg was your latest version (pipes instead of @ symbols). Unforutnately this for some reason breaks a lot of things for changing/removing depends and makedepends (haven't tried to see why yet - still busy installing!)

Here's what the output looks like, the first is your latest version; the second is when I went back 1 commit:

==> Building glances from sources.

==> Retrieving PKGBUILD and local sources...
x PKGBUILD
=> adds '!emptydirs' in options
=> replaces ''python'' with ''python2'' in depends
=> replaces ''python-psutil'' with ''python2-psutil'' in depends
=> removes ''python-setuptools'' from depends
=> adds 'python2-setuptools' in makedepends
=> replaces 'python.*$' with 'find . -type f -name "*.py" -exec sed -i "s/env python/env python2/" {} \\; \n&' in package
=> replaces '^python' with 'python2' in package
=> replaces 'images}$' with '&\n rm -r "$pkgdir/usr/share/locale/de" \n  echo "/usr/bin/python2 -m glances" >"$pkgdir/usr/bin/glances"' in package
--- ./PKGBUILD  2014-09-18 22:07:49.000000000 +0000
+++ ./PKGBUILD.custom   2014-09-19 17:38:18.898007583 +0000
@@ -3,6 +3,8 @@
 # Contributor: Bartłomiej Piotrowski <[email protected]>
 # Contributor: Francois Boulogne <fboulogne at april dot org>

+options=('!emptydirs')
+makedepends=('python2-setuptools')
 pkgname=glances
 pkgver=2.1
 pkgrel=1
@@ -19,9 +21,12 @@

 package() {
   cd Glances-$pkgver
-  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
+  find . -type f -name "*.py" -exec sed -i "s/env python/env python2/" {} \; 
+python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
   # remove html doc
   rm -r "$pkgdir/usr/share/doc/$pkgname"/{glances-doc.html,images}
+ rm -r "$pkgdir/usr/share/locale/de" 
+  echo "/usr/bin/python2 -m glances" >"$pkgdir/usr/bin/glances"
 }

 # vim:set ts=2 sw=2 et:
==> Edit PKGBUILD ? [y/N] ("A" to abort)
==> ------------------------------------
==> a

==> Aborted...
==> Building glances from sources.

==> Retrieving PKGBUILD and local sources...
x PKGBUILD
=> adds '!emptydirs' in options
=> replaces ''python'' with ''python2'' in depends
=> replaces ''python-psutil'' with ''python2-psutil'' in depends
=> removes ''python-setuptools'' from depends
=> adds 'python2-setuptools' in makedepends
=> replaces 'python.*$' with 'find . -type f -name "*.py" -exec sed -i "s/env python/env python2/" {} \\; \n&' in package
=> replaces '^python' with 'python2' in package
=> replaces 'images}$' with '&\n rm -r "$pkgdir/usr/share/locale/de" \n  echo "/usr/bin/python2 -m glances" >"$pkgdir/usr/bin/glances"' in package
--- ./PKGBUILD  2014-09-18 22:07:49.000000000 +0000
+++ ./PKGBUILD.custom   2014-09-19 17:42:17.454677791 +0000
@@ -3,6 +3,8 @@
 # Contributor: Bartłomiej Piotrowski <[email protected]>
 # Contributor: Francois Boulogne <fboulogne at april dot org>

+options=('!emptydirs')
+makedepends=('python2-setuptools')
 pkgname=glances
 pkgver=2.1
 pkgrel=1
@@ -10,7 +12,7 @@
 arch=('any')
 url='https://github.com/nicolargo/glances'
 license=('LGPL')
-depends=('python' 'python-psutil' 'python-setuptools')
+depends=(python2 python2-psutil)
 optdepends=('python-jinja: HTML export'
             'python-bottle: web server support'
             'hddtemp: HDD temperature monitoring support')
@@ -19,9 +21,12 @@

 package() {
   cd Glances-$pkgver
-  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
+  find . -type f -name "*.py" -exec sed -i "s/env python/env python2/" {} \; 
+python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
   # remove html doc
   rm -r "$pkgdir/usr/share/doc/$pkgname"/{glances-doc.html,images}
+ rm -r "$pkgdir/usr/share/locale/de" 
+  echo "/usr/bin/python2 -m glances" >"$pkgdir/usr/bin/glances"
 }

 # vim:set ts=2 sw=2 et:
==> Edit PKGBUILD ? [y/N] ("A" to abort)

Failure when # in quoted string

Line 158 of customizepkg:
eval $(grep -Po '^[[:blank:]]__?(pkg._|name)=[^#]*(?= *#|$)' ./PKGBUILD)

fails on the slic3r-git package:
https://aur4.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=slic3r-git

The regular expression is unable to handle the fact that a # appears inside of a quoted string, as in line 118 of the PKGBUILD:
_pkgver="$(awk '/#define SLIC3R_VERSION/ {gsub(/"/, "", $3); print $3 }' ./xs/src/libslic3r/libslic3r.h).$(git rev-parse --short HEAD)"

Any chance we can get this sorted?

addline global is broken

Sed implies global when appending. Extra '/g' switch results with 'g' beeing added to the end of the line (when using 'addline' with global context)

Files are not added when script is executable

When I add files in /etc/customizepkg.d/pkg.files, they get appended to pkg.customize. When the script is executable, these instructions are not interpreted correctly.

Just as a suggestion, why not add another directory for scripts.

ie: /etc/customizepkg.d/pkg.scripts
which would contain scripts that would be run in alphanumeric order? Then I could make /etc/customizepkg.d/pkg not executable and place my script(s) in that directory and still get the files and customizepkg syntax in the main file.

global customizations?

Is there any chance for you to add global customizations?

This would be nice for other architectures, i.e. on the raspberry pi to add 'armv6h' to the supported platforms.

PKGBUILDS with multiple checksum functions

This is hardly an issue with customizepkg, but when a PKGBUILD has two sets of checksums customizepkg will modify the first set it finds. But makepkg might use the latter.

This is currently happening with the gqrx-git package, where customizepkg is modifying the md5sums and makepkg is using the sha256sums.

New grep version crashes customizepkg

New grep 2.24.1 throws error about insecure usage of $ and ^ in perl type regexp when '-z' is enebled.
This is a fix around pcre mishandling those type of patterns grep commit
Fix: remove '-z' flag (multi-line fields rarely if ever appears in PKGBUILD )

Does it work with non-AUR packages?

I created /etc/customizepkg.d/linux. But whenever i run pacman -S linux (or yay -S linux), it doesn't compile with PKGBUILD like expected. It just installs normally. What i'm doing wrong?

Patches of some PKGBUILD ignored

PKGBUILD without the normal header are ignored. Since they begin with a non-printable character, causing the initial pkgname parsing to ignore the option. One example is the mutt-sidebar package.

To work around the issue you can move the pkgname directive below some other unimportant variable declaration in the PKGBUILD.

patching PKGBUILD is broken

Before patching a PKGBUILD the patch file was added to PKGBUILD as one of sources which breaks the build script.
PKGBUILD : gpx-git
PKGBUILD.patch : http://pastebin.com/PPiY9kXC
/etc/customizepkg.d/gpx-git : patch#pkgbuild#PKGBUILD.patch
customizepkg output : http://pastebin.com/HG68dSS5

As a solution i can think off putting the modify_file before adding new files from ${CFGDIR}/${package} folder and marking PKGBUILD.patch in modify_file to be ignore in patch including function

Issue with multiline value of pkgdesc variable

I'm creating this issue just to give info to googlers. It is fixed in #29

/usr/bin/customizepkg: line 167: warning: command substitution: ignored null byte in input
/usr/bin/customizepkg: eval: line 167: unexpected EOF while looking for matching `"'
/usr/bin/customizepkg: eval: line 168: syntax error: unexpected end of file

Patching should use absolute path

In many PKGBUILD there is an extra subdir in $srcdir in which the build process occurs. Patch option wont work for those packages as it use relative path. In order to fix the issue the absolute path to the pach files should be used.
/usr/bin/customizepkg : patch http://pastebin.com/E9S3wkSw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.